You are not logged in.

#1 2023-05-03 09:39:26

kirth
Member
Registered: 2023-05-03
Posts: 5

Increase encrypted root partition size

Hi,
I'm quite new to Arch. Sorry for asking something already covered.
I installed the system using the provided script and did not pay enough attention to the partitions size (furthermore I made an error encrypting / instead of /home).

Anyway, I would like to increase the default 20 Gb on the root partition to at least 100 Gb.

Here there are some information about my disk and partitions:

$ sudo lsblk -o name,maj:min,rm,size,ro,type,fstype,label,mountpoint

NAME         MAJ:MIN RM  SIZE RO TYPE  FSTYPE      LABEL MOUNTPOINT
zram0        253:0    0    4G  0 disk                    [SWAP]
nvme0n1      259:0    0  1.8T  0 disk                    
├─nvme0n1p1  259:1    0  200M  0 part  vfat              /boot
├─nvme0n1p2  259:2    0 19.8G  0 part  crypto_LUKS       
│ └─cryptlvm 254:0    0 19.8G  0 crypt ext4              /
└─nvme0n1p3  259:3    0  1.8T  0 part  ext4              /home
$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 980 PRO 2TB                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1a07cf75

Device         Boot    Start        End    Sectors  Size Id Type
/dev/nvme0n1p1 *        6144     415743     409600  200M  c W95 FAT32 (LBA)
/dev/nvme0n1p2        421888   41943039   41521152 19.8G 83 Linux
/dev/nvme0n1p3      41943040 3907028991 3865085952  1.8T 83 Linux
$ sudo parted /dev/nvme0n1 unit s print

Model: Samsung SSD 980 PRO 2TB (nvme)
Disk /dev/nvme0n1: 3907029168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start      End          Size         Type     File system  Flags
 1      6144s      415743s      409600s      primary  fat32        boot, lba
 2      421888s    41943039s    41521152s    primary
 3      41943040s  3907028991s  3865085952s  primary  ext4

I booted with a LiveCD and thought I could use  GParted to perform the following:

  • cryptsetup luksOpen /dev/nvme0n1p2 cryptdisk

  • Reduce /home (/dev/nvme0n1p3) shrinking from the left approx. 80 Gb

  • Increase / (/dev/nvme0n1p2) to the right gaining those extra 80 Gb

Is this the correct way to proceed?

I'm scared to end up with a not bootable system.

Thanks a lot for your help.

Offline

#2 2023-05-03 10:35:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,255

Re: Increase encrypted root partition size

Should be fine from the methodology used but low level partitioning operations can always be hairy, make sure you have backups of stuff you need.

Offline

Board footer

Powered by FluxBB