You are not logged in.
Hello,
I have a root filesystem encrypted with luks1 and and I need to resize and move it to the right in order to grow my boot partition. How can I proceed ?
# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0 squashfs 4.0 0 100% /var/lib/snapd/snap/core20/2379
loop1 squashfs 4.0 0 100% /var/lib/snapd/snap/core20/2434
loop2 squashfs 4.0 0 100% /var/lib/snapd/snap/snapd/23258
loop3 squashfs 4.0 0 100% /var/lib/snapd/snap/snapd/23545
nvme0n1
├─nvme0n1p1 vfat FAT32 AC41-B686 133,4M 56% /boot
├─nvme0n1p2 crypto_LUKS 1 87550b66-7982-4503-9dec-c23d015351ce
│ └─luks-87550b66-7982-4503-9dec-c23d015351ce ext4 1.0 4604eb05-9aeb-453f-9cd2-6d6e6f30ee9f 663,2G 59% /
└─nvme0n1p3 crypto_LUKS 1 1676a75f-b260-453c-890d-75ccaec3292b
└─luks-1676a75f-b260-453c-890d-75ccaec3292b swap 1 swap d463e634-4e5a-4ca3-9de7-297df5e0ac08 [SWAP]
# cryptsetup status /dev/mapper/luks-87550b66-7982-4503-9dec-c23d015351ce
/dev/mapper/luks-87550b66-7982-4503-9dec-c23d015351ce is active and is in use.
type: LUKS1
cipher: aes-xts-plain64
keysize: 512 bits
key location: dm-crypt
device: /dev/nvme0n1p2
sector size: 512
offset: 4096 sectors
size: 3928465583 sectors
mode: read/write
flags: discards
Offline
I would leave the partition where it is and instead relocate /boot to the end of disk. It's not necessary to shuffle around 600+GB of data, risking data loss in the process.
Otherwise do a full backup and then just set it up from scratch. Probably faster to copy files anyways (since that filesystem is 50% empty).
Offline
True, moving /boot to then end of disk sounds safer than moving data around. Yet I have no free space at the end of disk. What tool should I use ? resize2fs and cryptsetup resize ? I just don't know what's the sequence there.
Offline
another option is not needing a larger boot.
I use 1GB for boot and never care about that. but sometimes i get employer machines with those small /boot and have to set it up for 1) compress initramfs https://wiki.archlinux.org/title/Mkinitcpio#COMPRESSION and 2) remove fallback and other things https://bbs.archlinux.org/viewtopic.php … 5#p2154175
Offline
How big is your swap partition?
If it is big enough, you may be able to skim off a few hundred MBs from it to create a /boot partition at the end of the disk, as frostschutz suggested. It is a lot easier resizing or even recreating the swap partition.
Another option is to totally do away with the swap partition, then create a swap file in your root partition to take its place. This should free up more than enough space at the end of the disk.
Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.
Offline
I workaround this by changing the initramfs compression to default: zstd, so I can now fit 2 initramfs in boot but this solution won't last long as there's now only 20Mb left on the boot partition. For now I am good.
My swap partition is 34Gb.
If I need more space I'll consider either removing the fallback images or moving my boot partition to end of disk after swap. Thanks for your help.
Offline