Pvdisply command get nothing,how could extend lvm on fedora server 40

I install fedora 40 server on my PC, when I do mount command, I can see the

/dev/mapper/fedora-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)

When I do command fastfetch, I can see the default xfs size is 15GB

Disk (/): 6.90 GiB / 14.94 GiB (46%) - xfs

When I want to extend lvm, I do command with pvdisplay

simon@localhost:~$ sudo pvdisplay
[sudo] password for simon:
simon@localhost:~$

there is nothing with lv print, how could this happen ?
besides, the command of fdisk -l

simon@localhost:~$ sudo fdisk -l
[sudo] password for simon:
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WD Green 2.5 100
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

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    1230847    1228800   600M EFI System
/dev/sda2  1230848    3327999    2097152     1G Linux extended boot
/dev/sda3  3328000 1953523711 1950195712 929.9G Linux LVM

there are 3 commands to show status of LVM volumes.
pvdisplay, vgdisplay, and lvdisplay

If you are using lvm those commands should show the status. If they show no results then you are probably not using lvm.
This is the result on one of my drives using lvm

$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/nvme0n1p3
  VG Name               fedora_root
  PV Size               <1.82 TiB / not usable 1.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              476634
  Free PE               308698
  Allocated PE          167936
  PV UUID               l81PQ1-jP4v-u4jv-mXAN-B7dy-X0Tf-SOaUr5

$ sudo vgdisplay
  --- Volume group ---
  VG Name               fedora_root
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  13
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <1.82 TiB
  PE Size               4.00 MiB
  Total PE              476634
  Alloc PE / Size       167936 / 656.00 GiB
  Free  PE / Size       308698 / <1.18 TiB
  VG UUID               xmenYq-jSk3-9JhA-zOLL-Q2rj-QbK0-7AGCaT

If yours does not show similar then it would appear you are not using lvm for disk management.

That would make what you show with fdisk suspect.

$ sudo fdisk -l

Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: CT2000P5PSSD8                           
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: 2072D08C-637C-4B03-A3D9-121E741E5EDC

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048     688127     686080  335M EFI System
/dev/nvme0n1p2  688128    2441215    1753088  856M Linux extended boot
/dev/nvme0n1p3 2441216 3907028991 3904587776  1.8T Linux LVM

Note that mangement of xfs file systems is different than with ext4. Read up on the differences. As I understand it the xfs file system may be expanded but cannot be shrunk except by backing up the data then removing the old partition to create a new one and restoring to the new smaller partition.

I also understand that to expand the file system requires two steps. First expand the lvm LV without touching the file system. Then expand the file system to fill the new partition size. LVM can do both in one command with ext4 but seems unable to resize the xfs file system.

pvdisplay , vgdisplay , and lvdisplay these commands both with no display.
but as you can see when I do mount command, I can get / just mount on
/dev/mapper/fedora-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)

LUKS Group doesn't show up - #2 by vtrefny

1 Like

thanks, after I do sudo lvmdevices --adddev /dev/sda3, then I do pvdislpay, I can see the lvm info.

[sudo] password for simon:
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               fedora
  PV Size               <929.93 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              238060
  Free PE               183020
  Allocated PE          55040
  PV UUID               3eeckx-7vb8-OnLu-Fcl6-vXGR-q31J-XBWjgL

besides, I extend / success with command sudo lvextend -L +200G --resizefs /dev/fedora/root

1 Like

Did that extend the xfs file system as well as the LV? Or did it extend the LV without also extending the file system inside the LV?

The command lvdisplay should show the size of the LV.
df -h should show the file system info. If the size column in the df output does not match the LV Size from lvdisplay then you may need to manually extend the file system to the full size of the LV.

yeah, it extend the LV too. I do lvdisplay and df -h

▸ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/fedora/root
  LV Name                root
  VG Name                fedora
  LV UUID                lFmR7q-hsUl-ks6J-4OIi-GQjZ-MJBV-Yqceu5
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2024-11-10 21:59:51 +0800
  LV Status              available
  # open                 1
  LV Size                215.00 GiB
  Current LE             55040
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
▸ sudo df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/fedora-root  215G   90G  126G  42% /
devtmpfs                 4.0M     0  4.0M   0% /dev
tmpfs                     16G     0   16G   0% /dev/shm
efivarfs                 192K  136K   52K  73% /sys/firmware/efi/efivars
tmpfs                    6.3G  1.8M  6.3G   1% /run
tmpfs                     16G  103M   16G   1% /tmp
/dev/sda2                960M  314M  647M  33% /boot
/dev/sda1                599M  7.5M  592M   2% /boot/efi
tmpfs                    3.2G   52K  3.2G   1% /run/user/1000

both of them extend with +200GB.

1 Like