我正在尝试为添加空间/dev/mapper/fedora-root
。我可以运行lvextend
并成功添加额外的空间,但是似乎并没有实际添加它以使其可用。
具体来说,/var/www/
在我需要所有空间的站点上,我有15G可用空间。
我在安装了fedora-root的驱动器上有多余的空间,在第二个驱动器上还有2TB的空间可以使用。但是,无论何时我增加空间,它都保持在15G。
以下是一些可能有用的命令的输出:
$ 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
再次运行'sudo df -h'会得到:
$ 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 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
要使空间可用,您需要使用xfs_growfs
命令,因为逻辑卷上的文件系统是xfs
。
xfs_growfs /
如果它是ext2,ext3或ext4,则可以使用resize2fs
该名称。
编辑:在Fedora和RHEL 8和CentOS 8的最新版本中似乎已更改。使用lv / block设备可在RHEL 7和CentOS 7中使用,但是您需要在使用OS时使用安装点该实用程序的更高版本。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句