Friday, June 3, 2011

Recently, my HTPC began to throw an error upon boot, namely:

An error occurred while mounting /home/house
Press S to skip or M for manual recovery

My /home directory is located on a second hard disk, which I had recently upgraded from a 500GB to a 2TB drive. Running fsck from the shell I got when pressing "M" didn't do the trick. It found no errors and gave me no output. This was strange, but rather than troubleshooting that way (and subjecting myself to sitting awkwardly on the floor in front of my TV with a backup keyboard & mouse), I opted to pull the drive from the tower and hook it up to my laptop as an external drive. This at least made the whole affair somewhat ergonomic!

At any rate, I was able to successfully fix the issues the drive was having at this point using fsck. The relevant terminal output is below.

$ sudo fsck -p -t ext4 /dev/sdb1
fsck from util-linux-ng 2.17.2
/dev/sdb1 contains a file system with errors, check forced.
/dev/sdb1: Deleted inode 34604232 has zero dtime.  FIXED.
/dev/sdb1: Inodes that were part of a corrupted orphan linked list found.  

/dev/sdb1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
    (i.e., without -a or -p options)
rick@satellite:~$ sudo fsck -t ext4 /dev/sdb1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.14 (22-Dec-2010)
/dev/sdb1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix? yes

Inode 34604378 was part of the orphaned inode list.  FIXED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(44735--44749) -(44759--44766)
Fix? yes

Free blocks count wrong for group #1 (1740, counted=1763).
Fix? yes

Free blocks count wrong (378412112, counted=378412135).
Fix? yes

Inode bitmap differences:  -34604232 -34604378
Fix? yes

Free inodes count wrong for group #4224 (6824, counted=6826).
Fix? yes

Free inodes count wrong (121926425, counted=121926427).
Fix? yes


/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb1: 175333/122101760 files (1.4% non-contiguous), 109965865/488378000 blocks


At this point, I was able to hook the drive back up in my HTPC and it booted again.