[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#392080: Swap check fails for swap-on-LVM-on-crypto

submitter 392080 !

Ok, so I have the problem captured in a VM, the relevant thing I guess
is what dm_is_safe returns

(details slightly masked as I can't paste them from the VM

/proc/swaps contains
Filename ...
/dev/mapper/Debian--swap partition 12345 388 -1

/sbin/dmsetup table outputs
hda1_crypt: 0 6134711 crypt aes-cbc-essiv:sha256 cc234329750923475293... 0 3:1 2056
Debian--swap: 0 1234 linear 254:0 384

So the information is there, I just don't know how to tie the crypt line
to the volume group with the swap in it. Would it need to work out whether onei
was inside the other?

The dmsetup info output has the major/minor numbers for them, which is a
little more informative, but harder to parse.

So a possible strategy

  1) Do what was done previously, if that says crypt then it's ok, else
  2) Find the volume group by examining the info output (look for
  matching major number and 0 minor number).
  3) Use the old approach on this target, and check for crypt there.

Note: I have no experience with LVM, so I'm just making this up.

The other possiblity is that the group always starts the list of
volumes, so if the volume starts at 0, look at the previous one that
also starts at 0 (possibly just the previous). If it starts later, look
for the second starting at 0 going backwards.

It all sounds a little hackish though. Do you know if there is any other
way to get this info?


  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256

Reply to: