![Compute Engine 中调整磁盘大小后出现磁盘分区错误](https://linux22.com/image/775841/Compute%20Engine%20%E4%B8%AD%E8%B0%83%E6%95%B4%E7%A3%81%E7%9B%98%E5%A4%A7%E5%B0%8F%E5%90%8E%E5%87%BA%E7%8E%B0%E7%A3%81%E7%9B%98%E5%88%86%E5%8C%BA%E9%94%99%E8%AF%AF.png)
目前尝试分区磁盘时卡住了。出现一些我不明白的错误。可能超出了我的理解范围。我的问题在下面。
已使用 GCP/Compute Engine 磁盘管理器调整磁盘大小。从 80 调整为 200
尝试使用以下方式划分空间本指南,我遇到了一个令我害怕的障碍,例如;
[brentfm@whm ~]$ df -h /dev/sdb
df: ‘/dev/sdb’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb1
df: ‘/dev/sdb1’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb2
df: ‘/dev/sdb2’: No such file or directory
现在我很担心。以下是我所做的以及我目前的情况:
(parted) sudo resize2fs /dev/sda1^Z
[1]+ Stopped sudo parted /dev/sda
[brentfm@whm ~]$ sudo df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 2.6G 0 2.6G 0% /dev
tmpfs tmpfs 2.6G 8.0K 2.6G 1% /dev/shm
tmpfs tmpfs 2.6G 273M 2.4G 11% /run
tmpfs tmpfs 2.6G 0 2.6G 0% /sys/fs/cgroup
/dev/sda2 xfs 80G 75G 5.4G 94% /
/dev/sda1 vfat 200M 12M 189M 6% /boot/efi
/dev/loop0 ext4 2.5G 16M 2.3G 1% /tmp
tmpfs tmpfs 531M 0 531M 0% /run/user/1002
[brentfm@whm ~]$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
└─sda2 8:2 0 79.8G 0 part /
loop0 7:0 0 2.5G 0 loop /home/virtfs/bigislandfun/var/tmp
[brentfm@whm ~]$ resizepart
Usage:
resizepart <disk device> <partition number> <length>
Options:
-h, --help display this help and exit
-V, --version output version information and exit
For more details see resizepart(8).
[brentfm@whm ~]$ sudo parted /dev/sda2
GNU Parted 3.1
Using /dev/sda2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Partition number? 2
Error: Partition doesn't exist.
(parted) resizepart
Partition number? 1
End? [85.7GB]? quit
Error: Invalid number.
(parted) resizepart
Partition number? 2
Error: Partition doesn't exist.
(parted) resizepart
Partition number? 1
End? [85.7GB]? 100%
(parted) quit
Information: You may need to update /etc/fstab.
[brentfm@whm ~]$ sudo sgdisk --move-second-header /dev/sda
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[brentfm@whm ~]$ sudo partprobe /dev/sda
[brentfm@whm ~]$ sudo xfs_growfs -d /
meta-data=/dev/sda2 isize=512 agcount=17, agsize=1297792 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=20919820, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data size unchanged, skipping
[brentfm@whm ~]$ df -h /dev/sdb
df: ‘/dev/sdb’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb1
df: ‘/dev/sdb1’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb2
df: ‘/dev/sdb2’: No such file or directory
[brentfm@whm ~]$
问题:我是不是完蛋了?我应该重启服务器还是运行更多命令?如果有人能分享一篇知识库文章或几个解决此问题的步骤,我将不胜感激。我不确定这里的赏金是如何运作的,但我也愿意为解决方案付费。非常感谢!