running slackware 13.37 off usb with LUKS and lvm with grub
Hey guys. I'm trying to run slackware off a usb thumbdrive, using luks and lvm using information mostly from README_CRYPT.TXT, some blog
from SlackBlogs, as well as google (mostly gentoo forums) I need to use grub from slackware/testing (grub-0.97-i486-9) to boot (and a initrd), as lilo complains about usb not being harddisk0. I am using kernel 2.6.37.6-smp. This is the drive, seen by fdisk: Disk /dev/sdc: 8021 MB, 8021606400 bytes 16 heads, 48 sectors/track, 20400 cylinders, total 15667200 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000dfd14 Device Boot Start End Blocks Id System /dev/sdc1 * 62 199081 99510 83 Linux /dev/sdc2 199082 15667199 7734059 8e Linux LVM Part of my fstab look like this: /dev/rally2cryptvg/swap /swap swap defaults 0 0 /dev/rally2cryptvg/root / ext4 defaults 1 1 /dev/rally2cryptvg/home /home ext4 defaults 1 2 /dev/sdc1 /boot ext4 defaults 1 2 My grub menu.lst is: # GRUB configuration file '/boot/grub/menu.lst'. # generated by 'grubconfig'. Sat Nov 26 13:48:51 2011 # # The backup copy of the MBR for drive '/dev/sdc' is # here '/boot/grub/mbr.sdc.1574'. You can restore it like this. # dd if=mbr.sdc.1574 of=/dev/sdc bs=512 count=1 # # Start GRUB global section #timeout 30 resume= /dev/cryptvg/swap (really not sure where or how to put this in grub, or even if its needed) #color light-gray/blue black/light-gray # End GRUB global section # Linux bootable partition config begins title wtf on (/dev/sdc1) root (hd0,0) kernel /boot/vmlinuz-huge-smp-2.6.37.6-smp rootdelay=20 root=/dev/rally2crypt/root ro vga=794 initrd /boot/initrd.gz # Linux bootable partition config ends title --- For help press 'c', type: 'help' root (hd0) title --- For usage examples, type: 'cat /boot/grub/grub.txt' root (hd0) In my boot/initrd-tree/init I needed to add 'sleep 10' to get the usb keyboard working so that I can enter luks passphrase. After installing the system I did a chroot /mnt, then ran /usr/share/mkinitrd/mkinitrd_command_generator.sh -r This is the line it gave me: mkinitrd -c -k 2.6.37.6-smp -f ext4 -r /dev/rally2cryptvg/root -m usb-storage:ehci-hcd:usbhid:xhci-hcd:jbd2:mbcache:ext4 -C /dev/sdc2 -L -u -o /boot/initrd.gz the only thing I added to this was: (for hibernation support) -h /dev/rally2cryptvg/swap mkinitrd created the initrd.gz and it listed all the modules as O.K. Now when I boot, here is some of what I see: ... ... /boot/initrd.gz: Loading kernel modules from initrd image: usb_storage:exports duplicate symbol usb_stor_sense_invalid CDB (owned by kernel) usb 4-1: new full speed USB device using ohci_hcd and address 2 modprobe: can't load module usb-storage (kernel/drivers/usb/storage/usb-storage.ko): invalid module format ehci_hcd: module is already loaded modprobe: can't load module ehci-hcd (kernel/drivers/usb/host/ehci-hcd.ko): Invalid argument usbcore: registered new interface driver usbhid usbhid: USB HID core driver xhci_hcd: module is already loaded modprobe: can't load module xhci-hcd (kernel/drivers/usb/host/xhci-hcd.ko): Invalid argument jbd2: exports duplicate symbol jbd_journel_restart (owned by kernel) modprobe: can't load module jbd2 (kernel/fs/jbd2/jbd2.ko): Invalid module format mbcache: exports duplicate symbol mb_cache_entry_find_next (owned by kernel) modprobe: can't load module mbcache (kernel/fs/mbcache.ko): Invalid module format jbd2: exports duplicate symbol jbd_journel_restart (owned by kernel) modprobe: can't load module jbd2 (kernel/fs/jbd2/jbd2.ko): Invalid module format ... ... Unlocking LUKS encrypted device '/dev/sdc2' as luks mapped device 'lukssdc2' Enter passphrase for /dev/sdc2: semid 32768: semop failed for cookie 0xd4d109b: incorrect semaphore state Failed to set a proper state for notification semaphore identified by cookie value 223154331 (0xd4d109b) to initialize waiting for incoming notifications 3 logical volume(s) in volume group "rally2cryptvg" now active Trying to resume from ../dm-1 ls: ../dm-1: No such file or directory mount: mounting /dev/rally2crypt-root on /mnt failed: No such file or directory ERROR: No /sbin/init found on rootdev (or not mounted) Trouble ahead. You can try to fix it. Type 'exit' when things are done. ... shortly followed by kernel panic Any help would be greatly appreciated. |
Volume group name mismatch:
resume= /dev/cryptvg/swap 3 logical volume(s) in volume group "rally2cryptvg" now active |
>>lilo complains about usb not being harddisk0
LILO might complain, or throw warnings, but unless it errors out with a "Fatal" error, it should work just fine. My server has 7 hard drives sda through sdg, with /boot on sde and LILO in sde's MBR. |
Update:
I changed a line in grub menu.lst to fix the resume kernel /boot/vmlinuz-huge-smp-2.6.37.6-smp rootdelay=20 root=/dev/rally2cryptvg/root resume=/dev/rally2cryptvg/swap ro vga=794 The system does boot now. (finally) But still getting weird modprobe errors: /boot/initrd.gz: Loading kernel modules from initrd image: usb_storage:exports duplicate symbol usb_stor_sense_invalid CDB (owned by kernel) usb 4-1: new full speed USB device using ohci_hcd and address 2 modprobe: can't load module usb-storage (kernel/drivers/usb/storage/usb-storage.ko): invalid module format ehci_hcd: module is already loaded modprobe: can't load module ehci-hcd (kernel/drivers/usb/host/ehci-hcd.ko): Invalid argument usbcore: registered new interface driver usbhid usbhid: USB HID core driver xhci_hcd: module is already loaded modprobe: can't load module xhci-hcd (kernel/drivers/usb/host/xhci-hcd.ko): Invalid argument jbd2: exports duplicate symbol jbd_journel_restart (owned by kernel) modprobe: can't load module jbd2 (kernel/fs/jbd2/jbd2.ko): Invalid module format mbcache: exports duplicate symbol mb_cache_entry_find_next (owned by kernel) modprobe: can't load module mbcache (kernel/fs/mbcache.ko): Invalid module format jbd2: exports duplicate symbol jbd_journel_restart (owned by kernel) modprobe: can't load module jbd2 (kernel/fs/jbd2/jbd2.ko): Invalid module format and this after entering luks passphrase semid 32768: semop failed for cookie 0xd4d109b: incorrect semaphore state Failed to set a proper state for notification semaphore identified by cookie value 223154331 (0xd4d109b) to initialize waiting for incoming notifications and this after entering pass: Trying to resume from ../dm-1 ls: ../dm-1: No such file or directory ah well... at least it boots and runs, I've been on it for two days compiling my user apps, and have had no problems. Still would like to know why I'm getting those modprobe errors. The bit about ' semid 32768: semop failed for cookie 0xd4d109b: incorrect semaphore state' I read a gentoo bug report that this was a kernel bug, and they marked it as non-critical, someone even confirmed the warning stopped after a kernel upgrade. And for the 'Trying to resume from ../dm-1 ls: ../dm-1: No such file or directory I'm pretty sure I can find where it's doing this and change it, regardless I don't think this is important. STDOUBT- Are you getting any warnings like these during boot on your luks system? thanks for your input guys !! |
The modprobe issues are because you are using modules and the 'huge' kernel, which they don't belong to. Swap to the generic kernel and you should be fine.
The semid is a non-fatal error from cryptsetup, I get it all the time, or at least used to until recently. As you say, a kernel update seems to have resolved that here too. (running 3.1.4) |
...Oh man I'm so embarrassed, I can't believe I didn't catch that, thanks GazL.
|
changing to generic-smp cleared up all the modprobe warnings
thanks again ! |
you may want to see here for extra info
http://www.linuxquestions.org/questi...ndrive-816110/ http://www.linuxquestions.org/questi...olness-691480/ http://www.linuxquestions.org/questi...to-ram-723359/ |
All times are GMT -5. The time now is 07:26 PM. |