在阿里云盘扩容过程中遇到的坑

来源:互联网 发布:罗斯福连任 知乎 编辑:程序博客网 时间:2024/05/21 10:30
三天三个后半夜的扩容历程:
1、第一天云盘创建快照
为了防止扩容过程中出现数据异常情况,可恢复数据,所以创建云盘快照!
云盘中数据已经比较大(接近400G),第一次创建快照,竟然执行了接近20小时,第一天过去了。
2、第二天卸载云盘
在云盘快照创建完成之后,凌晨起床开始执行扩容。结果第一步就被绊倒了,云盘竟然无法卸载,一直提示“umount: /2facesdisk/maindisk: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))“, 而且使用 fuser -cu /2facesdisk/maindisk ,查询不到正在使用的用户或者进程!”,挂载的服务器重启了2次,还是不行,各种查资料,尝试,咨询阿里云客服。最终还是阿里云客服给解决了,竟然是配置了开机自启(/etc/fstab配置文件,/dev/vdb2 数据盘开机挂载),然后就不能umount了。
3、第三天云盘扩容
把开机自启的命令注释掉,然后重启服务器,开始挂载。参考挂载步骤https://help.aliyun.com/document_detail/25452.html?spm=5176.doc35095.2.4.ZZ9FhY,一步步执行,但是最后执行命令e2fsck -f /dev/vdb的时候,又报错了(e2fsck 1.41.12 (17-May-2010) e2fsck: No such file or directory while trying to open /dev/vdb2 The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device>
,然后咨询客服,客服重新执行了一遍,结果可以执行了,对比执行过程,发现是忘记卸载之前挂载云盘了。
云盘挂载步骤如下:
1、重新挂载磁盘
2、卸载磁盘
3、[root@iZ25rhv3fttZ /]# fdisk /dev/vdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): p
Disk /dev/vdb: 1395.9 GB, 1395864371200 bytes 16 heads, 63 sectors/track, 2704660 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xe5e9e100 Device Boot Start End Blocks Id System /dev/vdb1 1 2704660 1363148608+ 83 Linux

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2704660, default 1):
Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-2704660, default 2704660):
Using default value 2704660
Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

e2fsck -f /dev/vdb
resize2fs /dev/vdb
使用 e2fsck 的时候由于系统需要检查并订正文件系统元数据,时间大概使用了2个多小时(数据400G,扩容后云盘1.3T)。
执行完成之后,去掉开机挂载的注释,重启服务器,挂载完成,使用df -TH查看云盘挂载情况。
0 0
原创粉丝点击