LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2011, 01:15 PM   #1
manyrootsofallevil
Member
 
Registered: Dec 2010
Distribution: Red Hat, Kubuntu
Posts: 130

Rep: Reputation: 14
luks and logical volumes


Not sure whether I should post this on the newbie forum, at any rate.

I'm bit confused as to what is going on with LUKS and Logical Volumes (LV(s) henceforth)

I created a Luks encrypted partition on my VM test machine and that is straight forward enough.

using:
Code:
cryptsetup luksFormat /dev/sdb
 cryptsetup luksOpen /dev/sdb crypto
and then adding to /etc/crypttab the following:
Code:
crypto /dev/sdb none
So far so good

I get prompted on start up for the passphrase and I can mount the partition without any problem , e.g. mount /dev/sdb /mydirectory, works a treat.

Now, I created a volume group (vol1, I like original names) out of two partitions, and then used it to create a logical volume (lv1)

So armed with a logical volume, I proceed with the same steps as above, namely:

Code:
cryptsetup luksFormat /dev/vol1/lv1
 cryptsetup luksOpen /dev/vol1/lv1 cryptlv
and then adding to /etc/crypttab the following:

Code:
cryptlv /dev/vol1/lv1 none
I can mount this with:
Quote:
mount /dev/mapper/cryptlv
The thing is that I did blkid and there is an extra device

/dev/mapper/crypto: UUID="2204caa6-08a1-4c9b-bb1e-d35f6acaa03a" TYPE="ext4"
/dev/mapper/vol1-lv1: UUID="7f54aaf2-8fd6-428c-be12-a059d5df4650" TYPE="crypto_LUKS"
/dev/mapper/cryptlv: UUID="5f7fa55f-09fc-4b29-88e7-b4ddcd5a21b8" TYPE="ext4" LABEL="cryptlv"

I cannot mount this extra device, I tried:
Code:
mount  /dev/mapper/vol1-lv1 /mydir
and
Code:
mount  -t crypto_LUKS /dev/mapper/vol1-lv1 /mydir
but both return
Code:
mount: unknown filesystem type 'crypto_LUKS'
My questions are as follows:

Why is there a new device?
How was it created (I certainly did not do it manually)?
How do I get rid of it?

TIA
 
Old 02-19-2011, 07:38 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
Quote:
Originally Posted by manyrootsofallevil View Post
Why is there a new device?
Because LVM leverages device-mapper to map the underlying [physical volume] block device(s)'s physical-extents to the logical-extents that comprise the logical volume.


Quote:
Originally Posted by manyrootsofallevil View Post
How was it created (I certainly did not do it manually)?
Ah, but you did when you created the logical-volume named lv1.



Quote:
Originally Posted by manyrootsofallevil View Post
How do I get rid of it?
remove the logical volume...
Code:
# umount /dev/mapper/cryptlv 
# cryptsetup luksClose /dev/vol1/lv1
# # Be sure you no longer want to utilize the encrypted LV before proceeding.
# # This will delete the LV; remove or comment its line in /etc/crypttab.
# lvchange -an /dev/vol1/lv1
# lvremove /dev/vol1/lv1

 
Old 02-21-2011, 01:58 AM   #3
manyrootsofallevil
Member
 
Registered: Dec 2010
Distribution: Red Hat, Kubuntu
Posts: 130

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by rayfordj View Post
Because LVM leverages device-mapper to map the underlying [physical volume] block device(s)'s physical-extents to the logical-extents that comprise the logical volume.



Ah, but you did when you created the logical-volume named lv1.




remove the logical volume...
Code:
# umount /dev/mapper/cryptlv 
# cryptsetup luksClose /dev/vol1/lv1
# # Be sure you no longer want to utilize the encrypted LV before proceeding.
# # This will delete the LV; remove or comment its line in /etc/crypttab.
# lvchange -an /dev/vol1/lv1
# lvremove /dev/vol1/lv1

Thanks for the reply

I had actually worked it all out, after I posted, just too lazy to answer my own post.

It's amazing what happens when one stops and reads documentation
 
  


Reply


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] Logical volumes not available on reboot Vanyel Linux - Server 11 09-19-2011 10:23 AM
Encrypting logical volumes Ezys Fedora - Installation 1 11-02-2010 02:10 PM
Are logical volumes images ? vzxen Linux - Newbie 2 07-05-2010 06:43 AM
creating logical volumes... mtsm Linux - Newbie 1 01-31-2009 06:38 AM
I did not know about logical volumes gezi Linux - Newbie 5 04-27-2005 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:26 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