gpt4 book ai didi

Linux CENTOS7 LVM

转载 作者:太空宇宙 更新时间:2023-11-04 05:36:35 25 4
gpt4 key购买 nike

这是我的 df -kh 的输出

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 34G 17G 67% /
devtmpfs 2.5G 0 2.5G 0% /dev
tmpfs 2.5G 140K 2.5G 1% /dev/shm
tmpfs 2.5G 8.9M 2.5G 1% /run
tmpfs 2.5G 0 2.5G 0% /sys/fs/cgroup
/dev/sda1 497M 133M 365M 27% /boot

我想将/的大小增加 194 GB。

我运行了命令 lvextend -L +194G/dev/mapper/centos-root我收到消息说文件系统已调整大小。我重新启动了系统。我期望看到我的/为 244GB。然而事实并非如此

卷组详细信息

[root@localhost mapper]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 249.51 GiB
PE Size 4.00 MiB
Total PE 63874
Alloc PE / Size 63648 / 248.62 GiB
Free PE / Size 226 / 904.00 MiB
VG UUID icZPDf-z0cO-5qMl-Gbtr-XisU-6ptl-cpG3dz

逻辑卷详细信息

[root@localhost mapper]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID MzofJC-7I6W-XcM9-xwrT-Ns86-LdYt-OYltON
LV Write Access read/write
LV Creation host, time localhost, 2015-07-02 09:04:52 +1200
LV Status available
# open 2
LV Size 4.62 GiB
Current LE 1184
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1

--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 1J50kj-hcBC-T5rY-y6LV-0xEI-ZVId-qBfgQl
LV Write Access read/write
LV Creation host, time localhost, 2015-07-02 09:04:53 +1200
LV Status available
# open 1
LV Size 244.00 GiB
Current LE 62464
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0



/etc/fstab OUTPUT

#
# /etc/fstab
# Created by anaconda on Thu Jul 2 09:04:53 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=c4f605aa-56b0-4bde-ae0b-ddf6f0e4a983 /boot xfs defaults 0 0
#/dev/mapper/centos-home /home xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0

如何扩展/dev/mapper/centos-root?有什么帮助吗?

最佳答案

使用“lvextend -L +194G -r/dev/mapper/centos-root”代替“lvextend -L +194G/dev/mapper/centos-root”。-r 选项只需一步即可更改逻辑卷和关联的文件系统大小。此外,这适用于 ext4 和 xfs。另外,不要使用“df”,使用“lsblk”,显示更清晰。

关于Linux CENTOS7 LVM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31425467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com