[SOLVED] Emergency mode, failed mount /home I can not recover my data

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
klas88
Level 2
Level 2
Posts: 63
Joined: Wed Jan 24, 2018 5:51 pm

[SOLVED] Emergency mode, failed mount /home I can not recover my data

Post by klas88 »

My solution in my last reply!!!

Ihave a big problem. (Sorry for my level of English)

Linux Mint Sylvia 18.3 worked correctly, but it crashed and I turned it off directly. When I rebooted, the following error came out "Emergency mode". The problem is the /home partition how you can check, so if I do not solve this I will lose all my data.

Image

My last option has been to start from linux pendrive live and I can open the partition (/) but it does not let me open the partition where it is / home

1) partition 2 does not start on physical sector boundary

Image

2) home.mount failed

Image

3) The last line says: mount "/dev/sda6: can't read superblock"

Image

The next imae is when I tried with live usb

Image

I tried checking with fsck and gparted and have the same error> i need a newer version of e2fsck. For that will try get it but this is not possible. I followed the next steps of this web, https://askubuntu.com/questions/747656/ ... tu-14-04-4 I tried update libc6-dev but i cannot... maybe this could be a possibilty...

[GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2
Check and repair file system (ext4) on /dev/sda6 00:00:01 ( ERROR )

calibrate /dev/sda6 00:00:01 ( SUCCESS )

path: /dev/sda6 (partition)
start: 43954176
end: 1465147391
size: 1421193216 (677.68 GiB)
check file system on /dev/sda6 for errors and (if possible) fix them 00:00:00 ( ERROR )

e2fsck -f -y -v -C 0 /dev/sda6 00:00:00 ( ERROR )

e2fsck 1.42.13 (17-May-2015)
/dev/sda6 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!


Any solution? All my data is there !!!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 6 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: Emergency mode, failed mount /home I can not recover my data

Post by WharfRat »

Since the primary superblock is corrupted, the only thing to try is using an alternative superblock as explained in man e2fsck.

It also explains how to determine alternative superblocks using the mke2fs program.

Good luck :wink:
klas88
Level 2
Level 2
Posts: 63
Joined: Wed Jan 24, 2018 5:51 pm

Re: Emergency mode, failed mount /home I can not recover my data

Post by klas88 »

Edited my original post because I didnt explain well. Realy, I could not check partition with gparted or fsck because says I need a newer version of e2fsck *but i can not update it....
WharfRat

Re: Emergency mode, failed mount /home I can not recover my data

Post by WharfRat »

I'm running

Code: Select all

[bill@XPS] ~/Downloads $ inxi -S
System:    Host: XPS Kernel: 4.15.0-36-generic x86_64 (64 bit) Desktop: MATE 1.18.0
           Distro: Linux Mint 18.3 Sylvia
[bill@XPS] ~/Downloads $ 
and the version of e2fsck is

Code: Select all

[bill@XPS] ~/Downloads $ e2fsck -V
e2fsck 1.42.13 (17-May-2015)
	Using EXT2FS Library version 1.42.13, 17-May-2015
What do yours report :?:
Mute Ant

Re: Emergency mode, failed mount /home I can not recover my data

Post by Mute Ant »

The file-system ext4 is not totally stable. A recent change made the 'new' ext4 format slightly incompatible with the 'old' format and an old e2fsck can't check a new ext4. This does not happen with ext3.

If you boot a Live Session of TAILS or Mint or gPartedLive you will almost certainly get an e2fsck modern enough to mend /dev/sda6.

BUT FIRST

Get a 1TB removable drive and clone /dev/sda6 into it...

sudo cp /dev/sda6 /dev/sdX

...so that your data is duplicated and detached from the system before you attempt a repair on the original.
klas88
Level 2
Level 2
Posts: 63
Joined: Wed Jan 24, 2018 5:51 pm

Re: Emergency mode, failed mount /home I can not recover my data

Post by klas88 »

Code: Select all

mint@mint ~ $ inxi -S
System:    Host: mint Kernel: 4.10.0-38-generic x86_64 (64 bit)
           Desktop: Xfce 4.12.3 Distro: Linux Mint 18.3 Sylvia

Code: Select all

e2fsck -V
e2fsck 1.42.13 (17-May-2015)
	Using EXT2FS Library version 1.42.13, 17-May-2015
I cannot
gm10

Re: Emergency mode, failed mount /home I can not recover my data

Post by gm10 »

klas88 wrote: Thu Oct 18, 2018 9:57 am I cannot
;)

If possible, first pull a backup image of the partition as suggested by Mute Ant above.

Just follow those steps: https://linuxexpresso.wordpress.com/201 ... in-ubuntu/ (first google result but looks ok)

It's possible that this will fail depending on whether you've just got corrupted data or an actually damaged disk (bad sector). If it fails you'd have to try and pull data off the disk using something like testdisk.
klas88
Level 2
Level 2
Posts: 63
Joined: Wed Jan 24, 2018 5:51 pm

Re: Emergency mode, failed mount /home I can not recover my data

Post by klas88 »

I did a check of the disk and it seems that it is not physical broken.

I have followed the steps of the web and...

Code: Select all

~ $ sudo fsck.ext4 -v /dev/sda6
e2fsck 1.42.13 (17-May-2015)
/dev/sda6 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Emergency mode, failed mount /home I can not recover my data

Post by thx-1138 »

klas88 wrote: Thu Oct 11, 2018 9:11 pm
e2fsck 1.42.13 (17-May-2015)
/dev/sda6 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck![/i]

Any solution? All my data is there !!!
...i think what MuteAnt refers (more or less) is this: https://bugs.launchpad.net/ubuntu/+sour ... ug/1365874
ext4 receives new features every now & then, it's not totally 'stable'...

So download first a relatively new live distro (that has a newer version of e2fsprogs), burn it to a stick,
then run fsck from there (and if you stumble into badblocks, follow gm10's link)...

Needless to repeat myself that you should back up first just in case...
gm10

Re: Emergency mode, failed mount /home I can not recover my data

Post by gm10 »

klas88 wrote: Thu Oct 18, 2018 10:56 am I did a check of the disk and it seems that it is not physical broken.

I have followed the steps of the web and...

Code: Select all

~ $ sudo fsck.ext4 -v /dev/sda6
e2fsck 1.42.13 (17-May-2015)
/dev/sda6 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!
Good. Then it should be possible to repair.

To address the e2fsck issue, download and install this package: https://packages.ubuntu.com/cosmic/amd6 ... c/download

Then in the commands you run replace e2fsck with e2fsck.static.
klas88
Level 2
Level 2
Posts: 63
Joined: Wed Jan 24, 2018 5:51 pm

Re: Emergency mode, failed mount /home I can not recover my data

Post by klas88 »

SOLVED. Thanks.

Remember in my post, that i had problems with e2fsck to check:

Code: Select all

e2fsck 1.42.13 (17-May-2015)
/dev/sda6 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!
So, first i runned usb live mint and executed the next code in terminal to see my all partitions:

Code: Select all

sudo fdisk –l
Now I can see my partitions and the error in the /home partition: "can't read superblock" (see the next image and the previous messsages)


Image

The next step $ sudo fsck.ext4 -v /xxx/xxx

Code: Select all

~ $ sudo fsck.ext4 -v /dev/sda6
mint ~ # e2fsck.static
Usage: e2fsck.static [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
        [-l|-L bad_blocks_file] [-C fd] [-j external_journal]
        [-E extended-options] [-z undo_file] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list
 -z undo_file         Create an undo file
Then I executed # e2fsck.static -c /xxx/xxx to "Check for bad blocks and add them to the badblock list" and I let the check run. In the next step I pressed 'y' to repare. See the code:

Code: Select all

mint ~ # e2fsck.static -c /dev/sda6
e2fsck 1.44.4 (18-Aug-2018)
/dev/sda6: recovering journal
Image

Results working in terminal:

JBD2: Invalid checksum recovering block 61 in log
Journal checksum error found in /dev/sda6
Clearing orphaned inode 30682000 (uid=1000, gid=1000, mode=0100664, size=32768)
Clearing orphaned inode 30677721 (uid=1000, gid=1000, mode=0100600, size=236972)
Clearing orphaned inode 30676485 (uid=1000, gid=1000, mode=0100664, size=22307)


Clearing orphaned inode 30683488 (uid=1000, gid=1000, mode=0100664, size=22307)
Checking for bad blocks (read-only test): 0.00% done, 0:00 elapsed. (0/0/0 errdone
/dev/sda6: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Inode 30806900 extent tree (at level 2) could be narrower. Fix<y>?
(....)

PRESS 'y' SEVERAL TIMES and so appears the next message

(...)

Inode 30807066 extent tree (at level 1) could be narrower. Fix ('a' enables 'yes' to all) <y>? yes to all

PRESS 'a'

(....)

Results in terminal:

Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (15713559, counted=15710086).
Fix? yes

Free inodes count wrong (44304369, counted=44304426).
Fix? yes


/dev/sda6: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda6: 112598/44417024 files (3.9% non-contiguous), 161939066/177649152 blocks


My computer works perfectly. I can access the partition / home both from live usb and starting normal linux from hard drive
Locked

Return to “Hardware Support”