/home partition is not being recognised

Hi, I am a new Manjaro user, and in need of help. I re-installed Manjaro a couple of times with Calamares defaults, but that kept giving me freezes after the system went to sleep. I solved that, but in the process I did a manual partitioning of my primary NVMe drive.

For context, I have 3 Nvme drives of 4TB, 2TB and 1TB, and a 1TB HD. I installed Manjaro on the 1TB NVMe, with a partition, 128GB root, 64GB swap, and the rest as a home partition, using Ext4 for root and home. Manjaro was working very well for a few days, and I moved a bunch of my important files to my home partition assuming that everything was safe there as it was a separate partition.

Earlier today I got a notification about an update to Vivaldi browser. Manjaro crashed in the midst of the update and rebooted (the system did this by itself, I did not force a reboot)

Following that reboot, the system went straight into emergency mode. I ran journalctl -xb as per the instructions, and saw that here were a lot of ext-fs errors on nvme0n1p2 (my root partition) saying deleted inode referenced.

I used the live usb to manjaro-chroot and then ran fsck -fy on the root partition. This seems to have completed successfully.

However, upon reboot I still go into emergency mode, and now it seems that my home partition has been corrupted? When I check lsblk -af, this partition (nvme0n1p3) appears, but doesn’t show any fstype at all. Apologies, I can’t copy and paste from the terminal, as my desktop is in emergency mode and I am posting this from my phone, and the rules are clear about posting screenshots of text.

Journalctl -xb shows the following errors:

Ext4-fs (nvme0n1p3) : VFS : Can't find Ext4 filesystem
FAT-fs (nvme01n1p3) : bogus number of reserved sectors) 

I checked journalctl -xb -3 to reconfirm, and the home partition was fine at that point. The change seems to have happened immediately after running fsck on the root partition. I was under the impression that running this command on the root partition should not have affected any other partition, this was in fact my reasoning for putting /home on its own partition. So what could have happened? I confirmed that the root drive wasn’t mounted before running fsck. Nothing was mounted as it was a live USB.

Additionally, I tried to run fsck on the home partition but got an error about a bad magic number in super-block and to try with alternates. However I get the same error with all the alternates from mke2fs - n/dev/nvme0n1p3. There were 17 of them.

I (very foolishly) moved a bunch of old photos and other documents, including SSH certs onto the home partition thinking they were safe in this set up. No other backups.. That is no one’s fault but my own. My question is, is there any way to repair the partition and/or recover data from it?

Thanks in advance

1 Like

I cannot speculate on what lead to the incident but from the following description I am fairly certain you may have destroyed all possibilities of recovery.

Your best option is to look up your most recent backup.

3 Likes

You should not fsck on a mounted partition and chroot does that. It may even have worsen it. Start with checking the filesystem from live usb with out chrooting.
Than you can follow the procedure for interrupted update i guess (see the tutorials in the forum)

3 Likes

:sob::sob::sob:

I’m trying to see if testdisk can potentially fix this. I do have a timeshift backup from yesterday, but that’s not going to have anything from /home. And timeshift restore failed on me when I tried it half an hour ago

Hi nihalfm!

Do not use the disk in write-mode anymore.

You wrote:

I re-installed Manjaro a couple of times with Calamares defaults, but that kept giving me freezes after the system went to sleep.

Maybe, you did not solve anything, and it was just a coincidence.

  • repeated freezes after sleep
  • multiple reinstall attempts
  • then a crash during an update
  • then immediate filesystem corruption on reboot

…it strongly suggests the original issue was never fixed.
The “solution” may have just postponed the underlying problem.

Checked the health?

sudo smartctl -a /dev/nvme0n1

Good luck with data recovery tools.

:waving_hand:

It was unmounted, I ran umount /dev/nvme0n1p2 before I ran fsck, and confirmed this.

Do you have a boot/efi partition with a boot and esp flags as you did not mention this. It should be formatted as fat32 and appear as vfat?

Did you fix the interrupted upgrade? (The point of chroot’ing in.)

Do you have a boot/efi partition with a boot and esp flags as you did not mention this. It should be formatted as fat32 and appear as vfat?

Yes, nvme0n1p1 is the EFI and nvme0n1p2 is root - and both appear to be fine, after I ran fsck on the root partition

Did you fix the interrupted upgrade? (The point of chroot’ing in.)

I did not… panicked at the data loss. Is that somethingi I should do, in the context of attempting to recover my /home partition data?

Yes.
Just kidding - panic is never good.
But it should be your concern.

Since you apparently already ran e2fsck on that partition
with options set to force the check and never ask for confirmation
(not really sure about that from what you wrote)
you might indeed have destroyed your chance to recover anything.

A dd copy of the whole partition as it is now
and then the use of recovery tools on either (not both) the original or the copy
might get you something back.
I have never used testdisk - I read and hear that it is a tedious process.

But that’s the thing - I ran fsck on another partition, not my home partition. I ran it on the root partition which is a separate partition on the same nvme drive

I read and hear that it is a tedious process.

Currently trying to get testdisk to recover stuff from the previous external drive these pictures and documents were on before I moved them to the home partition. I can confirm the above

so:
there is still a chance - if you did not touch or otherwise altered the partition in question (/home)

make a backup of it, then you can worry about recovering anything from it.

The root partition is pretty much irrelevant - some custom configurations in /etc might be lost.
Nothing to worry about.

I don’t quite understand the situation: it there a partition now or does it show as unformatted space? Because that will mean you have to recover the partition table, not the partition.

2 Likes

I don’t quite understand the situation: it there a partition now or does it show as unformatted space? Because that will mean you have to recover the partition table, not the partition.

With my deepest apologies for posting a picture of text , I hope this screenshot helps clarify :

The partition, nvme0n1p3, does show up on lsblk -al, but thw filesystem is missing, as the above image shows. So… I don’t think it’s unformatted space?

Unfortunately this is exactly what it is (according to the system). There is just no partition there according to the partition table. But i have not restored a partition very long time and i have forgotten how it is done, so let’s wait the others. And i am entirely unsure how it works on ssds.

P.s.even if you restore it, check the drive. Partitions do not disappear just so. It might be indicator of a hardware problem. Disk, power supply, etc.

make a copy of it in any case
dd if=/dev/nvme0n1p3 of=image_of_that_partition

to a location where you have that much space as the partition occupied.

Then you have one bit wise copy and can work on either one to possibly restore the contents.

Having a backup … would be so much easier …

This chain of events does look like a hardware failure (to me).

always have a backup …

3 Likes

The reason for having separate partitions for root (the system) and home (your data) is not that this would make your home partition something like a safe haven - not at all. Rather, home is the partition that you need a backup for - while root isn’t so important because the backup to restore root from is already present via your distros repositories - all you might lose are custom configurations if there are any on the root partition.

So with separate partitions you can easily wipe or reformat the root partition and reinstall the system to this partition again without touching your home partition and so reusing the home partition with its data for the new installation. But this doesn’t mean your home partition could not break in some way or the data on it would be safe per se. (Another reason to have separate partitions for root and home is to avoid to end up with no space left for the system by accidentally filling up your home with say media and games etc.)

2 Likes

I’ll never understand why people correlate the /home folder or partition with personal data storage location. IMHO main purpose of /home is to carry the hidden folders for config information linked to the user. It is best used just for exact this purpose. If personal user data, such as documents, photos, whatsoever come into the game, it is much better and easier to have a separate partition for this single purpose and just to create a link to this partition in the /home folder. Then personal data backup means to backup just the data partition and any system backup (e.g. Timeshift snapshot) would cover the hidden files of /home usually in combination with relevant / folders (Timeshift can easily be set to do exact this).

5 Likes

Yeah. I totally did not grok this, and had to learn the hard way I guess. :confused:

On the flip side, I am learning a TON about disk recovery on Linux haha

1 Like