One system had an issue with the secondary drive. The monitoring system reported it was in a Read-Only state. Suspecting a bad superblock as they happen from time to time; I gave the system a reboot.
As expected; I received:
*** An error occurred during the file system check. *** Dropping you to a shell; the system will reboot. *** When you leave the shell. Give root password for maintenance (or type Control-D) (repair file system)#
In my situation, I was interested in this part:
Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes 255 heads, 63 sectors/track, 17844 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d1p1 * 1 17844 143331898+ 83 Linux
If you have multiple partitions, you can verify the label as a precaution (that is if it’s still intact) by using the e2label command. For example:
Having verified the partition, it’s time to restore the superblock by using backup. This is accomplished by using the mke2fs command. Note: if the OS is running, you will need to unmount the drive.
mke2fs -n /dev/cciss/c0d1p1
It will list output (I forgot to copy it), but at the bottom you will see:
Superblock backups stored on blocks: (various numbers)
It doesn’t matter which one you choose; I picked the third one. To start the restore of the superblock; enter:
e2fsck -y -b <block number> /dev/your drive path
The “-y” option is a good idea if your partition is large. Otherwise, you will find yourself pressing the “y” key many many times.
Once it’s completed, reboot the system.
Don’t be surprised if it doesn’t solve it on the first pass. Simply re-list the backup superblocks and use a different one for the e2fsck command. In my situation, it took three attempts.
Much as I would like to impress you with my knowledge, I have to give people their acknowledgments for reviewing their blog and site for review.