Skip to content

Random error while re(!)booting crypted root partition with attached external hdd

Hey guys,

this will sound very weird, but here is what I know:

I have an HDD attached via USB 3.0 to my Notebook. If I cold-boot he machine, everything works fine. (Get asked to decrypt the partition, everything is okay) But here it comes: If I reboot the machine, I get dropped to recovery shell while the system is executing the encrypt hook. But just if its connected via USB 3.0. If the HDD is connected to an USB 2.0 port, I can reboot and decrypt without problems.

In the recovery shell blkid shows, that the ssd which is usually sda1 (boot) and sda2 (root) now is sdb, while the external HDD (USB3.0) drive is sda1. Why is this so? Grub is even searching for sda2 and UUID of the LABEL=CRYPT device (32dde4d0-3162-4a07-beab-d63e0ba110fb) but cant find anything....

Here are my HOOKS:

HOOKS="base udev autodetect modconf block keymap netconf btrfs dropbear keyboard encryptssh filesystems"

Here the relevant part of my grub.cfg:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-32dde4d0-3162-4a07-beab-d63e0ba110fb' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos 
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  5f3450f3-2094-4a4e-ab99-792cd1eb3b36
	else
	  search --no-floppy --fs-uuid --set=root 5f3450f3-2094-4a4e-ab99-792cd1eb3b36
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=32dde4d0-3162-4a07-beab-d63e0ba110fb rw rootflags=subvol=__active  cryptdevice=/dev/sda2:crypt ip=:::::eth0:dhcp
	echo	'Loading initial ramdisk ...'
	initrd	 /initramfs-linux.img
}

And ofc blkid (when booted, as stated abouve in recovery shell, sda=sdb and sba=sda):

/dev/sdc1: LABEL="internal-hdd" UUID="8e97ecd0-aeb5-4b20-9331-e6eb2bb5e63f" TYPE="ext4" PARTUUID="2f268add-01"
/dev/sda1: LABEL="BOOT" UUID="5f3450f3-2094-4a4e-ab99-792cd1eb3b36" TYPE="ext2" PARTUUID="264e9a3d-01"
/dev/sda2: UUID="5cc9ce1e-6bbf-4ab4-8ded-1da4be96faa0" TYPE="crypto_LUKS" PARTUUID="264e9a3d-02"
/dev/sdb1: LABEL="4tb-oscar" UUID="3D72CDAF06315BF8" TYPE="ntfs" PARTLABEL="4tb-o" PARTUUID="947b5ac5-4615-48d9-80fb-110e852236f7"
/dev/mapper/crypt: LABEL="CRYPT" UUID="32dde4d0-3162-4a07-beab-d63e0ba110fb" UUID_SUB="037c4330-d127-4fe5-9c97-d6c6eaaf248e" TYPE="btrfs"

Can anybody tell me how to avoid this boot Problem? What am I missing?

Cheers!

Edited 17 Jul 2016. We only hold this version.

1 points4 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
1 · 100% up
Kind
Text
ID
4t4ecc

Author

5
posts
36
comments
0
media
View profile

5 comments

I had a similar problem with an ext HDD, I was assigning sda,sda,etc manually and the boot order would change, if the ext drive was plunged in.
I changed crypttab to use UUID instead.
Also check when running mkinitcpio that you have the drive plunged in so it pick up the right modules, I know USB3 should be builtin the kernel, worth a try.
Could you post your fstab and crypttab?

2 points

Hey,

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# /dev/mapper/crypt UUID=9446519c-1fe2-438a-b940-1d1d596bc00f
LABEL=CRYPT       	/         	btrfs     	rw,relatime,compress=lzo,ssd,space_cache,subvol=__active	0 0
#LABEL=CRYPT		/run/btrfs-root	btrfs		rw,relatime,compress=lzo,ssd,space_cache			0 0


UUID=5f3450f3-2094-4a4e-ab99-792cd1eb3b36          	/boot     	ext2      	rw,relatime	0	0	
#LABEL=BOOT          	/boot     	ext2      	rw,relatime	0	0	

# 4tb externe
UUID=3D72CDAF06315BF8	/home/m/media	ntfs	defaults	0	0

I dont use a crypttab since I just have sda2 (the btrfs) drive encrypted.

But I just created one and put this into it:

crypt		UUID=32dde4d0-3162-4a07-beab-d63e0ba110fb	none

still the same result.

This is what I get on boot:

Imgur

Its doing the right thing trying to find (/dev/mapper/crypt/=)UUID="32dde4d0-3162-4a07-beab-d63e0ba110fb", right?

Or should it look for (/dev/sda2=)UUID="5cc9ce1e-6bbf-4ab4-8ded-1da4be96faa0" which holds the encrypted partition?

1 points

I am have trouble working out how, you have set up this system, what style of encrypted HDD did you use.

For a start do not mount the ext drive in /home/m/media, that will cause trouble for now just put it in /mnt. or see here for fstab auto mounting external HDDs.
You was right you don't need a crypttab for just one drive.

Check you have set up persistent block naming right.

Add encrypt Hook like so.

HOOKS="base udev autodetect modconf block keymap netconf btrfs dropbear keyboard encryptssh encrypt filesystems"

See here

1 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.