虚拟服务器添加磁盘,不停机为虚拟机添加主机磁盘(以VMware Workstation为例)

一、未添加前磁盘情况[root@agent ~]# fdisk -l

Disk /dev/sda: 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: 0x000ec240

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64        2611    20458496   8e  Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 18.9 GB, 18865979392 bytes

255 heads, 63 sectors/track, 2293 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: 0x00000000

Disk /dev/mapper/VolGroup-lv_swap: 2080 MB, 2080374784 bytes

255 heads, 63 sectors/track, 252 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: 0x00000000

二、查看主机总线号[root@agent ~]# ls /sys/class/scsi_host/

host0  host1  host2

三、添加新硬盘(以VMware Workstation为例)

615e4cfe9fb83ae93955e4662be724ef.png52f85443e3d0ccb3b3ef17e83eeeea0e.png

1cbf62902ec97aab9ee2bbc456ff9ce5.png

e32275f79940e1e0f98c0c6668bc9f29.png

f9fbc4d2abeabd000590da43ebe107ef.png

f22e0e319ec30b17805445175e600971.png

四、重新扫描SCSI总线添加磁盘[root@agent ~]# echo "- - -" > /sys/class/scsi_host/host0/scan

[root@agent ~]# echo "- - -" > /sys/class/scsi_host/host1/scan

[root@agent ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

[root@agent ~]# fdisk -l

Disk /dev/sda: 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: 0x000ec240

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64        2611    20458496   8e  Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 18.9 GB, 18865979392 bytes

255 heads, 63 sectors/track, 2293 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: 0x00000000

Disk /dev/mapper/VolGroup-lv_swap: 2080 MB, 2080374784 bytes

255 heads, 63 sectors/track, 252 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: 0x00000000

Disk /dev/sdb: 1073 MB, 1073741824 bytes                                #新加磁盘

255 heads, 63 sectors/track, 130 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: 0x00000000

74b0bd77bc391cb25c5057887648842b.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值