When you have a raw disk image file, you may need to increase its size at some point. With dd, you can do this:
dd conv=notrunc oflag=append if=/dev/zero of=backups bs=1M count=1024
This will add 1GB of zero data to the image file ‘backups’. You can then use resize2fs on it to increase the file system size (that is, if you use ext2/3/4):
e2fsck (-f) backups resize2fs backups
However, if the disk image is a volume encrypted with cryptsetup + luks, first open it:
losetup /dev/loop/0 backups cryptsetup luksOpen /dev/loop/0 encrypted-backups
Then resize the encrypted volume:
cryptsetup resize encrypted-backups e2fsck (-f) /dev/mapper/encrypted-backups resize2fs /dev/mapper/encrypted-backups
And I know, I still have to add LVMs to my set of skills…
Recent Comments