Sunday, December 7, 2008

Check an ext2/ext3/ext4 filesystem for errors

To check an ext2/ext3/ext4 filesystem for errors use e2fsck. The filesystem must be umounted and the command must be run as root. The -c option tells e2fsck to do a read-only scan of the device to check for bad blocks. For example: toro@moutere:~$ sudo e2fsck /dev/sda3
e2fsck 1.41.11 (14-Mar-2010)
test: clean, 11/2008 files, 1325/8032 blocks
toro@moutere:~$ sudo e2fsck -c /dev/sda3
e2fsck 1.41.11 (14-Mar-2010)
Checking for bad blocks (read-only test): done
test: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

test: ***** FILE SYSTEM WAS MODIFIED *****
test: 11/2008 files (9.1% non-contiguous), 1325/8032 blocks

Sources

  • man e2fsck

No comments:

Post a Comment