我在 Azure 中运行 Ubuntu VM,无法通知操作系统分区表更改。
az@prep-vm:~$ sudo parted /dev/sdb --script mklabel gpt mkpart xfspart xfs 0% 100%
az@prep-vm:~$ sudo partprobe /dev/sdb1
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdb1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
看起来该分区也没有被UUID
分配,只有一个PARTUUID
.
- 该磁盘是全新的 Azure 托管磁盘
- 磁盘已卸载。我只是把它分区了。
az@prep-vm:~$ sudo blkid
/dev/sda1: LABEL="dataDisk0" UUID="1d9c715f-b2b3-4988-8006-0e645960019b" TYPE="ext4" PARTUUID="4994e7f9-01"
/dev/sdc1: LABEL="cloudimg-rootfs" UUID="f89a10d0-2ae6-4411-9086-8ccd221055fd" TYPE="ext4" PARTUUID="b08788dd-af4a-4015-b7b0-f7b53b252ddd"
/dev/sdc15: LABEL="UEFI" UUID="C4E4-E7F8" TYPE="vfat" PARTUUID="12798101-40c7-4dfe-8b16-58d8522bbbc0"
/dev/sdd1: UUID="9fb76aec-c94b-4c86-9679-8445f1be4126" TYPE="ext4" PARTUUID="a96f9921-01"
/dev/sdb1: PARTLABEL="xfspart" PARTUUID="64f867b6-aaab-4f3f-9c7d-f8c8ebcb0752"
/dev/sdc14: PARTUUID="85d4d288-d841-4236-95ec-ca2bdb14f611"
我计划将分区的 UUID 添加到 fstab 中,以便在启动时安装它。
这以前从来都不是问题。我尝试过重新启动计算机、从头开始重新创建磁盘+重新分区、从快照创建全新的虚拟机,但我一直遇到这个问题。我是一个 Linux 新手,一直在谷歌搜索/SO'ing,但我读到的所有内容都表明重新启动可以解决问题,但事实并非如此。我还检查过,我的发行版没有新版本的parted/partprobe。不知道还能去哪里。
操作系统信息:
az@prep-vm:~$ uname -r
5.4.0-1085-azure
az@prep-vm:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic