阿里云数据盘挂载遇到的一些问题总结

来源:互联网 发布:自己开淘宝店赚钱吗 编辑:程序博客网 时间:2024/06/02 23:05

在上一篇文章《阿里云数据盘/硬盘挂载流程(CentOS)》中提到了阿里云主机挂载的基本流程,但在挂载的过程中也遇到一些奇葩的问题!

1、首先看一下系统信息:

[root@iZ28afd0manZ /]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00073f45    Device Boot      Start         End      Blocks   Id  System/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb (Sun disk label): 255 heads, 63 sectors, 65270 cylindersUnits = cylinders of 16065 * 512 bytes    Device Flag    Start       End    Blocks   Id  System/dev/xvdb1             0     65264 524233080   83  Linux native/dev/xvdb2  u      65264     65270     48195   82  Linux swap/dev/xvdb3             0     65270 524281275    5  Whole disk
2、格式化数据盘/dev/xvdb

[root@iZ28afd0manZ /]# mkfs.ext3 /dev/xvdbmke2fs 1.41.12 (17-May-2010)/dev/xvdb is mounted; will not make a filesystem here![root@iZ28afd0manZ /]# mkfs.ext3 /dev/xvdb1mke2fs 1.41.12 (17-May-2010)/dev/xvdb1 is apparently in use by the system; will not make a filesystem here!
3、提示/dev/xvdb已经挂载,/dev/xvdb1已经在使用中,都不允许格式化,参考https://zhidao.baidu.com/question/81665433.html的提示,需要先清除挂载才能继续格式化;

4、清除挂载1分区

[root@iZ28afd0manZ /]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00073f45    Device Boot      Start         End      Blocks   Id  System/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb (Sun disk label): 255 heads, 63 sectors, 65270 cylindersUnits = cylinders of 16065 * 512 bytes    Device Flag    Start       End    Blocks   Id  System/dev/xvdb1             0     65264 524233080   83  Linux native/dev/xvdb2  u      65264     65270     48195   82  Linux swap/dev/xvdb3             0     65270 524281275    5  Whole disk

准备清除分区/dev/xvdb1

[root@iZ28afd0manZ /]# fdisk /dev/xvdbCommand (m for help): mCommand action   a   toggle a read only flag   b   edit bsd disklabel   c   toggle the mountable flag   d   delete a partition   l   list known partition types   m   print this menu   n   add a new partition   o   create a new empty DOS partition table   p   print the partition table   q   quit without saving changes   s   create a new empty Sun disklabel   t   change a partition's system id   u   change display/entry units   v   verify the partition table   w   write table to disk and exit   x   extra functionality (experts only)Command (m for help): dPartition number (1-8): 1Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 22: Invalid argument.The kernel still uses the old table. The new table will be used atthe next reboot or after you run partprobe(8) or kpartx(8)Syncing disks.[root@iZ28afd0manZ /]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00073f45    Device Boot      Start         End      Blocks   Id  System/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb (Sun disk label): 255 heads, 63 sectors, 65270 cylindersUnits = cylinders of 16065 * 512 bytes    Device Flag    Start       End    Blocks   Id  System/dev/xvdb2  u      65264     65270     48195   82  Linux swap/dev/xvdb3             0     65270 524281275    5  Whole disk

5、至此,可看见/dev/xvdb1分区已经去除挂载,同理操作去除/dev/xvdb2和/dev/xvdb3;

6、最后得到如下情况:

[root@iZ28afd0manZ /]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00073f45    Device Boot      Start         End      Blocks   Id  System/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb (Sun disk label): 255 heads, 63 sectors, 65270 cylindersUnits = cylinders of 16065 * 512 bytes    Device Flag    Start       End    Blocks   Id  System

7、再次格式化

[root@iZ28afd0manZ /]# mkfs.ext3 /dev/xvdbmke2fs 1.41.12 (17-May-2010)/dev/xvdb is mounted; will not make a filesystem here![root@iZ28afd0manZ /]# mkfs.ext3 /dev/xvdb1mke2fs 1.41.12 (17-May-2010)/dev/xvdb1 is apparently in use by the system; will not make a filesystem here!
8、再次对/dev/xvdb进行解除挂载

[root@iZ28afd0manZ dev]# umount /dev/xvdbumount: /dev/xvdb: not mounted
9、至此,没有任何办法。重启吧。。。。。

[root@iZ28afd0manZ dev]# reboot
10.再次查看,居然奇迹般的好了,果然是万能的重启啊!

[root@iZ28afd0manZ ~]# dfFilesystem           1K-blocks      Used Available Use% Mounted on/dev/xvda1            20641404   8464512  11128368  44% /tmpfs                  8165556         0   8165556   0% /dev/shm/dev/xvdb            516061624    202652 489644572   1% /mnt


整个过程就是不断的试,最后稀里糊涂的好了,以此为记!






0 0