LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-29-2006, 08:02 AM   #1
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Arrow Mount USB sooner / earlier in boot process


Here is the short of it:

I need my USB drive to mount sooner or earlier in the boot process, before the LVM and cryptdisks run.

Here is the long of it:

My laptop is undergoing an install to use dm-crypt and LVM2. The key for the filesystem encryption comes from a symmetric key file made with GPG, which is stored on the USB drive. Currently, the boot process tries to get the LVM and cryptdisk stuff running before the USB drive is mounted. Since the USB drive is unmounted, the filesystem crypto can't run, and nothing works.

This is how the cryptsetup command comes about:
Code:
# dd if=/dev/random bs=4k count=1 | gpg -a --cipher-algo AES256 -c - > /mnt/usb/keys/fs.gpg
# gpg -q -o - /mnt/usb/keys/fs.gpg | cryptsetup -v -c aes -h sha512 create cryptdisk /dev/hda5
My /etc/crypttab:
Code:
cryptdisk /dev/hda5 /mnt/usb/keys/fs.gpg cipher=aes,hash=sha512,keyscript=/usr/local/src/dmcrypto
The keyscript /usr/local/src/dmcrypto:
Code:
#!/bin/sh
/usr/bin/gpg -q -o - $1
In /etc/default/cryptdisks:
Code:
CRYPTDISKS_MOUNT="/mnt/usb"
And /etc/fstab:
Code:
/dev/sda1 /mnt/usb ext2 defaults 0 1
 
Old 10-17-2006, 04:43 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Typically the USB modules are loaded after the boot process mounts the filesystems via the /etc/fstab file. You can add the modules to the inital ramdisk (initrd) or compile them into the kernel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux boot up process Vs. Windows boot up process darkskull Linux - Software 7 12-30-2006 04:21 PM
Any way to get my startup sound to play sooner? Elim_Garak Linux - General 1 09-14-2006 10:51 PM
USB Thumb Drive Will Not Mount Unless Present During Boot. IamI Slackware 21 02-21-2006 02:40 PM
Mount error during boot process jborn Linux - Newbie 5 01-31-2006 07:46 PM
mount usb module then mount usb hard drive guanyu Linux - Hardware 1 10-08-2003 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration