我是 Rocky Linux 的新手。当我安装 Rocky Linux 时,我将分区配置为 LVM。我可以说它有效,因为当我运行时fdisk -l
我得到了我需要的东西:
[user@localhost ~]$ sudo fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VBOX HARDDISK
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: 0x85c3ed59
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 41943039 39843840 19G 8e Linux LVM
Disk /dev/mapper/rl-root: 17 GiB, 18249416704 bytes, 35643392 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/rl-swap: 2 GiB, 2147483648 bytes, 4194304 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 bash -c "pvs && vgs && lvs"
或者甚至只是
sudo pvs
sudo vgs
sudo lvs
我根本就什么也没得到。
我尝试过了:
[user@localhost ~]$ sudo lvmdevices --update
No update for devices file is needed.
而且我也取消了use_devicesfile = 1
中的“ ”的注释/etc/lvm/lvm.conf
,但这没有帮助。
此外,这很奇怪但是:
[user@localhost ~]$ sudo systemctl start lvm2
Failed to start lvm2.service: Unit lvm2.service not found.
那么我的 Rocky Linux 有什么问题?
更新:似乎当我取消注释use_devicesfile
并将其设置为 0像这儿它突然返回了我的pvs && vgs && lvs
正确数据 - 但是我不确定这是否是一个解决方案,因为我看到另一个问题也没有解决方案......:
[user@localhost ~]$ sudo bash -c "pvs&&vgs&&lvs"
PV VG Fmt Attr PSize PFree
/dev/sda2 rl lvm2 a-- <19.00g 0
VG #PV #LV #SN Attr VSize VFree
rl 1 2 0 wz--n- <19.00g 0
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rl -wi-ao---- <17.00g
swap rl -wi-ao---- 2.00g
洛奇 9.1 64 位
对于@davidgo:
[user@localhost ~]$ sudo vgscan -y
Found volume group "rl" using metadata type lvm2
[user@localhost ~]$ sudo lvscan -ay
ACTIVE '/dev/rl/swap' [2.00 GiB] inherit
ACTIVE '/dev/rl/root' [<17.00 GiB] inherit
[user@localhost ~]$ sudo bash -c "pvs && vgs && lvs"
PV VG Fmt Attr PSize PFree
/dev/sda2 rl lvm2 a-- <19.00g 0
VG #PV #LV #SN Attr VSize VFree
rl 1 2 0 wz--n- <19.00g 0
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rl -wi-ao---- <17.00g
swap rl -wi-ao---- 2.00g