1

I'm trying to add space to /dev/mapper/fedora-root. I can run lvextend and successfully add additional space, but it doesn't seem to actually add it to be usable.

Specifically I have 15G usable on my site at /var/www/ where I need all of my space.

I have extra space on the drive fedora-root is installed on and an additional 2tb of space to use on a second drive. But anytime I add space it stays at 15G.

Here are the outputs of some commands that may be useful:

$ sudo df -h

Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                  24G     0   24G   0% /dev
tmpfs                     24G  8.0K   24G   1% /dev/shm
tmpfs                     24G  1.5M   24G   1% /run
/dev/mapper/fedora-root   15G   14G  1.5G  91% /
tmpfs                     24G  4.0K   24G   1% /tmp
/dev/sda1               1014M  224M  791M  22% /boot
tmpfs                    4.8G     0  4.8G   0% /run/user/1000
tmpfs                    4.8G     0  4.8G   0% /run/user/0

$ sudo vgdisplay -v

  --- Volume group ---
  VG Name               fedora
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  12
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               2.08 TiB
  PE Size               4.00 MiB
  Total PE              546110
  Alloc PE / Size       11235 / <43.89 GiB
  Free  PE / Size       534875 / 2.04 TiB
  VG UUID               lgfK0B-loTg-wQlS-dtsR-qWZJ-Hqh6-SkWk55

  --- Logical volume ---
  LV Path                /dev/fedora/swap
  LV Name                swap
  VG Name                fedora
  LV UUID                81zkKH-IeMO-gcoO-O9DX-7w7G-4a1i-lw2dhy
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-11-24 17:33:39 -0500
  LV Status              available
  # open                 2
  LV Size                <23.64 GiB
  Current LE             6051
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/fedora/root
  LV Name                root
  VG Name                fedora
  LV UUID                e9fRu0-FupO-8e6V-fodF-ZPQ5-alBK-XVutVM
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-11-24 17:33:40 -0500
  LV Status              available
  # open                 1
  LV Size                20.25 GiB
  Current LE             5184
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Physical volumes ---
  PV Name               /dev/sda2
  PV UUID               AdC6bu-ct2C-dP0k-TRM8-PZ7z-vYDj-tN5jGn
  PV Status             allocatable
  Total PE / Free PE    69439 / 58204

  PV Name               /dev/sdb1
  PV UUID               n6tBpo-ce7D-MCZR-GFKY-BsHW-pcmG-FmM3Wo
  PV Status             allocatable
  Total PE / Free PE    476671 / 476671

$ sudo lvextend -l+288 /dev/mapper/fedora-root

  Size of logical volume fedora/root changed from 20.25 GiB (5184 extents) to <21.38 GiB (5472 extents).
  Logical volume fedora/root successfully resized.

$ sudo fdisk -l

Disk /dev/sda: 272.26 GiB, 292326211584 bytes, 570949632 sectors
Disk model: PERC 6/i
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: 0xdf465195

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   2099199   2097152     1G 83 Linux
/dev/sda2       2099200 570949631 568850432 271.3G 8e Linux LVM


Disk /dev/sdb: 1.84 TiB, 1999307276288 bytes, 3904897024 sectors
Disk model: PERC 6/i
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: 0x8e545053

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1        2048 3904897023 3904894976  1.8T 8e Linux LVM


Disk /dev/mapper/fedora-root: 21.38 GiB, 22951231488 bytes, 44826624 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: 23.65 GiB, 25379733504 bytes, 49569792 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

Run 'sudo df -h' again gets:

    $ sudo df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                  24G     0   24G   0% /dev
tmpfs                     24G  8.0K   24G   1% /dev/shm
tmpfs                     24G  1.5M   24G   1% /run
/dev/mapper/fedora-root   15G   14G  1.5G  91% /
tmpfs                     24G  4.0K   24G   1% /tmp
/dev/sda1               1014M  224M  791M  22% /boot
tmpfs                    4.8G     0  4.8G   0% /run/user/1000
tmpfs                    4.8G     0  4.8G   0% /run/user/0

EDIT: $ sudo lsblk -f

NAME            FSTYPE      LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1          xfs               59ff08c1-39e5-4cdd-87a8-d51d7aead2e5      791M    22% /boot
└─sda2          LVM2_member       AdC6bu-ct2C-dP0k-TRM8-PZ7z-vYDj-tN5jGn
  ├─fedora-root xfs               cd4163ba-8b53-48db-bd30-32802f4bd3a0      1.4G    91% /
  └─fedora-swap swap              2de89191-34eb-4439-81a8-2f879d917821                  [SWAP]
sdb
└─sdb1          LVM2_member       n6tBpo-ce7D-MCZR-GFKY-BsHW-pcmG-FmM3Wo
  • Add the output of lsblk -f to your question. – Nasir Riley Nov 25 '19 at 8:54
  • Added it at the end. – RobertW Nov 25 '19 at 8:58
4

To make the space available, you need to use the xfs_growfs command as the filesystem on your logical volume is xfs.

xfs_growfs /

If it were ext2, ext3, or ext4, then you'd use resize2fs with the name.

EDIT: It appears to have been changed in its latest release for Fedora and RHEL 8 and CentOS 8. Using the lv/block device works in RHEL 7 and CentOS 7 but you'll need to use the mountpoint for your OS as it is using a later version of the utility.

  • I get "xfs_growfs: /dev/mapper/fedora-root is not a mounted XFS filesystem" while using this. – RobertW Nov 25 '19 at 9:32
  • @RobertW See my edit. Using the lvname works in earlier versions of xfs_growfs with previous releases of Fedora, RHEL, and CentOS but the newer version requires the mountpoint. – Nasir Riley Nov 25 '19 at 9:47
  • I just used your edit. It worked, thank you! I couldn't find that anywhere. – RobertW Nov 25 '19 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.