Partitioning unallocated space on encrypted RootFS Partition

radart

Member
Sep 30, 2020
2
0
21
71
Hi there!
I managed to install Proxmox-VE over Debian Bullseye (encrypted BTRFS) including unlocking the crypto-device at bootup over ssh/initramfs. When I installed Debian I chose to make the "root" Partition/Volume inside the Encrypted partition around 100GB. I think ProxmoxVE dosen't need more. I planned to use the remaining 400GB for LX-Container and VM.

Now in Proxmox I would want to know how to allocate/partition the remaining non-partitioned/unallocated 400 GB under "sda3_crypt" so Proxmox can use it for VMs and LXC.

Following the Disk/Partition configuration:


root@server:~# fdisk -l
Code:
Disk /dev/sda: 465,76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC  WDS500G2B0B
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: gpt
Disk identifier: 084C16D0-24F4-4855-82EE-38A2FD7C9C4A

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda2  1050624   2050047    999424   488M Linux filesystem
/dev/sda3  2050048 976771071 974721024 464,8G Linux filesystem


Disk /dev/mapper/sda3_crypt: 464,77 GiB, 499040387072 bytes, 974688256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/server--vg-root: 92,18 GiB, 98972991488 bytes, 193306624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/server--vg-swap_1: 976 MiB, 1023410176 bytes, 1998848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


root@server:~# df -h
Code:
Dateisystem               Größe Benutzt Verf. Verw% Eingehängt auf
udev                       3,8G       0  3,8G    0% /dev
tmpfs                      778M    1,9M  776M    1% /run
/dev/mapper/server--vg-root   93G    4,6G   87G    6% /
tmpfs                      3,8G     19M  3,8G    1% /dev/shm
tmpfs                      5,0M       0  5,0M    0% /run/lock
/dev/sda2                  471M    125M  321M   29% /boot
/dev/sda1                  511M    3,5M  508M    1% /boot/efi
/dev/fuse                  128M     16K  128M    1% /etc/pve
tmpfs                      778M       0  778M    0% /run/user/0


root@server:~# lsblk
Code:
NAME                  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                     8:0    0 465,8G  0 disk 
├─sda1                  8:1    0   512M  0 part  /boot/efi
├─sda2                  8:2    0   488M  0 part  /boot
└─sda3                  8:3    0 464,8G  0 part 
  └─sda3_crypt        253:0    0 464,8G  0 crypt
    ├─server--vg-root   253:1    0  92,2G  0 lvm   /
    └─server--vg-swap_1 253:2    0   976M  0 lvm   [SWAP]
mmcblk0               179:0    0  14,7G  0 disk 
mmcblk0boot0          179:8    0     4M  1 disk 
mmcblk0boot1          179:16   0     4M  1 disk

root@server:~# lsblk -f
Code:
NAME                  FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                                   
├─sda1                vfat        FAT32          C495-ACCB                               507,6M     1% /boot/efi
├─sda2                ext2        1.0            5d61b6aa-9252-423c-bec5-9f1d8fa211bb      321M    27% /boot
└─sda3                crypto_LUKS 2              9e9812a3-e969-4e8d-9b59-a52bcb856f62                 
  └─sda3_crypt        LVM2_member LVM2 001       0ig9XQ-euIA-tcdR-rj8d-TwX3-H53v-vcu29M               
    ├─server--vg-root   btrfs                      20d939b6-dcf0-4004-b309-72e96a605415     86,6G     5% /
    └─server--vg-swap_1 swap        1              d7856031-4eff-4ffe-b0cf-9d6946b27ab2                  [SWAP]


Thank you ver much for your help in advance.
Have a nice day!
 
Hi,
if I'm not mistaken, your sda3_crypt is managed by LVM, so you can add the volume group server-vg as an LVM storage, see here or an LVM Thin Pool, see here. I'd recommend using a thin pool, which is what a default Proxmox VE installation sets up as well.