problem converting 2.6.18 IDE to 2.6.23 PATA (mkinitramfs can't handle encrypted devices?)



I just installed a new Debian machine. It has encrypted root on an IDE disk.

For default 2.6.18 kernel the disk is seen as /dev/hda and encrypted root is /dev/mapper/hda2_crypt.

For the 2.6.23.x kernel with PATA, the disk is seen as /dev/sda, but the encrypted device doesn't change its name, and is still /dev/mapper/hda2_crypt.


To start from a crypted partition, one needs to create a initramfs. This works fine with the default 2.6.18 kernel, but doesn't work at all with a kernel using PATA.


A command like below:

mkinitramfs -o /boot/initrd.img-2.6.23.12-pata 2.6.23.12-pata

will create a initrd image which tells the kernel to start the system from a wrong device - conf/conf.d/hooks/cryptroot in the initrd file will contain:

target=hda2_crypt,source=/dev/hda2,key=none


Obviously, this will fail on a PATA kernel, which should rather look for a source on /dev/sda2.

Using LABELs doesn't help as well - then, mkinitramfs doesn't create a conf/conf.d/cryptroot file at all, and booting fails.

There are several problems with /usr/share/initramfs-tools/hooks/cryptroot and the way it fetches information from /etc/fstab:

1. When a LABEL is used for /, it creates an initrd which won't boot from an encrypted device.

2. When a device is used (like /dev/mapper/hda2_crypt) it mistakenly assumes it will always be on /dev/hda2. For PATA kernels it's simply not true.


So far, the only way to overcome this for me is to uncompress an initrd file, edit conf/conf.d/hooks/cryptroot to contain /dev/hda instead of /dev/sda (or, editing /etc/fstab before running mkinitramfs, and changing it back).


Are there any more maintainable ways to make a IDE -> PATA conversion, where root is on an encrypted partition?


--
Tomasz Chmielewski
http://wpkg.org


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Software RAID-5 attempt to access beyond end of device...
    ... The reiserfs is on top of an lvm2 on top of a raid5 ... >information that has previously been stored on disk. ... Sep 7 20:32:04 cu kernel: Buffer I/O error on device dm-0, ... PCI: PCI BIOS revision 2.10 entry at 0xf1150, ...
    (Linux-Kernel)
  • Re: Spontaneous reboots
    ... yet I keep experiencing spontaneous reboots and crashes. ... > I have postfix handling mail and use cyrus-imap with virtual ... Page fault while in kernel mode ... > Disk errors: ...
    (freebsd-questions)
  • Re: 3B1 parts needed
    ... O.K. But you need the initial install disk to partition the ... But really -- you need the install floppy to partition the disk ... add in oxidation of connector plating - the warm connector ... A compressed version of the 3.51m kernel. ...
    (comp.sys.3b1)
  • athlon-xp + fakeraid regression
    ... The build completes fine, the kernel boots fine, the machine will seem to be fine as long as it remains quiescent. ... At the beginning, just after hitting enter on the make command, one of the ad4 disk light goes on solid for several seconds. ... There is a well known thing where these cheap pata fakeraid cards will try to do ata133 if the drive says it can, when really, even if he drives are new ata133 drives and the cables are new and short and shielded, you still shouldn't try to do ata133 since the spec is too tight and you'll just get bit errors or other failures. ... The fix is use ata100 somehow, either by disabling dma entirely in loader.conf (since you have no more selective option there, and the raid card bios never has an option for controlling pio/dma mode like motherboard bios's have) and then use atacontrol in rc.early to set udma5, or by using disks that can only do ata100 and only advertise ata100 to the controller. ...
    (freebsd-current)
  • Re: F8 k3b problem or just random glitch?
    ... I must have been thinking of the last dvd I burnt. ... led went out the last time and a what do we do with this new disk requester had ... but to me a file manager is a 2 pane operation ala mc. ... All this BTW with kernel 2.6.26-rc6 doing the chores. ...
    (Fedora)