With VMware ESX 3.0 it is possible to hot add a new virtual disk to a running guest. I want to show what to do to use it with a linux guest without a reboot:
- add a new disk to the running guest via VI-Client
- scan for new hard disk in the guest
3. echo "- - -" > /sys/class/scsi_host/host0/scan
for reference the output of
cat /proc/scsi/scsi
before
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
and after the scan
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Attached devices:
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
- find out the device of the new hard disk (/dev/sdb in the example above)
- check if there is really no partition on the device
6. fdisk -l /dev/sdb
7.
8. Disk /dev/sdb: 1073 MB, 1073741824 bytes
9. 255 heads, 63 sectors/track, 130 cylinders
10. Units = cylinders of 16065 * 512 = 8225280 bytes
11.
12. Disk /dev/sdb doesn't contain a valid partition table
- create new partition on the device (with fdisk)
- create new filesystem on the partition created above
15. mkfs.ext3 /dev/sdb1
- add line to /etc/fstab to automount partition after next reboot
17. /dev/sdb1 /mountpoint ext3 defaults 0 2
No comments:
Post a Comment