Re: Re: resize and reload options to cryptsetup

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

 



On 10/02/2008 Clemens Fruhwirth wrote:
> > Clemens, I believe that both options are not meant to be used on luks
> > devices. What do you think about implementing a check to cryptsetup
> > which simply prohibits resize/reload if executed on a luks device?
> 
> Yes, that should be possible quite easily. iirc there is a function in
> cryptsetup (use for isLuks) to check exactly that.

Do you mean LUKS_read_phdr() from luks/keymanage.c? Many *crypt_luks*
functions do have the following code at the beginning:

r = LUKS_read_phdr(options->device,&hdr);
if(r < 0) return r;

seems like LUKS_read_phdr() returns a value < 0 if it's not a luks
device. But on the other side, LUKS_read_phdr outputs errors in case
that the device is not a LUKS device. thus the check would not be useful
in reverse order, am I correct?

> > Or is it technically possible to adapt the options for luks devices?
> 
> Yes.
> 
> From a quick glance at the code, ('reload' is just a special variant
> of 'create' that does not fail when the device exists) it looks like
> reload expects you to resupply all options used in the mapping. As the
> LUKS payload starts with an offset into the underlying block device,
> not supplying --offset to reload will trash the partition for sure.
> 
> So either we change the semantics of reload to retain existing options
> (so not supplying --offset does not reset the offset of the mapping
> back to zero), or we create something special for LUKS. luksReload?
> Maybe not.

If it's possible to modify the reload command to work for both plain
dm-crypt and LUKS devices, that indeed would be good. On the other side,
all current LUKS commands do have 'luks' in their name, so maybe at
least a command luksReload which is identical to reload should be
provided.

btw, i guess that the resize option is even more interesting, to support
online resizing of LUKS devices.

> I'm at the moment not sure what's wrong with resize though, I gotta
> look at that in more detail.

great, thanks a lot.

greetings,
 jonas

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux