Is there any way to mount an EXT4 file system with errors?

by JonTheNiceGuy   Last Updated June 22, 2018 11:00 AM

I may have been somewhat foolish, but kept putting off the warning signs about the impending failure of my EXT4-on-LVM Ubuntu machine (like the partition remounting itself R/O, SMART errors, etc.) and one day, the FSCK shows "filesystem still has errors"... gulp

I've bought a replacement drive, and I have confirmed I can still see data using photorec, but I was wondering... is there anyway to mount an EXT4 volume even though the OS knows it's broken?

See, I don't need everything on the drive. I basically would like to recover whatever I can from one directory's worth of text files. Running photorec will (probably) get those files back, but it'll mean running lots of greps against the recovered files to find the one-or-two lines of files that I can then use to figure out the bits I'm missing.

Any guidance gratefully accepted!

UPDATE: From another machine, when I try to mount the drive, I get:

[email protected]:~# mount /dev/mapper/xubuntu--vg-root /mnt/
mount: /mnt: mount(2) system call failed: Structure needs cleaning.

Running fsck against that volume, I get:

[email protected]:~# fsck /dev/mapper/xubuntu--vg-root -y
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Block bitmap for group 0 is not in group.  (block 2553887680)
Relocate? yes

Inode table for group 0 is not in group.  (block 3715727360)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

One or more block group descriptor checksums are invalid.  Fix? yes

Group descriptor 0 checksum is 0x11b0, should be 0xaa26.  FIXED.
Block bitmap for group 1792 is not in group.  (block 2553887680)
Relocate? yes

Inode table for group 1792 is not in group.  (block 3682172928)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Group descriptor 1792 checksum is 0x89a0, should be 0xbabe.  FIXED.
Inode bitmap for group 1793 is not in group.  (block 2097156110)
Relocate? yes

Group descriptor 1793 checksum is 0x5c04, should be 0xd977.  FIXED.
Inode bitmap for group 1795 is not in group.  (block 419506184)
Relocate? yes

Group descriptor 1795 checksum is 0xb484, should be 0x4875.  FIXED.
Inode bitmap for group 1796 is not in group.  (block 2197819406)
Relocate? yes

Group descriptor 1796 checksum is 0x7b44, should be 0x92f0.  FIXED.
Block bitmap for group 1920 is not in group.  (block 2553887680)
Relocate? yes

Inode table for group 1920 is not in group.  (block 3648618496)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Group descriptor 1920 checksum is 0x2073, should be 0xab14.  FIXED.
Block bitmap for group 4096 is not in group.  (block 2553887680)
Relocate? yes

Inode table for group 4096 is not in group.  (block 4151934976)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Group descriptor 4096 checksum is 0xc961, should be 0x6ce7.  FIXED.
Block bitmap for group 6016 is not in group.  (block 2553887680)
Relocate? yes

Inode table for group 6016 is not in group.  (block 4000940032)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Group descriptor 6016 checksum is 0x9648, should be 0x6dd5.  FIXED.
fsck.ext4: e2fsck_read_bitmaps: illegal bitmap block(s) for /dev/mapper/xubuntu--vg-root

/dev/mapper/xubuntu--vg-root: ***** FILESYSTEM WAS MODIFIED *****

/dev/mapper/xubuntu--vg-root: ********** WARNING: Filesystem still has errors **********


Answers 1


You can use the "noload" mount option to mount ext3/4 filesystems that are flagged 'dirty' but it will be in read-only mode.

mount -t ext4 -o noload,ro /dev/mapper/xubuntu--vg-root /mnt/

Should let you at least mount the drive.

Miuku
Miuku
June 22, 2018 11:10 AM

Related Questions


Partition mounted and unmounted simultaneously

Updated April 16, 2018 19:00 PM

Could reserved block count of zero hinder `fsck`?

Updated March 28, 2017 08:00 AM