Hot-add of VMware virtual disks in RHEL

From Brandonhutchinson.com

(Difference between revisions)
Jump to: navigation, search
(New page: 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:...)
Current revision (22:08, 11 June 2008) (edit) (undo)
 
(One intermediate revision not shown.)
Line 11: Line 11:
* The new virtual disks now appear.
* The new virtual disks now appear.
# '''lsscsi'''
# '''lsscsi'''
-
# lsscsi
 
[0:0:0:0] disk VMware Virtual disk 1.0 /dev/sda
[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:1:0] disk VMware Virtual disk 1.0 /dev/sdb
Line 17: Line 16:
[0:0:3:0] disk VMware Virtual disk 1.0 /dev/sdd
[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.
+
* You may now partition the disks ('''fdisk'''), create file systems ('''mkfs'''), label file systems ('''e2label'''), and '''mount''' and file systems to '''/etc/fstab''' as appropriate.

Current revision

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
[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
  • You may now partition the disks (fdisk), create file systems (mkfs), label file systems (e2label), and mount and file systems to /etc/fstab as appropriate.
Personal tools