esxi服务器更换硬盘,ESXi下磁盘分区删除步骤详解

如果在vSphere Client里面添加已经安装过操作系统的磁盘(如安装过Windows系统的磁盘),那是无法再直接添加驱动器的,需要SSH登录到ESXi的控制台进行操作。

获取磁盘设备信息:

# esxcfg-scsidevs -l

mpx.vmhba32:C0:T0:L0

Device Type: Direct-Access

Size: 7580 MB

Display Name: Local USB Direct-Access (mpx.vmhba32:C0:T0:L0)

Multipath Plugin: NMP

Console Device: /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0

Devfs Path: /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0

Vendor: HP iLO    Model: Internal SD-CARD  Revis: 2.09

SCSI Level: 2  Is Pseudo: false Status: on

Is RDM Capable: false Is Removable: true

Is Local: true  Is SSD: false

Other Names:

vml.0000000000766d68626133323a303a30

VAAI Status: unsupported

t10.ATA_____PLEXTOR_PX2D128M5S_______________________P02349103954________

Device Type: Direct-Access

Size: 122104 MB

Display Name: Local ATA Disk (t10.ATA_____PLEXTOR_PX2D128M5S_______________________P02349103954________)

Multipath Plugin: NMP

Console Device: /vmfs/devices/disks/t10.ATA_____PLEXTOR_PX2D128M5S_______________________P02349103954________

Devfs Path: /vmfs/devices/disks/t10.ATA_____PLEXTOR_PX2D128M5S_______________________P02349103954________

Vendor: ATA       Model: PLEXTOR PX-128M5  Revis: 1.05

SCSI Level: 5  Is Pseudo: false Status: on

Is RDM Capable: false Is Removable: false

Is Local: true  Is SSD: true

Other Names:

vml.01000000005030323334393130333935342020202020202020504c4558544f

VAAI Status: unknown

t10.ATA_____WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629

Device Type: Direct-Access

Size: 305245 MB

Display Name: Local ATA Disk (t10.ATA_____WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629)

Multipath Plugin: NMP

Console Device: /vmfs/devices/disks/t10.ATA_____WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629

Devfs Path: /vmfs/devices/disks/t10.ATA_____WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629

Vendor: ATA       Model: WDC WD3200BEVT-7  Revis: 11.0

SCSI Level: 5  Is Pseudo: false Status: on

Is RDM Capable: false Is Removable: false

Is Local: true  Is SSD: false

Other Names:

vml.0100000000202020202057442d575845333039485536363239574443205744

VAAI Status: unknown

其中t10.ATA_____PLEXTOR_PX2D128M5S_______________________P02349103954________就是安装过Windows系统的硬盘,获取它的分区信息:

~ # partedUtil get /vmfs/devices/disks/t10.ATA_____PLEXTOR_PX2D128M5S___________

____________P02349103954________

15566 255 63 250069680

1 2048 718847 7 128

2 718848 250069646 7 0

删除分区:

~ # partedUtil delete /vmfs/devices/disks/t10.ATA_____PLEXTOR_PX2D128M5S________

_______________P02349103954________ 1

~ # partedUtil delete /vmfs/devices/disks/t10.ATA_____PLEXTOR_PX2D128M5S________

_______________P02349103954________ 2

删除完成后再到vSphere Client里面重新添加磁盘即可。

附esxcfg-scsidevs的用法:

~ # esxcfg-scsidevs -h

esxcfg-scsidevs

Print the mappings between vmhba names and /dev names

-l|--list                  List all Logical Devices known on this

system with device information.

-c|--compact-list           List all Logical Devices each on a

single line, with limited information.

-u|--uids                  List all Device Unique Identifiers with their primary name.

-d|--device                Used to filter the --list, --compact-list

and uids commands to limit output to a

specific device.

-m|--vmfs                  Print mappings for VMFS volumes to their

Service Console partitions and vmhba names.

-f|--vfat                  Print mappings for VFAT volumes to their

Service Console partitions and vmhba names.

-a|--hbas                  Print HBA devices with identifying information

-A|--hba-device-list       Print a mapping between HBAs and the devices it

provides paths to.

-o|--offline-cos-dev       Offline the COS device corresponding to this vmkernel

device.

-n|--online-cos-dev        Bring online the COS device corresponding to this vmkernel

device.

-h|--help                  Show this message.

partedUtil工具的用法:

~ # partedUtil -h

Usage:

Get Partitions : get

Set Partitions : set ["partNum startSector endSector type attr"]*

Delete Partition : delete

Resize Partition : resize

Get Partitions : getptbl

Set Partitions : setptbl ["partNum startSector endSector type/guid attr"]*

Fix Partition Table : fix

Create New Label (all existing data will be lost): mklabel

Show commonly used partition type guids : showGuids

Get usable first and last sectors : getUsableSectors

Fix GPT Table interactively : fixGpt

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值