[Pkg-cryptsetup-devel] Bug#428288: online resize a luks device

Jonas Meurer jonas at freesources.org
Mon Mar 17 15:31:45 UTC 2008


Hey Enrico,

cryptsetup reload indeed seems to trash luks devices. Thus the next
cryptsetup release will have this option disabled for luks devices.

But I don't understand why your attempt to use 'cryptsetup resize'
didn't work. For me it works perfectly well:

# lvcreate -L300M -n test vg00
# cryptsetup luksFormat /dev/vg00/test 
# cryptsetup luksOpen /dev/vg00/test test1
# mke2fs -j /dev/mapper/test1 

and now the interesting part:

# mount /dev/mapper/test1 /mnt/
# df -h /dev/mapper/test1 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/test1     291M  6.1M  270M   3% /mnt

# lvresize -L+100M /dev/vg00/test 
  Extending logical volume test to 400.00 MB
  Logical volume test successfully resized

# cryptsetup resize test1 
# resize2fs /dev/mapper/test1 
resize2fs 1.40.8 (13-Mar-2008)
Filesystem at /dev/mapper/test1 is mounted on /mnt; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/mapper/test1 to 409084 (1k) blocks.
The filesystem on /dev/mapper/test1 is now 409084 blocks long.

# df -h /dev/mapper/test1 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/test1     388M  6.3M  362M   2% /mnt


so for me online resizing of luks partitions works quite well. could you
verify that it doesn't for you?

greetings,
 jonas





More information about the Pkg-cryptsetup-devel mailing list