User Tools

Site Tools


docs:tips_n_tricks:luks.html

LUKS

Resize an encrypted LV managed by cryptsetup

While it is seems to be quiet obvious for most people 1) how to resize any stack of LUKS, ext2,3,4, LVM, MSDOS or GPT partitions, it becomes strange if you're using Ubuntus package cryptsetup 2)

~ # lvresize -L 22.5G /dev/vg_sys/lv_home
~ # cryptsetup resize home
~ # resize2fs /dev/mapper/home
resize2fs 1.42.10 (18-May-2014)
resize2fs: Device or resource busy while trying to open /dev/mapper/home
Couldn't find valid filesystem superblock.
~ # mount | fgrep home  
/dev/mapper/home_unformatted on /home type ext3 (rw,relatime,data=ordered)
~ # resize2fs /dev/mapper/home_unformatted
resize2fs 1.42.10 (18-May-2014)
open: No such file or directory while opening /dev/mapper/home_unformatted
~ #

The remedy is simple:

dmsetup rename home home_unformatted
resize2fs /dev/mapper/home_unformatted
dmsetup rename home_unformatted home 

Linux LVM LUKS cryptsetup resize2fs

Prepare for low memory systems

Get current memory need:

cryptsetup luksDump /dev/<device> | fgrep Memory

Set new memory need:

cryptsetup luksConvertKey --key-file /path/to/keyfile --pbkdf-memory=10240 /dev/<device>

References:

Gnome Keyring

Not exactly LUKS related, but shows up in the context

Reset LUKS password accidently stored "forever"

Change default answer to LUKS password question (e.g.) in Thunar

List all available secrets

Um .. aeh … really 8-O

apt install libsecret-1-dev
git clone https://gitlab.com/GrantMoyer/lssecret.git
cd lssecret
make
DESTDIR=/usr/local/lssecret make install
ln -s ../lssecret/bin/lssecret /usr/local/bin
lssecret -s

References:

2)
Meaning, if you are using /etc/crypttab and cryptdisks_(start|stop) for automatic handling of mounts
docs/tips_n_tricks/luks.html.txt · Last modified: 21.08.2022 19:06 CEST by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki