Can you expand a HDD on an online Linux VM?
On Windows (yes I know I’m not making any friends by saying that) since at least 2008, you have been able to expand a disk on a running virtual machine in VMware (or any other virtualization software / SAN LUN) and then expand the disk/volume within Windows without needing downtime/maintenance.
We have SLES 11 VM’s with ext3 partitions in their LUNs that were set up before I took this job. I’m sure that there has to be a way to do this you can do practically anything in Linux that Windows can do. Is this possible with ext3, do I need to be using ext4, LVM, BTRFS, I don’t know. I keep searching for this on the web and as soon as I think I’ve found the answer there is a “now, reboot the virtual machine” in it. Sorry I don’t have as much Linux experience as I do in Windows and the Sr Engineer seems to be unaware that this is even possible. I'm getting ready to test this: http://raftaman.net/?p=228 But if anyone has a better way, I'd love to read up on it. |
Expanding a physical device shouldn't be a problem. At worst you may have to rescan the SCSI/SAS/SATA bus to detect the change.
Expanding partitions is another matter. If the partition is at the end of the disk, then you just edit the partition table and expand the file system afterwards. If the partition is between other partitions, then you're out of luck (just as you would be with Windows). The blog post you linked to just details how you edit the partition table by simply deleting the old partition and then creating a new, larger partition starting at the same sector as the old one. If you're worried about making a mistake, back up the partition table with dd before you start. LVM is generally a good idea, but there's no need to set up LVM inside a VM. Just stick to single-partition virtual disks, and you will always be able to add space as needed. |
Quote:
|
I always set up LVM. That way, in Xen/VMware, you add a disk, let the OS detect it, add it via LVM. Done. Makes growing specific partitions a cinch. And snapshot backups...
I wouldn't discount LVM. |
Quote:
Of course, then something blew up in the data center so my test will have to wait. |
Quote:
|
All times are GMT -5. The time now is 11:48 PM. |