root@machinename:/dev/mapper# pvchange --uuid /dev/mapper/ubuntu--vg-ubuntu--lv
Failed to find physical volume "/dev/ubuntu-vg/ubuntu-lv".
0 physical volumes changed / 0 physical volumes not changed
Ubuntu 服务器已安装,文件系统已配置为 lvm。此服务器是从另一台服务器克隆的。
root@machinename:/dev/mapper# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 391M 2.2M 388M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 48G 5.3G 41G 12% /
tmpfs 2.0G 4.0K 2.0G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop0 94M 94M 0 100% /snap/core/9066
/dev/loop1 90M 90M 0 100% /snap/core/8268
/dev/sda2 976M 145M 764M 16% /boot
/dev/sda1 511M 6.1M 505M 2% /boot/efi
tmpfs 391M 0 391M 0% /run/user/1000
我确实在 Google 上搜索了一下,但找不到快速解决方案。有人有想法吗?谢谢
答案1
根据man pvchange
您的需要在-command中指定一个物理设备(例如/dev/sda3
)pvchange
,而不是像这样的逻辑卷/dev/mapper/ubuntu--vg-ubuntu--lv
。
Synopsis
pvchange [--addtag Tag] [-A|--autobackup {y|n}] [-d|--debug] [-f|--force]
[--deltag Tag] [--metadataignore {y|n}] [-h|-?|--help] [-t|--test]
[-v|--verbose] [-a|--all] [-x|--allocatable {y|n}] [-u|--uuid]
[PhysicalVolumePath...]
-u, --uuid
Generate new random UUID for specified physical volumes.
Example
Disallows the allocation of physical extents on this physical volume (possibly
because of disk errors, or because it will be removed after freeing it:
pvchange -x n /dev/sdk1