[LUNI] Proper names and finding names of encrypted things and lvm stuff

Jay Strauss me at heyjay.com
Sun Nov 9 14:39:02 CST 2008


Hi everyone (I'm resending, my message doesn't seem to have made it to the
archive),

I created an encrypted file system upon an lvm upon a raid1 device, during
the install of ubuntu 8.10.  Afterwards, I created a new lvm and own
encrypted filesystem within it.

like:
lvcreate -L5G -nlv_enc vg0
cryptsetup -c aes-cbc-essiv:sha256 -y -s 256 luksFormat /dev/vg0/lv_enc
cryptsetup luksOpen /dev/vg0/lv_enc cryptoopt
mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/cryptoopt

cryptsetup luksClose cryptoopt
cryptsetup luksOpen /dev/vg0/lv_enc cryptoopt
mount /dev/mapper/cryptoopt /opt

Everything works fine!  Now my questions

1) what is cryptoopt?  I know its the <name> param to the "cryptsetup", but
what is it?
I can "cryptsetup luksClose cryptoopt" and then re-open like "cryptsetup
luksOpen /dev/vg0/lv_enc cryptoMrNewName"  without complaint, and go ahead
an mount it on /opt

2) is there a command that will list all the <name>s currently active?
(mounted or not), I can't find it in "man cryptsetup" if there is one.

3) It seems I can access these LVs via 2 different names: "/dev/vg0/lv_enc"
or "/dev/mapper/vg0-lv_enc"
root at ubuntu:/home/jstrauss# cryptsetup luksOpen /dev/vg0/lv_enc stuff
Enter LUKS passphrase:
key slot 0 unlocked.
Command successful.
root at ubuntu:/home/jstrauss# cryptsetup luksClose stuff
root at ubuntu:/home/jstrauss# cryptsetup luksOpen /dev/mapper/vg0-lv_enc
stuff
Enter LUKS passphrase:
key slot 0 unlocked.
Command successful.

I seen in "df" my filesystems are mounted using the "/dev/mapper/vg-0...".
I'm guessing that's probably the correct way.

Is one name better?

4) If I'm supposed to use the "/dev/mapper/vg-0..." names when I "luksOpen"
these, is there a command for querying the names?

I know about
root at ubuntu:/home/jstrauss# lvscan
  ACTIVE            '/dev/vg0/lvvar' [10.00 GB] inherit
  ACTIVE            '/dev/vg0/lvencrypted' [10.00 GB] inherit
  ACTIVE            '/dev/vg0/lvhome' [10.00 GB] inherit
  ACTIVE            '/dev/vg0/lvswap' [2.00 GB] inherit
  ACTIVE            '/dev/vg0/lv_enc' [5.00 GB] inherit


Thanks
Jay


More information about the luni mailing list