Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Fedora This forum is for the discussion of the Fedora Project.


  Search this Thread
Old 05-14-2013, 12:16 AM   #1
Registered: Mar 2005
Location: Atlanta, Ga.
Distribution: Fedora
Posts: 63

Rep: Reputation: 15
Trouble with LUKS/LVM2

I use LUKS for full drive encryption, with the exception of my boot drive where I'll create a separate /boot partition and then the balance of the drive in one partition which I'll format with luksFormat. The other drives I encrypt the raw device in other words no partitioning. I then apply LVM2 to the encrypted drives. Currently I use one physical drive for each Volume Group (VG).

I recently had to replace a drive, so when the new drive came I went ahead and ran badblocks on all 5 of my drives.(I do not use RAID, these are set up as JBOD). After badblocks, I like to run dd if=/dev/urandom of=/dev/sd? to write random data to the drives.

As each drive finishes I would then start the process with the boot drive gdisk to create the 3 partitions (used GUID partition structure so 1. was 2MB GPT partition, 2. was my /boot partition and then the rest for encryption. For the LUKS part I would cryptsetup lukFormat /dev/sd? (boot drive was sda3), followed by cryptsetup luksOpen /dev/sd? Name-of-LUKS-Volume (which is the same as my VG name)

After encrypting I would create the Physical Volume (PV) pvcreate /dev/mapper/Name-of-LUKS-Volume. Then I created the VG by vgcreate VG_0? /dev/mapper/VG_0?(As I said LUKS Volume name was the same as Volume Group name). Then my Logical Volume(s) (LV) creating by lvcreate -C y -L ?G VG_0? -n swap0? (5 swaps spread 1/VG) and for the non swap LVs, lvcreate -L ??G VG_0? -n LV-name or lvcreate -l +100%FREE VG_0? -n LV-name when using the rest of available extents in the VG. I then did the formatting of each LV and then mounted them. The LUKS/LVM2 looks like this:

sda3 VG_01 LV-01 root, LV-02 swap01, LV-03 home, LV-04 pub_docs, LV-05 pub_graphics, LV-06 tmp, LV-07 var
sdb VG_02 LV-01 swap02, LV-02 pub_dnlds
sdc VG_03 LV-01 pub_audio, LV-02 swap03, LV-03 pub_audio_wav
sdd VG_04 LV-01 pub_isos, LV-02 swap05
sde VG_05 LV-01 swap05, LV-02 videos

I then edited crypttab and fstab to make sure that the LUKS Volumes would be decrypted and the LVs would be mounted.

After some minor issues I got VG_01 & VG_02 working, but I after doing VG_03 and restoring the data for both LVs when I went to reboot the system hung during the boot. I noticed something to the effect of "Starting Monitoring of LVM2 blah blah blah (Don't remember what else it said. I rebooted safe mode from the install DVD and manually Opened the LUKS volumes and mounted the LVs with no problem so I went to boot from disk and it came up but LV-3 of VG_03 did not mount, all others did. I manually mounted that LV and all was well including after rebooting again. I then had the last 2 drives ready so I repeated the above procedure for both only to have the first reboot after data restore hang again. This time I looked closer and saw that it had done a fsck for all LVs and mounted each one except for the last LV on VG_05 before it hung. I booted into safe mode again, commented out that LV in fstab and rebooted fine. I was then able to manually mount the LV.

I do not see what I'm missing here, so why does it not work?

Sorry it's so long but I was trying to give as much info as possible.

Scott C


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] LUKS / LVM2: Root partition unable to boot, initrd errors ADX Slackware 5 01-13-2012 05:57 PM
LUKS + RAID + LVM2 and suspend to ram vehn Slackware 3 12-14-2011 08:54 AM
Trouble booting new Slack 13. LVM on Luks BashTin Slackware 8 10-22-2011 08:56 PM
[SOLVED] Can you shrink a LUKS-encrypted physical volume? (LVM2) piratesmack Slackware 1 11-12-2010 11:40 AM
Mounting LUKS encrypted drive from a failed pc: LVM2 error klearview Linux - Software 1 10-31-2008 04:34 AM > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:53 AM.

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