You are not logged in.

#1 2009-02-25 16:27:22

saf
Member
Registered: 2009-02-01
Posts: 39

[SOLVED] Booting Encrypted USB Harddisk Problem

Hello

I'm using an external hdd.
I made it 3 Partitions:
/dev/sdb1 /boot
/dev/sdb2 swap
/dev/sdb3 /

I installed archlinux on /dev/sdb3 over the live cd, after using cryptsetup formatting it in ext3 and mounting it to /dev/mapper/root

i added usb and encrypt hooks to the mkinitcpio and loaded the modules dm-crypt and aes-i586 and set up the menu.lst
in the menu.lst i tried several things like /dev/sdb3 and the UUID and so on.

but when i try to boot there is no password question, but kernel panik "init not found"

What did i make wrong? Is the /etc/fstab inplemented in the mkinitcpio image?SO

Last edited by saf (2009-02-27 08:18:34)

Offline

#2 2009-02-25 16:38:58

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

show menu.lst


Zygfryd Homonto

Offline

#3 2009-02-25 16:46:16

saf
Member
Registered: 2009-02-01
Posts: 39

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=UUID=219bea53-6e83-4a7b-86d6-90c2d36913ef rootdelay=10 ro
initrd /kernel26.img

or

kernel /vmlinuz26 root=/dev/sdb3 rootdelay=10 ro

when
i choose root=/dev/sda3 and hd,0,0 it boots arch from my pc-hdd

i dont know what is right to set for root(hd) but when i try s.th. like root (hd1,2) it dont work

is it normal that blkid tells me that the crypted partition is "ext4" ?

is it right to choose (hd0,0) because everything i tried else didnt work

# blkid /dev/sdb3
/dev/sdb3: UUID="219bea53-6e83-4a7b-86d6-90c2d36913ef" TYPE="ext4"

Last edited by saf (2009-02-25 16:53:25)

Offline

#4 2009-02-25 16:54:10

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

1-root (hd...) should show the disk and partition where /boot is, so it is looking for grub in your /dev/sda1
is it your case ?

2-kernel ... root is where / should be so it shows /dev/sdb3
is it your case ?

3-then /etc/fstab  should mount your / which is again /dev/sdb3


Zygfryd Homonto

Offline

#5 2009-02-25 17:02:22

saf
Member
Registered: 2009-02-01
Posts: 39

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

hi,
first one is not right

/dev/sda is not the usb but the internal hdd and /dev/sda1 is an ntfs M$ partition

my grub partition is /dev/sdb1

but i tried hd(1,0) but didnt work

Last edited by saf (2009-02-25 17:05:02)

Offline

#6 2009-02-25 18:22:43

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

mkinit.conf must also have usb there and encrypt - show your hooks and modules from /etc/mkinitcpio.conf


Zygfryd Homonto

Offline

#7 2009-02-26 12:31:52

saf
Member
Registered: 2009-02-01
Posts: 39

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

hello,
first, thanks for helping me for solving this problem.
now i tried this: i installed whole arch new on the external hdd, from live cd, first without crypt. again same partitions.
Everything runs perfectly with this settings in menu.lst

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/dba77321-7cb4-4500-8ef1-f8ec0e940d60 ro
initrd /kernel26.img

Then, I converted the /dev/sdb3 device to crypted with luks and then ext3 and copied all files on it.
thats what looks the mkinitcpio.conf http://rafb.net/p/DpEE6529.html

The UUID didnt change by converting, but still the same Kernel Panic now.

I didnt find any mkinit.conf file in the system.

Its really difficult to get set up.

HERE ACTUAL ERROR:
http://www.bilder-upload.eu/show.php?fi … Lwm4aY.jpg

http://wiki.archlinux.org/index.php/Con … ypted_root
"Then specify your root device on the kernel command line, just as if it was unencrypted. "
what they mean with kernel command line? do i have to rekompile kernel?

Last edited by saf (2009-02-26 12:50:48)

Offline

#8 2009-02-26 15:15:17

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

let me show you my configuration:
/boot - /dev/sda5 - ext4
/  -  /dev/sda2  - ext4 on luk spartition

MODULES="pata_acpi ata_generic scsi_mod ata_piix"
BINARIES=""
HOOKS="base udev autodetect pata scsi sata usb usbinput keymap encrypt filesystems"

then grub installed in MBR, and its config:

title  Arch Linux on sda2
root   (hd0,4)
kernel /vmlinuz26 root=/dev/sda2 ro quiet  vga=773 
initrd /kernel26.img

as you see here: root points to /dev/sda5
and root in "kernel" line points to / means /dev/sda2

then /etc/fstab:

/dev/sda5 /boot ext4 noatime,defaults 0 1
/dev/mapper/root / ext4 noatime,defaults 0 1

that is all I suppose for you to get it working
frankly: forget first about uuids - it just makes it more difficult

Last edited by zyghom (2009-02-26 15:17:14)


Zygfryd Homonto

Offline

#9 2009-02-26 22:46:22

saf
Member
Registered: 2009-02-01
Posts: 39

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

Hello,
now I am very close to the real problem.

First I tried this. I created a crypted luks partition on internal hdd (not external), format it in ext3 and copied all the files from external rootfs there.
When started with grub. everything worked perfect. it asks me for the luks password and mount everythink.

Second, on the external hdd, mounting the rootsystem works fine when its not crypted.

Third: when I choose to boot from internal hdd, in grub hd(0,0) is the first partition on internal hdd.
         when I choose to boot from external hdd, in grub hd(0,0) is the first partition on external hdd.

for kernel /dev/sda <- is always internal /dev/sdb <- is always external in grub

So, the right partition of the crypted rootfs system on external hdd is /dev/sdb3

This makes an error.

The Problem: Mounting the crypted Rootfilesystem on USB!

Because mounting not crypted rootfilesystem from usb works, and mounting crypted rootfilesystem from internal hdd works too.
Maybe i need more modules or hooks in the mkinitcpio, now i use the same modules and hooks like zyghom, thanks to u for helping me.

Last edited by saf (2009-02-26 22:52:47)

Offline

#10 2009-02-27 08:21:18

saf
Member
Registered: 2009-02-01
Posts: 39

Re: [SOLVED] Booting Encrypted USB Harddisk Problem

Solution was really f***** easy:
add one line to the /lib/initcpio/hooks/encrypt
like here
http://bugs.archlinux.org/task/11571

Offline

Board footer

Powered by FluxBB