Apache – No space left on device

Apache had crashed and when trying to restart it with service restart apache or /etc/init.d/apache restart the following error would result in the error_log file:

 (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed

There weren’t any apache processes lingering around and the disk had plenty of space and inodes left. The following URL helped fix the problem, or, a reboot would have worked too:

URL:

This URL suggested the following commands to debug and fix:

ipcs -s | grep apache
ipcs -s | grep apache | perl -e ‘while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}’

Which worked for me.  Also suggested the following for Ubuntu 8.04:

ipcs -s | grep www-data | sudo perl -alne ‘qx(ipcrm -s $F[1])’

Ubuntu software RAID primary disk failure

OS: Ubuntu 6.06
Setup: 2 disks RAID 1.  3 partitions, 2 of which are md devices.
Problem:Primary disk failure with grub 25 error and bad sectors

Machine was not booting past grub 1.5 and was saying “Error 25”.

Grub error code 25:

 25 : Disk read error: This error is returned if there is a disk read error when trying to probe or read data from a particular disk.

Basically the primary disk was wasted, but, the second disk wouldn’t boot because the primary disk was active enough to start up grub stage 1.5… and fail.

Booted up with the Ubuntu 6.06 CDROM and selected rescue.  Setup networking and then was given an option to try and start a shell on any of the partitions.

Although disk0 was the faulty disk it was not possible to mount any of the disk1 partitions and it gave an error.

Was able to mount the root partition on the faulty disk and use a shell from the rescue disk.

Ran fsck.ext3  on /dev/hdc1, /dev/hdc3 and corrected any errors on the partitions.

In the shell it was possible to mount the mdX raid devices, but, not the individual /dev/hdcX devices as they were already in use.  “cat /proc/mdstat” showed that hdc was being used by the md0/md1 devices.

Mounted the file systems on the secondary disk with:

mount /dev/md1 /mnt
mount /dev/md0 /mnt/boot
chroot /mnt

Then ran grub and following commands:

grub>device (hd0) /dev/hdc
grub>root (hd0,0)
grub>setup (hd0)
grub>quit

Now, grub was definately installed on the second disk but on reboot it would still boot off the first disk.  Removed the partition table from the faulty disk0 using fdisk and rebooted and the system booted up fine other than numerous hda disk errors.

URL: