So it all started when I woke up my PC (with Fedora 40, the KDE Plasma spin) from sleep, and it was frozen on the login screen. It does that often, or sometimes the screen would be black after waking it up. Either way, I force-rebooted the PC as always do in this case… and then I found myself in emergency mode. It took me a while to figure it out, but… it seems like the /home directory has been wiped. It’s empty. How the hell could that happen? And is there a way to restore the user, or did I just lose everything?
Emergency mode told me to do journalctl -xb, so the results of that can be found here. Thanks for any help you can give me.
The /home directory (in the default disk setup — let us know if you did anything differently!) is a separate btrfs subvolume. Or, in older setups, it might be a separate ext4 partition.
Either way, from your logs, that volume is corrupt in some way and the system is declining to mount it for safety.
I’m looking at:
ul 19 00:34:00 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1 contains a file system with errors, check forced.
Jul 19 00:34:00 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 19056415 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:00 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 19138157 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:03 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 24414951 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:03 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 24532755 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:03 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 24676348 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:03 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 24676349 extent tree (at level 2) could be narrower. IGNORED.
Jul 19 00:34:03 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Inode 24931582 extent tree (at level 1) could be narrower. IGNORED.
Jul 19 00:34:07 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Directory inode 20987772, block #194, offset 0: directory has no checksum.
Jul 19 00:34:07 fedora systemd-fsck[864]: FIXED.
Jul 19 00:34:07 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: Directory inode 20987772, block #194, offset 4084: directory corrupted
Jul 19 00:34:07 fedora systemd-fsck[864]: /dev/mapper/luks-bc0bd211-8abc-4976-8a00-b9b8ae1d2ca1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
Jul 19 00:34:07 fedora systemd-fsck[864]: (i.e., without -a or -p options)
Jul 19 00:34:07 fedora systemd-fsck[861]: fsck failed with exit status 4.
Jul 19 00:34:07 fedora systemd[1]: systemd-fsck@dev-disk-by\x2duuid-75ef6eed\x2d5fc6\x2d4307\x2db765\x2d5f43aa508691.service: Main process exited, code=exited, status=1/FAILURE
Can you do cat /etc/fstab and paste that here, just to check some things…?
Well, originally I used the default setup, but one day I woke up and the /home directory turned read-only by itself! After much struggle, I reinstalled the whole OS, but changed the partitions to ext4.
Here’s fstab:
#
# /etc/fstab
# Created by anaconda on Wed Dec 20 21:02:04 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=66178548-51cf-451c-915c-12b112193eb4 / ext4 defaults 1 1
UUID=162f9bbe-7b83-49f7-b225-35d3f5c0830e /boot ext4 defaults 1 2
UUID=03F5-876B /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=75ef6eed-5fc6-4307-b765-5f43aa508691 /home ext4 defaults,x-systemd.device-timeout=0 1 2
/swapfile_extend_32GB none swap sw 0 0
Btrfs was catching an error on your file system or hardware. Ext4 cannot do that.
When BTRFS mounts your /home read only, that means it has found an error on the subvolume it is attempting to mount. This read only state is intended to allow you to recover your data prior to doing diagnostics and repairs to the filesystem.
I would run some of the SMART tests on the disk to verify it is good. Plus I would go back to the defaults. BTRFS is much superior to EXT4.
It appears that you had at least one error for the device. Is the /home partition EXT4? If you didn’t change your fstab to reflect the filesystem change from BTRFS to EXT4 your /home likely wouldn’t mount correctly since it would look for a btrfs subvolume not an ext4 partition.
I haven’t used this command in a while, so there’s a good chance I did it wrong:
$ sudo mount /dev/sdd6
mount: /dev/sdd6: can't find in /etc/fstab.
I should probably note that my /home partition is encrypted. I remember the passphrase well though, so there’s no issue with that.
Edit: I can’t mount it through the command line, but I can mount it through Dolphin or KDE Partition Manager. I can browser the whole partition fine, except /home is empty, as said earlier.
But it still doesn’t mean that the issue is solved. I need to find a way to make it mount the partition in /home automatically on boot (after I decrypt it ofc), as it did before.