Linux我用 LinuxLinux学习之路

解决esxi主机vmware 无法清除磁盘的报错

2018-04-23  本文已影响697人  bboysoul

概述

今天新安装了esxi主机,这台服务器中有四块硬盘,当然我是把系统安装在u盘上的,在此之前这台服务器安装的是zstack,zstack是安装在四块硬盘中的其中一块硬盘上的,所以很显然,因为zstack是建立在centos上的,所以这块硬盘肯定被分了不止一个分区,所以导致最后我安装完vmware格式化这块硬盘就报无法清除磁盘的错误了,解决方式很简单,如下

操作

首先把esxi主机的ssh打开,然后登录主机,找到不能格式化的那块硬盘设备名,比如我的是
Local ATA Disk (t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L)
接着进入下面这个目录
cd /dev/disks
看下拥有的设备

[root@MiWiFi-R1CM-srv:/dev/disks] ls
naa.2000acde48234567                                                         vml.010000000020202020202020202020202039535a3443593445535433333230
naa.2000acde48234567:1                                                       vml.010000000020202020202020202020202039535a3443593445535433333230:1
naa.2000acde48234567:5                                                       vml.01000000002020202020202020202020205a3459354232374c535431303030
naa.2000acde48234567:6                                                       vml.01000000002020202020202020202020205a3459354232374c535431303030:1
naa.2000acde48234567:7                                                       vml.01000000002020202020202020202020205a3459354232374c535431303030:2
naa.2000acde48234567:8                                                       vml.01000000002020202020202020202020205a3459354232374c535431303030:3
naa.2000acde48234567:9                                                       vml.01000000002020202020202020202020205a34593552324d31535431303030
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L    vml.01000000002020202020202020202020205a34593552324d31535431303030:1
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L:1  vml.01000000002020202020202020202020205a34593553465243535431303030
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L:2  vml.01000000002020202020202020202020205a34593553465243535431303030:1
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L:3  vml.02000000002000acde4823456753616e446973
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5R2M1    vml.02000000002000acde4823456753616e446973:1
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5R2M1:1  vml.02000000002000acde4823456753616e446973:5
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5SFRC    vml.02000000002000acde4823456753616e446973:6
t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5SFRC:1  vml.02000000002000acde4823456753616e446973:7
t10.ATA_____ST3320613AS_________________________________________9SZ4CY4E     vml.02000000002000acde4823456753616e446973:8
t10.ATA_____ST3320613AS_________________________________________9SZ4CY4E:1   vml.02000000002000acde4823456753616e446973:9

没错Local ATA Disk (t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L)这块硬盘有三个分区,所以现在我们只要重新用fdisk建立分区表就可以,步骤如下

[root@MiWiFi-R1CM-srv:/dev/disks] fdisk ./t10.ATA_____ST1000DM0032D1ER162__________________________________Z4Y5B27L

***
*** The fdisk command is deprecated: fdisk does not handle GPT partitions.  Please use partedUtil
***

Found valid GPT with protective MBR; using GPT


Command (m for help): m
Command Action
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

Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.


The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table

之后你再登录esxi主机去重新格式化硬盘就好了

欢迎关注Bboysoul的博客www.bboysoul.com
Have Fun

上一篇下一篇

猜你喜欢

热点阅读