You are not logged in.

#1 2010-07-17 11:06:35

arch_archer
Member
Registered: 2010-05-19
Posts: 19

[SOLVED] dm-crypt XFS root partition, unable to boot

[Please move to the Installation section]

Hello friends,

here is what looks like the disk partitions prepared by me for installing Arch Linux:

/dev/sdb1 for /boot without encryption (XFS)
/dev/sdb2 for / with encryption (XFS)
/dev/sdb3 for /home with encryption (XFS)
/dev/sdb5 for /usr with encryption (XFS)
/dev/sdb6 for swap (will turn on encryption later)


During installation I have chosen manual setup of mount points, created the /dev/sdb1 as XFS for /boot, the others as dm_crypt, then created the corresponding dm_crypt mappings as XFS:

/dev/mapper/dm_root  (XFS)
/dev/mapper/dm_home  (XFS)
/dev/mapper/dm_usr  (XFS)


Then I installed the system and created key file for the encrypted partitions other than "/":

#dd if=/dev/urandom of=/mnt/root/cryptfs.key bs=256 count=16
#cryptsetup luksAddKey /dev/sdb3 /mnt/root/cryptfs.key
#cryptsetup luksAddKey /dev/sdb5 /mnt/root/cryptfs.key

Then came the configuration part, I added the encrypted /home and /usr partitions to crypttab:

dm_home    /dev/sdb3    /root/cryptfs.key
dm_usr    /dev/sdb5    /root/cryptfs.key

Then I checked the /etc/mkinitcpio.conf for "encrypt" in the HOOKS variable, it was there.

The fstab was OK.

Then I configured the other parts of the system (network, etc..), installed GRUB, the kernel part of menu.lst was looking smth. like this:

# (0) Arch Linux
title Arch Linux
root (hd1,0)
kernel /vmlinuz26 root=/dev/mapper/dm_root cryptdevice=/dev/sdb2:dm_root ro
initrd /kernel26.img

Then the installer suggested to reboot the system. I did it. And now I can not boot, GRUB is complaining:

root      (hd1,0)
Filesystem type unknown, partition type 0x7
kernel /vmlinuz26 root=/dev/mapper/dm_root cryptdevice=/dev/sdb2:dm_root ro

Error 17: Cannot mount selected partition


Can somebody help me with this? Thank you.

Last edited by arch_archer (2010-07-20 22:49:39)

Offline

#2 2010-07-17 14:03:25

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: [SOLVED] dm-crypt XFS root partition, unable to boot

I never heard of using XFS for a boot partition.  Maybe not your problem, but try using ext2 instead.  I presume you've set up the initrd correctly (it took several tries for me, but I'm doing it a little different.)

Offline

#3 2010-07-17 20:48:59

arch_archer
Member
Registered: 2010-05-19
Posts: 19

Re: [SOLVED] dm-crypt XFS root partition, unable to boot

Trent wrote:

I never heard of using XFS for a boot partition.

The string "kernel /vmlinuz26 root=/dev/mapper/dm_root cryptdevice=/dev/sdb2:dm_root ro" from error message tells that GRUB could read the menu.lst file from the /boot partition, isn't it?

The XFS FAQ (http://xfs.org/index.php/XFS_FAQ) says:
"There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable."

I can not check with ext2 now, the next try of installing is at Monday night. Any other suggestions?

Offline

#4 2010-07-19 22:15:59

arch_archer
Member
Registered: 2010-05-19
Posts: 19

Re: [SOLVED] dm-crypt XFS root partition, unable to boot

I've tried absolutely the same setup (all filesystms are XFS, all encrypted except /boot) with VirtualBox and it worked. Hmm.. I think that means that the problem is in Grub, it somehow can't understand something in my partition table. I think so, because at first try of installing Arch the cfdisk utility couldn't recognize the partition table, and I had to re-index (?) the partition table with fdisk. I mean:

# fdisk /dev/sdb
> u
> c
> x
> f
> w
> quit

After that, when the order of partitions became normal (i.e. sdb1,sdb2,sd3,sdb4,sdb5,sdb6,sdb7... insetead of sdb1,sdb2,sdb3,sdb4,sdb7,sdb5,sdb6...), cfdisk stopped exiting with error. Maybe it is still messed up and GRUB can't understand something? It will be hard for me to totally repartition the hard disk, because there is a big (300 GB) partition at the end of the disk (sdb11) with important data). Well hell, bad luck..

BTW, while testing with VirtualBox, another bug came out:

thumb-C7C0_4C44C47C.jpg

P.S.
I finally wiped out my old Ubuntu 8.04 for having fun with Arch, but now am forced to work from live-cd, he-he..

Offline

#5 2010-07-19 22:40:01

arch_archer
Member
Registered: 2010-05-19
Posts: 19

Re: [SOLVED] dm-crypt XFS root partition, unable to boot

I booted it..

Very strange thing.
As I said, the error was "Filesystem type unknown, partition type 0x7".
That was the key! Partition type 0x7 is the NTFS.
I have 2 hard disks, /dev/sda with one big NTFS (from old days) /dev/sda1 where I keep my media (music, etc.) and /dev/sdb with Linux partitions.

So, /dev/sdb1 was my /boot
Converted to GRUB format that would be (hd1,0), isn't it? Then why when I changed

# (0) Arch Linux
title  Arch Linux
root   (hd1,0)
kernel /vmlinuz26 root=/dev/disk/by-label/root ro
initrd /kernel26.img

to

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-label/root ro
initrd /kernel26.img

then it started to work??

Why /dev/sdb1 _is_actually_ (hd0,0) in my case ???

Rebooting to find out whether VirtualBox issue (in the screenshot above) is still in charge with real hardware...

Last edited by arch_archer (2010-07-19 22:50:17)

Offline

Board footer

Powered by FluxBB