LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   bootable usb drive for fully encrypted slackware? (https://www.linuxquestions.org/questions/slackware-14/bootable-usb-drive-for-fully-encrypted-slackware-789459/)

jelezarov 02-16-2010 06:42 AM

bootable usb drive for fully encrypted slackware?
 
Hi,

following the alien bob's guide from "README_CRYPT.TXT" on the disk i sucesfully create and work with fully encrypted volumes.

So, i wonder - is there any way to get the entire /boot directory on flash stick and boot only with it. How can i add the initrd and all the stuff and force /root to be on the hard disk. I searched Google and the only similar solution i found was for grub.

Any suggestions welcomed!

Cheers

JimBrewster 02-16-2010 12:14 PM

Well you could install grub. It's in the 'extra/' directory of the install DVD. I've always replaced lilo with grub once my install was up and running.

jelezarov 02-17-2010 02:54 AM

Quote:

Originally Posted by JimBrewster (Post 3865843)
Well you could install grub. It's in the 'extra/' directory of the install DVD. I've always replaced lilo with grub once my install was up and running.

Thank you for your suggestion!
It seems i'll have to give grub a try.

uppman 02-17-2010 03:39 AM

You could also use Syslinux or Extlinux.

Please see the link below and look for: Replace Lilo/Grub with Extlinux

http://linuxconfig.dyndns.org/lazy/L.../Boot/Syslinux

/Magnus

jelezarov 02-18-2010 04:01 AM

ext/syslinux seems to do the job... but

now the problem is - on my pc the motherboard (evga X58 Sli LE) won't boot the usb if it is ext formatted. When i format it with fat, the the initrd tree can not be copied on the stick with "Operation not permitted" error message. My laptop on the other side boots both ext and fat formatted usb flash, so the problem is probably related to the motherboard of the pc and i have no idea how to fix it - the bios just don't recognize the stick as "bootable".

uppman 02-18-2010 04:32 AM

Quote:

Originally Posted by jelezarov (Post 3867908)
ext/syslinux seems to do the job... but

now the problem is - on my pc the motherboard (evga X58 Sli LE) won't boot the usb if it is ext formatted. When i format it with fat, the the initrd tree can not be copied on the stick with "Operation not permitted" error message. My laptop on the other side boots both ext and fat formatted usb flash, so the problem is probably related to the motherboard of the pc and i have no idea how to fix it - the bios just don't recognize the stick as "bootable".

You don't need to copy the full /boot directory. The only things that need to be on the stick is syslinux, a kernel and initrd.gz.

/Magnus

jelezarov 02-18-2010 05:27 AM

Quote:

Originally Posted by uppman (Post 3867930)
You don't need to copy the full /boot directory. The only things that need to be on the stick is syslinux, a kernel and initrd.gz.

/Magnus

Thank you for helping me!

Without the initrd-tree it fails to mount the encrypted root fs - kernel panic "Unable to mount root fs on unknown-block" error.

uppman 02-18-2010 06:24 AM

Quote:

Originally Posted by jelezarov (Post 3867959)
Without the initrd-tree it fails to mount the encrypted root fs - kernel panic "Unable to mount root fs on unknown-block" error.

You must use the initrd.gz (not the initrd-tree) and perhaps tell it where to find the root partition.

Something like this:
root=LABEL=PUTLABELHERE rootfs=ext4
or
root=/dev/sdc1 rootfs=ext4

/Magnus

jelezarov 02-18-2010 07:02 AM

The "rootfs" thing fixed the problem! Big thank you, uppman!

Here is the short story, for anyone facing the same problem:

- Install the encrypted slackware, as described in "README_CRYPT.TXT" on the slackware-dvd
- After setup is complete, as described, create the new initrd image
- Copy the new initrd.gz and the generic kernel used for it on the flash stick
- The stick was formatted with FAT and marked as bootable
- Rename the kernel - it seems the long name don't work in syslinux.cfg - i use just vmlinuz for it
- Create syslinux.cfg on the stick - here is mine:

Code:

prompt 1
timeout 100
default  slack
label slack
        kernel linux
        append initrd=initrd.gz root=/dev/cryptvg/root rootfs=ext4

- mount the usb stick somewhere, go there, and:

Code:

#syslinux -d . /dev/sdb1
--- note that /dev/sdb1 is the flash stick and may be different

- put the usb stick in the pc, make sure it has boot priority in BIOS, reboot

- VOILA!!


Note: in my case i'll have to load the modules for my wireless keyboard in initrd or compile it in kernel, otherwise i can not enter the passphrase


All times are GMT -5. The time now is 11:24 PM.