1

I am running Fedora 30 (new to this distro), and can't seem to use all the available space on an encrypted partition. There are only two partitions of sda for a total of 300GB, 1 with 1GB and 2 299GB, with 1 being boot and 2 being everything else. sda2 is encrypted and was setup with LVM.

When running df -h I can see the sizes that are allocated to each directory:

Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 7.9G     0  7.9G   0% /dev
tmpfs                    7.9G   72M  7.8G   1% /dev/shm
tmpfs                    7.9G  9.2M  7.9G   1% /run
tmpfs                    7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/mapper/fedora-root   15G   13G  2.1G  87% /
tmpfs                    7.9G   24K  7.9G   1% /tmp
/dev/sda1                976M  167M  742M  19% /boot
tmpfs                    1.6G   52K  1.6G   1% /run/user/1000

Looking in gparted I can see that all 299GB are allocated to the sda2 partition. Also seen in /dev/mapper is a luk directory, and I know that that is related to the disk-encryption but I'm not sure how.

fdisk -l output:

Disk /dev/sda: 300 GiB, 322122547200 bytes, 629145600 sectors
Disk model: Virtual disk    
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: 0x18ffed28

Device     Boot   Start       End   Sectors  Size Id Type
/dev/sda1  *       2048   2099199   2097152    1G 83 Linux
/dev/sda2       2099200 629145599 627046400  299G 83 Linux


Disk /dev/mapper/luks-1a41761b-c234-4fee-9c8d-5464c79c71d9: 299 GiB, 321030979584 bytes, 627013632 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/fedora-root: 15 GiB, 16106127360 bytes, 31457280 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/fedora-swap: 7.9 GiB, 8497659904 bytes, 16596992 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

I have also tried using lvextend/resize2fs to give more storage to /dev/mapper/fedora-root without success.

Please let me know what I am doing wrong, or am misunderstanding about this process or what is happening here. Thank you for your help!

EDIT

vgs and lvs ouputs by request of a deleted comment. Volume sizes are a little messed up from some experimentation but same situation as before.

VG     #PV #LV #SN Attr   VSize   VFree  
  fedora   1   2   0 wz--n- 298.98g <54.07g
  LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
root fedora -wi-ao---- 237.00g                                                    
swap fedora -wi-ao----   7.91g
Techaeth
  • 13
  • 4

1 Answers1

0

Disclaimer: better do backups before performing potentially dangerous operations, like resizing a filesystem for the first time.

Your fedora-root LV has a size of 237.00g, but your / filesystem has a size of 15g. This means that the very last step to increase available size was not done.

For an xfs filesystem, to use all available partition or LV space that would simply be:

# xfs_growfs /

In case the default xfs wasn't chosen, each filesystem has its own specific method to increase its size. For example, with an ext4 filesystem that would be instead:

# resize2fs /dev/mapper/fedora-root

Both are working (or must be done) online. Be warned that xfs can't be shrunk back at all and that ext4 can't be shrunk online, only offline which is quite difficult for the root filesystem.

For an other time: the lvresize command has a --resizefs option which can perform both actions in a single command.

A.B
  • 11,090
  • 2
  • 24
  • 45
  • Thanks A.B! xfs_growfs was what I needed to extend the volume for the directories. – Techaeth Oct 19 '19 at 19:17
  • @Techaeth that is more accurately: to extend the filesystem to fit and use all the available space in the logical volume containing it. – A.B Oct 19 '19 at 22:45