How to Add a New Hard Disk Without Rebooting VM Guest on RHEL 6/CentOS 6

Assumed that you need additional hard disk for your Linux RHEL 6 server to provide more storage space but this the server cannot be reboot due to production environment. This server also assumed to be running on the VMware ESXi machine. In order to add additional hard disk without reboot, you have to perform the following steps. This steps has been tested on Red Hat Enterprise Linux 6 (RHEL 6). It may works on RHEL 5 and CentOS 5.

1. Perform the steps to add a new disk to VM Guest through VMware vCenter Server/VMware vSphere. In this case i will add 12 GB space to second hard disk space which on raw devide /dev/sdb.

See also  How to Setup VNC Server on CentOS 6.3

2. Find scsi_host value using the following command:

[root@rhel6 ~]# ls /sys/class/scsi_host
host0  host1  host2

In this rhel 6 server, there are three scsi_host exist, host0, host1 and host2.

3. Rescan the SCSI Bus to Add a SCSI Device Without rebooting the VM

[root@rhel6 host0]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@rhel6 host0]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@rhel6 host0]# echo "- - -" > /sys/class/scsi_host/host2/scan

4. Check the new hard disk /dev/sdb :

[root@rhel6 ~]# fdisk -l

Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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: 0x0000690f

   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        1567    12069888   8e  Linux LVM

Disk /dev/dm-0: 10.2 GB, 10242490368 bytes
255 heads, 63 sectors/track, 1245 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/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 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/dm-1 doesn't contain a valid partition table

Disk /dev/sdb: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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 doesn't contain a valid partition table

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *