20090924

FSCK'd

After messing up the superblock on the root partition and completely crashing one of the servers here at work. I figured that I would try the "rescue cd" to drop down to the shell and run fsck. My limited experience with LVM showed yesterday. After reading man page after man page I realized the LVM tools aren’t on the so called “rescue cd”. LVM is the standard implementation on fedora and It would only be logical to have LVM tools on the “rescue cd”. Nevertheless I used a knoppix cd to get to the shell and fsck'ed the root partition. The box boots now but its not giving me a log in prompt. I booted to shell again and mounting the lv_root to find that everything has been moved to the a lost+found directory and renamed to # followed by a bunch of numbers (inode number). After reading for hours I've come to the conclusion that the data cannot be automatically restored back to its original file name and location. I did a file count (ls -R wc) and it would require me to manually rename and move 2,826,046 files. I'm going to try running fsck again using alternate superblock locations in hopes that it will restore the file names, otherwise to save time I'm just going to format and reinstall Fedora.


NOTES:

Enabling The Volume Group & Mounting The Logical Volume
modprobe dm_mod (optional, not always required)
vgscan (locate LV's)
vgchange -a y (enable the LV's)
lvm lvs (list of LV's)
mount /dev/vg_(hostname)/lv_root /mnt

Checking The File System
DO NOT CHECK A MOUNTED FILE SYSTEM
fsck -a /dev/vg_(hostname)/lv_root (checking the file system and automatically repairing)

Locating Alternate Superblock Locations
mkfs -n /dev/vg_(hostname)/lv_root (the n switch means show me what you would do, but don’t actually do it)

No comments: