We are running RHEL 6.4 on VMware. I have an OS disk of 20GB and want to expand it to 30GB.
I have expanded the disk in VMWare. Is there any way I can let the OS recognize that /dev/sda has grown from 20GB to 30GB, without rebooting the server?
We are running RHEL 6.4 on VMware. I have an OS disk of 20GB and want to expand it to 30GB.
I have expanded the disk in VMWare. Is there any way I can let the OS recognize that /dev/sda has grown from 20GB to 30GB, without rebooting the server?
If your Linux OS has not detected the disk size change already, use lsscsi
to list the SCSI devices present on your systems together with the addresses assigned and issue an
echo 1 > /sys/bus/scsi/devices/2\:0\:0\:0/rescan
if your disk has been assigned 2:0:0:0 as the address. The dmesg
output will indicate a changed LUN size and fdisk -l
will be reporting the larger disk.
You would need to do three-ish things to complete a disk resize:
While in general it is possible to do all three online, you will run into trouble re-reading the new partition table if at least one file system off the disk is still mounted. If you need the root partition resized, this clearly will pose a problem.
If you need to minimize downtime, I would recommend performing 1. and 2. while your system is still up, rebooting and resizing the file system online after the system has booted up again.
If the amount of downtime does not matter much (it is all about a couple of minutes anyway), you might find it more comfortable to boot a rescue system, do actions 2. and 3. there and reboot the productive OS - the discovery of the new LUN size will have happened automatically at boot time by the rescue OS and would not need to be done manually.
Run the dmesg | tail
command. Linux will recognize the expanded VMware drive (you do have VMware guest tools installed, right?).
You can verify this size change with fdisk -l
.
Now, from here, the filesystem layer is going to depend on your partitioning setup, filesystems in use and whether LVM is installed or not.