Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4439

How to Recover Bad Super Block? Write Lock Corrupted Nvme

$
0
0

This morning I had problems booting on my laptop. I force power cycled it and the disk was no longer detected. I booted to a live ubuntu drive to try and repair the disk.

This disk is a Samsung 1TB Nvme card. It has 3 partitions

/dev/nvme0n1p1       2048    1050623    1048576  512M EFI System/dev/nvme0n1p2    1050624 1945135103 1944084480  927G Linux filesystem/dev/nvme0n1p3 1945135104 1953523711    8388608    4G Linux swap

I first tried to repair the boot partition nvme0n1p1 using fsck -p /dev/nvme0n1p1 - walked through the prompts restoring the backup block and removing the dirty flag. After doing this I was able to mount the boot partition (although still not recognized by system)

I've now been exhaustively trying to recover the main partition /dev/nvme0n1p2 receiving various errors:

errors from gparted

Error fsyncing/closing /dev/nvme0n1p2: No data available

fsck

ubuntu@ubuntu:~$ sudo fsck /dev/nvme0n1p2 fsck from util-linux 2.37.2e2fsck 1.46.5 (30-Dec-2021)Ubuntu: recovering journalSuperblock needs_recovery flag is clear, but journal has data.Run journal anyway<y>? yesfsck.ext4: Input/output error while recovering journal of Ubuntufsck.ext4: unable to set superblock flags on UbuntuUbuntu: ********** WARNING: Filesystem still has errors **********

Trying to restore from superblock backup. Tried every single one

ubuntu@ubuntu:~$ sudo dumpe2fs /dev/nvme0n1p2 | grep -i superblockdumpe2fs 1.46.5 (30-Dec-2021)  Primary superblock at 0, Group descriptors at 1-116  Backup superblock at 32768, Group descriptors at 32769-32884  Backup superblock at 98304, Group descriptors at 98305-98420  Backup superblock at 163840, Group descriptors at 163841-163956  ...  ...dumpe2fs: Block bitmap checksum does not match bitmap while trying to read '/dev/nvme0n1p2' bitmapsubuntu@ubuntu:~$ sudo e2fsck -f -b 32768 /dev/nvme0n1p2e2fsck 1.46.5 (30-Dec-2021)Superblock needs_recovery flag is clear, but journal has data.Recovery flag not set in backup superblock, so running journal anyway.Ubuntu: recovering journalSuperblock needs_recovery flag is clear, but journal has data.Recovery flag not set in backup superblock, so running journal anyway.e2fsck: Input/output error while recovering journal of UbuntuSuperblock needs_recovery flag is clear, but journal has data.Recovery flag not set in backup superblock, so running journal anyway.e2fsck: unable to set superblock flags on UbuntuUbuntu: ***** FILE SYSTEM WAS MODIFIED *****Ubuntu: ********** WARNING: Filesystem still has errors **********

Running badblocks gives me 1500+ bad blocks. I stopped it short. But maybe I should try repairing these blocks?

ubuntu@ubuntu:~$ sudo badblocks -c 4096 /dev/nvme0n1p2 > /home/$USER/badblocks.txtubuntu@ubuntu:~$ wc -l /home/$USER/badblocks.txt1325 /home/ubuntu/badblocks.txt

Tried to mount a superblock directly

ubuntu@ubuntu:~$ sudo mount -o sb=32768 /dev/nvme0n1p2 /mnt/backupSuperblockmount: /mnt/backupSuperblock: wrong fs type, bad option, bad superblock on /dev/nvme0n1p2, missing codepage or helper program, or other error.

Trying to check sector alignment with gparted. Shows it's fine but I'm not confident since it's having IO issues.

root@ubuntu:~# parted /dev/nvme0n1p2Warning: Error fsyncing/closing /dev/nvme0n1p2: Input/output errorRetry/Ignore? Ignore                                                      GNU Parted 3.4Using /dev/nvme0n1p2Welcome to GNU Parted! Type 'help' to view a list of commands.(parted) align-check opt 11 aligned

There is no physical write write lock switch on the card I checked. I also tried a different nvme storage card in the same interface and it works fine.

I've exhausted everything I can think of trying to find clues. I was able to recover the other 2 partitions which makes me feel like the card is not damaged physically beyond repair and is capable of io. I'm really hoping I can recover this one at least to the extent that I'm able to mount it and recover some work.

Does anyone have any ideas on how to repair this corrupted partition?


Viewing all articles
Browse latest Browse all 4439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>