Hot-add of VMware virtual disks in RHEL

From Brandonhutchinson.com

Revision as of 22:07, 11 June 2008 by Hutch (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

In this example, I add two 20G virtual disks to a RHEL 5 x64 VM and get the disks recognized by the OS without a reboot.

  • List current disks on the virtual SCSI bus.
# lsscsi
[0:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sda
[0:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdb
  • Re-scan the SCSI bus.
# echo "- - -" > /sys/class/scsi_host/host0/scan
  • The new virtual disks now appear.
# lsscsi
# lsscsi
[0:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sda
[0:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdb
[0:0:2:0]    disk    VMware   Virtual disk     1.0   /dev/sdc
[0:0:3:0]    disk    VMware   Virtual disk     1.0   /dev/sdd
  • Partition (fdisk), create file systems (mkfs), label file systems (e2label), and add the file systems to /etc/fstab as appropriate.
Personal tools