linux为服务器磁盘扩容时,分区提示错误信息如何解决?,linux错误信息


问题:为服务器磁盘扩容时,分区提示如下错误信息

解决办法:

1、查看磁盘分区情况

[root@hotdata ~]# fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1        2611    20970496   83  Linux

Disk /dev/vdb: 322.1 GB, 322122547200 bytes
16 heads, 63 sectors/track, 624152 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: 0xb8c71e5c

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1       16643     8388040+  82  Linux swap / Solaris
/dev/vdb2           16644      208050    96469128   83  Linux  

2、可以看到/dev/vdb有两个分区,一个用于SWAP,一个是存储数据的。

问题肯定是出在SWAP了,使用命令关闭swap,重新fdisk后还是提示一样的错误

swapoff  /dev/vdb1      

3、进入/etc/fstab 注释掉挂载的磁盘,reboot,重新fdisk

4、reboot 重启后,重新fdisk即可

相关内容