/boot partition on USB disc for encryption scheme

Hello archers!
i have recently embarked on a project to create a fully encrypted harddrive with the boot routine entirely on a USB pen, as described in this guide
http://linuxreviews.org/howtos/security … ex.html.en
Now, seeing as Loop-AES is not supported in arch, it would mean i'd have to rebuild util-linux amongst other things, and it would be a hassle to maintain. I have taken a look at the dm-crypt + LUKS approach on the wiki, and i was wondering if it was possible to move the /boot partition to the USB pen along with a keyfile and the nessecary routines to make it boot? And if i can, could anyone give me some pointers as to how?

As I have done exactly that - yes.
(well, with CF cards and not USB pen, but since the controller is USB it's technically the same)
First, prepare the USB stick.
- zero it: 'dd if=/dev/zero of=/dev/sdX (<- careful here!) bs=4M'
- put a partition on it; I used cfdisk, normal Linux type 83, and marked it bootable (not really necessary, but hey ;)
- put a filesystem on it; I used plain Ext2 minus all the fancy new stuff (no journal, no 256-byte inodes, no resize_inode, no dir_index, no reserved blocks...)
- make it bootable; I used Grub and had a hard time until I finally got to the normal Grub menu, but I don't remember why ... sorry ^.^
On the topic of Grub, you need a menu.lst:
title Arch Linux
root (hd0,0)
kernel /vmlinuz26 cryptkey=/dev/disk/by-uuid/<UUID-of-Ext2fs-On-UsbPen>:ext2:cryptvg.key cryptdevice=/dev/disk/by-uuid/<UUID-of-Encrypted-RootDisk>:vg root=/dev/mapper/vg-root ro radeon.modeset=1 # okay, KMS is a bit off-topic... :p
initrd /kernel26.img
That's already full-featured, as my setup uses a keyfile instead of a passphrase, and it's an LVM-on-LUKS setup.
Scrap the "cryptkey=..." if you want to input a passphrase on boot.
You really want to use the UUID scheme and for that, 'blkid' is your friend.
Next up is the initramfs, so edit /etc/mkinitcpio.conf.
I tend to keep it minimal (my CF card is not exactly huge - 8 MB ;-) so only the really required modules and hooks:
-> MODULES="intel-agp radeon ehci-hcd usb-storage ext2 sd_mod ahci jfs"
The first two because I want early KMS, the next two to recognize the USB reader, ext2 to read the keyfile, sd_mod is mandatory and you'd have to modify the last two for your setup - type of IDE/SATA controller and root filesystem
-> CRYPTO_MODULES="aes-i586 xts"
Pretty straightforward - you can simply omit the line, the image will just get a bit larger
-> HOOKS="base consolefont udev encrypt lvm2"
Simple again - you always want "base+udev", it's LUKS encrypted and in there lies the LVM stuff; "consolefont" just in case, so you have the same keyboard layout as in /etc/rc.conf right from the start.
-> COMPRESSION="lzma"
8 MB CF card, remember?  >.<
Now rebuild the image: 'mkinitcpio -p kernel26' (or specify its location directly with -g)
Last but not least put the /boot stuff (minimum: System.map26, vmlinuz, kernel26.img and the grub/ dir) on the stick and have fun rebooting! :-p
You also might want to read the relevant wiki article a few times more, just in case.
And one final note: I didn't do this with a fresh install, but converted an existing Arch setup to LUKS+LVM after getting a new machine, so I can't say how this would work together with the current installer.
Last edited by byte (2010-05-31 01:43:46)

Similar Messages

  • OS X won't boot after being installed on an encrypted partition

    Hello!
    Today i formatted my entire disk, but made it Journaled, Encrypted. It installed (actually "downloaded aditional files"), and then booted with a cross/do not proceed sign. I booted from the install disk again, got an error telling me to reinstall OS X. I was never asked for my password, and when i started disk utility, the disk was locked.
    Why is the option there if it doesn't work?
    Andrei

    Thanks for this info:
    Kappy wrote:
    There may be many reasons why it didn't work but without knowing exactly what you did it's pretty difficult to make any presumptions.
    Others use it, and there have not been too many posts about using encrypted disks and FileVault 2. But searching the forums may help you.
    One thing I'd consider trying if you were willing to take the time and trouble:
    Drive Preparation
    1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button.  When the menu bar appears select Disk Utility from the Utilities menu.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  SMART info will not be reported  on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    Step 1 can be changed to whatever method you are using to boot into the Lion installer or a Recovery HD volume.
    But as ai said, i don't need it. I'm aleadry installing it normally.
    So no need to help. I'm just curious why the Encrypted option isn't working.
    Thia is what i did:
    Booted from the disk, selected my HDD, clicked erase and selected "HFS+ extended (Journaled, Encrypted)"
    It installed
    After rebooting, it didn't ask me for the password i set for encryption.
    Booted with the Cross (X) instead of the logo.
    And that's it... I've seen that if you turn on filevault, it'll ask you for a password when booting. But for me it didn't.
    RIght now it's working (i used the :HFS+ Extended (journaled)" without encryption.
    And i want to know if it's my fault, or Apple's.

  • External Boot Disc for Late 2008 MacBook

    Will the MacBook 13-inch Aluminum boot from an external USB disc (SuperDuper bootable clone)?
    If so, any special requirements for this to happen? (Select external disc with Startup Disc, or use option key at startup and select system from which to boot as before?)
    (Previous Books would only boot from Firewire external discs...)
    ...JB

    I boot both Intel-based and PowerPC-based Macs from APM partitioned USB and FireWire hard drives every day at work. We have to have the APM partitioned because the PowerPC-based Macs will NOT boot from a GUID-partitioned hard drive. Our hard drive need to be able to boot both so we can use the same hard drives to install Leopard on either platform.
    EDIT: Intel-based Macs can startup from either a GUID or APM partitioned drive. However, looking into it further, Intel-based Macs can only INSTALL Mac OS X to a GUID-partitioned drive. If Mac OS X 10.5 is already installed on an external drive, it doesn't matter what the partition format is.
    http://support.apple.com/kb/TS1600
    I don't specifically remember installing Mac OS X 10.5 on an APM-formatted external hard drive from a PowerPC-based Mac, but it's possible I did. It's just my own tower and my one test iMac at work are both Intel-based Macs. I'm not sure what computer I might have used to format and install Mac OS X 10.5 onto our external drive...
    Of course, if you only have an Intel-based Mac, there's no reason to bother with the APM format. You could use the Disk Utility to "restore" your Intel-based Mac to an external drive with either partition scheme and it would be bootable. It's only the Mac OS X installer that would stop you if you had the wrong format.
    -Doug

  • I have just purchased a new iMac OS Xlion version 10.7.3 and I'd like to install Windows. I have a disc for XP but the Boot Camp Assistant manual only refers to Windows 7. Please does anyone know if it will it work with XP.?

    I have just purchased a new iMac OS Xlion version 10.7.3 and I'd like to install Windows. I have a disc for XP but the Boot Camp Assistant manual only refers to Windows 7. Please does anyone know if it will it work with XP.?

    Get a Virtual Macine software program, Parallels, VMware Fusion or VirtualBox, and install XP in a virtual machine.
    You can't install XP in a Boot Camp Partition with Lion or Mt Lion, only Win 7.

  • I want to create a USB drive for Mountain Lion and have no discs

    I have a nice shiny new 27: iMac and was hoping to create a USB boot drive in case I need it. The iMac does not come with a disk drive and Mountain Lion is purchased via the App Store, so there are no disks with which to build the boot drive. I tried downloading Mountain Lion again from the App Store, but it tells me Mountain Lion is not compatible with this computer. (yes, the computer that is running Mountain Lion right now)
    iTunes Support is not very helpful. They keep telling me that I can't make a boot drive and are unable to help me download if from the App Store.
    Surely Apple has created a way to build a boot drive in the case of emergency. There will be no way to defrag my hard drive if I am unable to boot from the USB drive.

    You have one on your iMac, the recovery partition. Your iMac is not compatible with the App Store version so don't try.
    Install OSX on to a thumb drive if you want, it's a waste of time compared to using Recovery.
    Click this link for a Google search for 3rd party suggestions.

  • Is there a size limit for hard drive boot partition?

    I have been using Drive Genius to adjust the size of my boot partition larger. But it doesn't seem to allow for much increase, even though I deleted the second partition and tried to apply the disk space to DH1: (boot - there is a single partition on the hard drive now.)
    It recognizes only 59.53gb and the drive is I think around 130gb. Anything beyond 59.53 is unusable since I deleted that second partition though I could probably get it back with a second partition.
    Is this a Tiger issue or a Mac issue? It resized it bigger somewhat, so it seems to be something about the particular size. I want a really big space for my applications and so on.
    Thanks. Didn't know where to post this question.

    You don't want to make a disc image. You want to clone to an external drive:
    How to Clone Using Restore Option of Disk Utility
    1. Open Disk Utility from the Utilities folder.
    2. Select the backup or destination volume from the left side list.
    3. Click on the Erase tab in the DU main window. Set the format type to Mac OS Extended (journaled, if available) and click on the Erase button. This step can be skipped if the destination has already been freshly erased.
    4. Click on the Restore tab in the DU main window.
    5. Select the backup or destination volume from the left side list and drag it to the Destination entry field.
    6. Select the startup or source volume from the left side list and drag it to the Source entry field.
    7. Double-check you got it right, then click on the Restore button.
    Once you finish the clone open Startup Disk and set the clone as your startup volume, then click on the Restart button. You should now boot from the clone. You can then repartition the internal hard drive the way you want, then clone the external drive to the internal one.

  • I am confused by the installation step that requires you to create a bootable USB drive for windows installation.  What is the ISO image and why has it selected my Passport backup drive as the destination disc?

    In the bootcamp installation it asks me to create a bootable USB drive for Windows Installation.  To do so, I must choose an ISO image.  What is that?  When I click "choose" I don't understand the options presented.  Is this the destination of the partition or where Windows will reside on the Mac?  Why does it also indicate the the destination disk si my WD Passport Back up drive?

    OK, so I have an apple superdrive hooked up to my mini (along with my Passport back up drive).  I also have  the discs for both 64bit and 32bit Windows along with the product key.  I am still not sure what to do when faced with the options after "choose".

  • [SOLVED] Arch Linux on encrypted luks partition on USB key

    Hi
    I've installed Arch Linux on a USB key following this Wiki page: https://wiki.archlinux.org/index.php/In … _a_USB_key
    I also used dm-crypt as described in this Wiki page: https://wiki.archlinux.de/title/Festpla … iante_1.29
    I installed Arch Linux on the USB key using VirtualBox.
    To do that, I created a "rawvmdk":
    vboxmanage internalcommands createrawvmdk -filename ./usb.vmdk -rawdisk /dev/sdd
    Everything works fine when I'm trying to start the system within VirtualBox.
    Syslinux loads Arch using the following kernel command:
    APPEND cryptdevice=UUID=6aa73872-3755-4bdf-bee3-d1cd7a3fe0bf:main root=/dev/mapper/main-root rw
    /etc/mkinitcpio.conf holds the following "HOOKS" configuration:
    HOOKS="base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsch resume"
    As already mentioned the configuration works within VirtualBox. When I'm trying to boot from the USB key on my real computer, I'm getting an error. Syslinux works fine and loads Linux, but Linux is complaining. Here's the log:
    :: running hoock [encrypt]
    Waiting 10 seconds for device /dev/disk/by-uuid/6aa73872-3755-4bdf-bee3-d1cd7a3fe0bf ...
    ERROR: device '/dev/mapper/main-root' not found. Skipping fschk.
    ERROR: Unable to find root device '/dev/mapper/main-root'.
    You are being dropped to a recovery shell
    I'm not getting prompted for the passphrase since the cryptdevice can not be found. But why? It can be found when I'm booting within VirtualBox. What might be different? I successfully installed other Linux distributions (but without encryption and using GRUB as bootloader) previously within VirtualBox and was able to boot from the USB key on a real machine afterwards.
    Some additional information that might help:
    Here's the "lsblk -f output" for the stick:
    sdd
    ├─sdd1 ext4 usbboot bb45e84e-842e-4209-8c44-1af3c7933389
    └─sdd2 crypto_L 6aa73872-3755-4bdf-bee3-d1cd7a3fe0bf
    When I'm running "lsblk" or "blkid" from the recovery shell after the failure, I'm getting no output. "ls /dev/sd*" returns nothing as well. The directory /dev/disk does not even exists in the recovery shell. (I'm not sure if this is normal or not.)
    Thanks for helping.
    Last edited by The Infinity (2014-08-14 20:26:06)

    I still haven't solved the problem:
    When starting the system on a machine with NVIDIA GTX 560Ti graphics card:
    - X doesn't start using startx or xinit and there are no log entries in /var/log/Xorg.*.log (as I haven't tried to start X).
    - I'm getting the message "Waiting for X server to begin accepting connections .. .. .. ..".
    - I already tried to uninstall xf86-video-nouveau and nouveau-dri with no effect.
    - Additionally: The "default terminals tty1/2/3/..." (which I'm using to start X) from have a poor resolution (I think 640x480 pixel).
    When starting the system on a virtual machine or a machine with an ATI Radeon (mobile) graphics card:
    - X starts and runs without any trouble the XFCE desktop environment.
    - Additionally: The default terminals have a proper resolution (I think the maximal resolution of the display).

  • Boot partition corrupted on encrypted install, trouble repairing GRUB

    Long story short, my boot partition got thoroughly messed up. I have an encrypted install with luks and dm-crypt. I have tried many guides for fixing grub and none are working.
    Here is where I'm running into trouble:
    I've booted an arch install cd, modprobe'd dm_crypt, mounted my encrypted root with cryptsetup, run arch-chroot, mounted the boot partition to /boot, run grub-install /dev/sda, and then grub-mkconfig -o /boot/grub/grub.cfg
    When running grub-mkconfig I get 12 instances of "WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning." followed by "done". Upon reboot I am met with the grub prompt.
    Any ideas?

    OK. Well the wiki is usually more up to date and more accurate. However https://wiki.archlinux.org/index.php/Chroot says it is OK to mount them after just simpler and safer to do so before.
    I am not surprised grub is unhappy - it doesn't seem to have any entries at all in grub.cfg. I guess it doesn't even give you a menu? (I am not sure how it would make one.)
    Did you remember to reinstall the linux package before generating grub.cfg? That's the only thing I can think right now would cause it to just find nothing at all. I've seen it generate entries which wouldn't work but it is acting as if there is nothing there whatsoever. What is the contents of /boot? (Not everything under /boot/grub. Just the top level.)
    EDIT: I only asked what happened to /boot in case it suggested any deeper problem. "Corruption" could mean hardware failure, for example. Just wiping it is not that bad . Seen much worse lately, anyway. (You could have run it on / or /home, after all.)
    Last edited by cfr (2013-07-31 02:06:39)

  • Boot partition on GPT USB. Other Partitions on MBR Hard Disk.Possible?

    Hi all,
    I have successfully installed Arch on my 8GB USB with a GPT. I didn t want to harm my HD with Windows initially. My HD is MBR.
    I was wondering if it was possible to move the Home and Root partitions into the HD on specifically ext4 partitions, of course, while keeping the Boot partition on the USB. Is it harmless or risky, given that USB is GPT while HD is MBR?
    I wanted to do that to avoid dual-boot. Since other users are mostly using my computer with Windows, I wanted to use the USB as a sort of "magic key". No security needs, just I didn-t want to bother with dual boot the users that are using the pc most of the time.
    Can I just do that with dd? Is it harmless having Boot partition on GPT disk while the rest on another MBR Hard Disk?
    Thanks.

    nomorewindows wrote:
    Nukles wrote:
    Many thanks for your answer!
    To copy the partition can I use dd ? Because I read in another post that one must be very careful when using dd - or is it to be careful for specific dd usages?
    Thanks.
    Given that they are different disks, and how everything gets rearranged from one disk to another, I would just mount the disks involved and copy them over with cp/mv.  There's not really any point in exact disk duplication here. 
    Linux doesn't care whether the partition table is MBR or GPT it operates as it should.  I converted from MBR to GPT in place using gdisk.  Linux didn't have to rename anything.  GPT is viable if Windows is not a problem.  So leaving Windows alone is probably the easiest with your travel media.  Why you would leave your /home and other directories to the availability to others when you already have a travel drive, might pose an unneeded situation for you. Although the travel drive will wear out quicker.
    Hi,
    I tried today with cp, but I have run into issues...
    I have /, /boot and /home in three different partitions in the USB. I want to move / and /home into the HD into specifically created partitions, formatted with ext4.
    I mounted sda8 and sda9 (my partitions on the HD for the new / and /home) into /mnt/root and /mnt/home.
    Doing
    cp -a /home /mnt/home
    did not make any issues...
    Issues started when I made
    cp -a / /mnt/root
    . In fact the destination partition unexpectedly filled out completely, despite being so much bigger than the source partition.
    Then I realized that something (do not know yet what) had mounted my 500 GB external HD into /media/run/HD500GB so cp was copying the contents of that into the new root partition...!!! Although there is no mention of that in the /etc/fstab.
    Why does it do that? If the file system of my external 500GB HD is in another partition, how come does cp copy that content, coming from the root partition, into the destination?
    By the way, I unmounted the 500GB HD, and performed the command again, but... after a while it says
    cp: cannot stat `/run/user/1000/gvfs`: Permission denied
    Actually the first time I ran the command it stopped after a while complaining that some file systems he failed to extend due to lack of permissions... The size though was almost the same of the original partition. The directories of the new root partition were however not the same.
    In the original root I had
    bin boot dev etc home lib lib64 lost+fount mnt opt proc root run sbin srv sys tmp usr var
    On the destination root I had
    etc lib lost+found opt run sbin sys tmp usr
    So my questions would be:
    - Why you think the command didn t perform correctly? (I ran it after doing su - root)
    - Why did it copy also the file systems residing in other partitions?
    - If it copies also things in other partitions, then if I copy root, it will also copy the entire /home filesystem into the new root directory, although I had copied that already into another partition...
    Can you help me?
    Thanks a lot!

  • Partitioned external hard drive for creating the USB bootable device

    Hi all,
    I want to install Win 7 on my Macbook Pro (OS X Yosemite 10.10.1) but I don't have an 8GB or larger USB flash driver. I do have an external hard drive of 500GB that I use for backup. So, I tried to create a small partition on this disk to create the USB bootable device required for the windows installation but apparently I'm not able to select any specific partition when the boot camp assistant ask me for the destination disk.
    Is that normal?
    Thanks.

    Yes, you can do that.
    Although you can buy a complete external drive system, you can also put one together if you are so inclined.  It's relatively easy and only requires a Phillips head screwdriver (typically.)  You can purchase hard drives separately.  This gives you an opportunity to shop for the best prices on a hard drive of your choice.  Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu.  You can find reviews and benchmarks on many drives at Storage Review.
    Enclosures for FireWire and USB are readily available.  You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports.  I would stress getting enclosures that use the Oxford chipsets especially for Firewire drives (911, 921, 922, for example.)  You can find enclosures at places such as;
    Cool Drives
    OWC
    WiebeTech
    Firewire Direct
    California Drives
    NewEgg
    All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover.  Usually the only tool required is a small or medium Phillips screwdriver.

  • Boot from USB Key (for Windows installation)

    This is my weirdest issue ever:
    I have a windows 8 installation key which i want to use with bootcamp. Everything worked flawlessly on my MacBook Air (late 2011).
    What I did on MacBook Air:
    Created MS-FAT Partition with Disk Utility
    Plugged in Win8 USB Key
    Restarted
    Held alt (or option) key and booted from the USB Key
    Installed without error
    However, this procedure DOES NOT WORK on my MacBook Pro (2008) or my iMac (mid 2011)!!! They do NOT show the USB Key when I hold alt (or option) during startup.
    Is Apple somehow not allowing this due to the presence of a CD-Drive on the Pro and iMac?
    The Key still shows up on the MacBook Air and is bootable even after installation of win8. So the problem is not the USB Key.
    Thanks for any help!
    Jordan

    Being recognized and allowing Windows to be installed from a USB key are to totally different things.
    But I have not yet worked with the 2012 Standard model MBPs so maybe Apple changed something on them that does allow Windows to be installed from a USB drive. But for all other models that have a built in DVD drive you can't do it from USB.

  • How do I convert my Windows 7 Folder to an ISO image to burn to a USB, in order to use Bootcamp Assistant to partition my MacBook Pro for Mac and Windows?

    How do I convert my Windows 7 Folder to an ISO image to burn to my  USB Flash drive (16GB)  in order to use Bootcamp Assistant to partition my MacBook Pro for Mac and Windows?

    Sorry - confusing - My question has NOT been solved yet - can anyone help?

  • How do I get recover disc for vista when system will not boot???? For Pavilion pc a6157c

    Pavilion pc a6157c   How do I get recover disc for vista when system will not boot????

    Read THIS HP Support Document concerning ordering recovery discs for your HP a6157c. Go to THIS HP webpage to order the "Vista Home Premium 32bit 73NAv3PrA1 + Supp 4 Recovery Kit" for your computer. If you are not looking to order the recovery discs or have some other issue with your computer, please provide detailed information concerning the problem.
    Frank
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • I partitioned a small drive for a windows program, and now the computer only wants to boot to Windows.  How do I get back to Mac so I can have a choice of drives?

      I partitioned a small drive for a windows program, and now the computer only wants to boot to Windows.  How do I get back to Mac so I can have a choice of drives?

    That doesn't sound good. It sounds like the power outage might have corrupted the partition for OS X. I would suggest booting from the Install DVD that came with your Mac while holding down the C key. Once you have selected the language start up Disk Utility from the pull down menu and repair the disk. Once you have done that then repair permissions also.
    Allan

Maybe you are looking for