You are not logged in.

#1 2023-10-24 09:29:57

qherring
Member
Registered: 2023-05-05
Posts: 87

Suggestions to recover an encrypted btrfs drive? [SOLVED]

My arch install was on a fully encrypted btrfs drive.  I just ran into an issue where processes were hanging when trying to suspend or reboot and had to do a hard reset with the power button on the PC.

Now when booting up the drive it says the device cannot be found nor mounted, skipping fsck... dropping into an emergency shell...

I have snapper set up for reverting back to older system states from the grub menu, however my snapshots give me the same issue as above when trying to boot them.

I really am not sure what happened.  This was a brand new nvme ssd.  Could the drive have failed?

Any suggestions for trying to recover this system are greatly appreciated.

Last edited by qherring (2023-10-24 18:42:01)

Offline

#2 2023-10-24 10:15:26

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

Here is the exact text I get when trying to boot arch from the grub menu:


ERROR : device ' UUID = df9abdc3-3c8a - 4908 - b91d - 250cdddd73fe ' not found . Skipping fsck.
mount : /new_root : can't find UUID - df9abdc3-3c8a - 4908 - b91d - 250cdddd73fe .
ERROR : Failed to mount ' df9abdc3-3c8a - 4908 - b91d - 250cdddd73fe ' on real root
You are now being dropped into an emergency shell .
sh : can't access tty : job control turned off
[ rootfs ~ ] #

Offline

#3 2023-10-24 10:17:57

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

It doesnt appear that the drive has failed because I am able to manually mount it from a terminal using:

cryptsetup luksOpen /dev/nvme1n1p2 cryptlvm

mount /dev/mapper/cryptlvm -o subvolid=5 /mnt

mount /dev/nvme1n1p1 /mnt/@/boot


All my files are available to read and write after doing so.


I just dont understand why the disk cannot be found when I try to boot but it can be found and mounted manually on another system.

Any suggestions on how I can fix this?

Last edited by qherring (2023-10-24 10:48:04)

Offline

#4 2023-10-24 11:08:29

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 1,386

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

post your /etc/fstab and /etc/crypttab or whatever you use for automounting.
Try to set a higher loglevel and check if there's some module not found error.
and check the UUIDs.

Last edited by jl2 (2023-10-24 11:15:39)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Upload longer text output like this

Offline

#5 2023-10-24 13:30:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,074

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

You want to check whether the actual UUID matches and in doubt re-install the kernel/regenerate the initramfs (don't forget to mount the boot partition) in case the problem is that the device can't be decrypted (are you being asked for your password?)

Offline

#6 2023-10-24 17:12:58

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

jl2 wrote:

post your /etc/fstab and /etc/crypttab or whatever you use for automounting.

/etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe	/         	btrfs     	rw,noatime,compress=zstd,subvol=/@	0 0

# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe	/.snapshots	btrfs     	rw,noatime,compress=zstd,subvol=/@snapshots	0 0

# /dev/nvme1n1p1
UUID=8F49-4391      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe	/home     	btrfs     	rw,noatime,compress=zstd,subvol=/@home	0 0

# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe	/var/log  	btrfs     	rw,noatime,compress=zstd,subvol=/@var_log	0 0

/etc/crypttab:

# Configuration for encrypted block devices.
# See crypttab(5) for details.

# NOTE: Do not list your root (/) partition here, it must be set up
#       beforehand by the initramfs (/etc/mkinitcpio.conf).

# <name>       <device>                                     <password>              <options>
# home         UUID=b8ad5c18-f445-495d-9095-c9ec4f9d2f37    /etc/mypassword1
# data1        /dev/sda3                                    /etc/mypassword2
# data2        /dev/sda5                                    /etc/cryptfs.key
# swap         /dev/sdx4                                    /dev/urandom            swap,cipher=aes-cbc-essiv:sha256,size=256
# vol          /dev/sdb7       

Offline

#7 2023-10-24 17:31:12

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

according to my snapshots neither /etc/fstab or /etc/crypttab have changed since the disk became unbootable

Last edited by qherring (2023-10-24 17:34:29)

Offline

#8 2023-10-24 17:32:48

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

seth wrote:

You want to check whether the actual UUID matches and in doubt re-install the kernel/regenerate the initramfs (don't forget to mount the boot partition) in case the problem is that the device can't be decrypted (are you being asked for your password?)


I am not asked for the password.  It send me to a black screen with the text posted above

Last edited by qherring (2023-10-24 17:33:12)

Offline

#9 2023-10-24 18:41:38

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Suggestions to recover an encrypted btrfs drive? [SOLVED]

seth wrote:

re-install the kernel/regenerate the initramfs

I was just able to boot into the linux fallback image, so definitely not a hardware issue.  I ran pacman -S linux and now all boots fine.

The kernel must have gotten corrupted when I did the update yesterday.  This seems to be related to the original issue I had with suspend and reboot failures in the initial thread.  I am going to mark this as solved and resume here https://bbs.archlinux.org/viewtopic.php … 1#p2125081

Last edited by qherring (2023-10-24 18:43:00)

Offline

Board footer

Powered by FluxBB