You are not logged in.

#1 2010-07-16 15:33:36

Sagittar
Member
Registered: 2010-07-16
Posts: 3

[solved] Encrypted root partition decrypts, not recognised on boot

Hello everyone

As per the wiki entry on system encryption with LUKS, I have an unencrypted boot partition (sda1) and a second encrypted partition (sda2) containing everything else, including root. This is on an eeepc 901 (I'm posting here, though, as I understand this as a mounting issue rather than laptop/netbook specific).

I have just done a full system upgrade, including moving to kernel 2.6.34-ARCH. Now, although I am prompted for the passphrase, which is accepted. I subsequently see the following:

::Checking Filesystems       [BUSY] fsck.ext2: No such file or directory while trying to open /dev/mapper/root
/dev/mapper/root:
The superblock could not be read or does not describe a correct ext2 filesystem. 
If the device is valid and it really does contain an ext2 filesystem (and not swap or 
ufs or something else), then the superblock is corrupt, and you might try running 
e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Runnig ecfsck -b 8193 /dev/mapper/root simply results in that error message being repeated. Googling and searching the forum only really found this thread to be anything similar. As per the suggestions there, the encrypted partition is last in /etc/fstab and the <options> value is populated:

/dev/sda1 /boot ext2 defaults 0 1
/dev/sdb1 /mnt/sdb1 vfat rw #This is an sdhc card permanently inserted
/dev/mapper/root / ext2 defaults 0 1

/etc/crypttab is entirely commented out, as it advises the root partition needs to be defined in the initramfs.

I can decrypt and open the partition using systemrescuecd, and fsck confirms the partition is clean. Equally, I can access the decrypted partition from the maintenance shell I get dumped into.

I'd be very grateful for any suggestions.

Last edited by Sagittar (2010-07-17 03:40:49)

Offline

#2 2010-07-16 17:46:07

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: [solved] Encrypted root partition decrypts, not recognised on boot

Are you sure, that your root partition really ext2?

Alternatively, you can try to boot from sysrescd with

rescuecd root=/dev/sda2

option.

Last edited by siriusb (2010-07-16 17:50:34)

Offline

#3 2010-07-16 18:46:28

Sagittar
Member
Registered: 2010-07-16
Posts: 3

Re: [solved] Encrypted root partition decrypts, not recognised on boot

Thanks for responding. I can confirm /dev/sda2 is ext2: after mounting both partitions with the -r flag, df -T reports ext2 file systems. (The theory is that ext2 helps prolong the life of the SSD in the eee pc. Not that that's entirely relevant here.)

I can't see a way of booting off sysresccd with root=/dev/sda2 without decrypting /dev/sda2 first. I am able to do that from Grub. Is there something I'm missing?

However, when I pay more attention to what happens on sysresccd when I decrypt the partition, I get the following:

% cryptsetup luksOpen /dev/sda2 root
Enter passphrase for /dev/sda2:
device-mapper: remove ioctl failed: Device or resource busy
Key slot 0 unlocked.

So, although I can then mount /dev/sda2 (or, to be precise, /dev/mapper/root) as normal, my guess is that the third line is a big clue as to why my normal boot process fails. I am pursuing that now.

Offline

#4 2010-07-17 03:51:54

Sagittar
Member
Registered: 2010-07-16
Posts: 3

Re: [solved] Encrypted root partition decrypts, not recognised on boot

Ok, I don't know if the ioctl message was a red herring, using the Arch live disc didn't give the same message on decrypting.

A forced re-install of the kernel has resolved this issue. I'm afraid I have lost track of the thread that pointed me at this solution. I booted using the Arch install media, then decrypted and mounted /dev/sda2 on /mnt/sda2. The boot partition /dev/sda1 I mounted on, well, /mnt/sda1. I checked /mnt/sda2/etc/mkinitcpio.conf to ensure that the encrypt hook was present. Next, cd to /mnt/sda2 and

chroot . pacman -Sf kernel26

I got error messages telling me that /boot partition was not mounted. In the end, my solution was just to copy the contents of /mnt/sda2/boot to /mnt/sda1.

I can now boot my system with no problems. Thank you for looking, and to siriusb for responding.

Offline

Board footer

Powered by FluxBB