Score:0

LUKS partition much larger than filesystem (LVM)

so flag

I recently installed Ubuntu on a laptop with 256 GB SSD. I chose the recommended layout (use entire disk) and selected LUKS, but although the installer created a sufficiently large partition –

jan:~$ sudo lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                           8:0    0 238.5G  0 disk  
├─sda1                        8:1    0     1G  0 part  /boot/efi
├─sda2                        8:2    0     2G  0 part  /boot
└─sda3                        8:3    0 235.4G  0 part  
  └─dm_crypt-0              253:0    0 235.4G  0 crypt 
    └─ubuntu--vg-ubuntu--lv 253:1    0   100G  0 lvm   /var/snap/firefox/common/host-hunspell
                                                       /

– the LVM size is only 100G:

jan:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              781M  2.2M  779M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   98G   26G   68G  28% /
tmpfs                              3.9G   28K  3.9G   1% /dev/shm
tmpfs                              5.0M  4.0K  5.0M   1% /run/lock
/dev/sda2                          2.0G  134M  1.7G   8% /boot
/dev/sda1                          1.1G  5.3M  1.1G   1% /boot/efi
tmpfs                              781M  2.4M  779M   1% /run/user/1000

Why is the ubuntu volume much smaller than possible, and can I safely use resize2fs to use the remaining space in the sda3 partition?

Thanks, Jan

Anders F. U. Kiær avatar
in flag
You med to resize the lvm volume then you can resize the filesystem.
Score:0
so flag

Thanks, Anders, I followed these instructions to resize the LVM volume and then the filesystem:

sudo lvresize -t -v -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv # with test flag (-t)
sudo lvresize -v -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv # remove -t after successful test
sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.