LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2013, 11:24 AM   #1
pwjohnston
LQ Newbie
 
Registered: Jul 2009
Distribution: Fedora/CentOS
Posts: 15

Rep: Reputation: 0
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.
 
Old 08-08-2013, 11:44 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
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.

Last edited by Ser Olmy; 08-08-2013 at 11:47 AM.
 
Old 08-08-2013, 12:15 PM   #3
pwjohnston
LQ Newbie
 
Registered: Jul 2009
Distribution: Fedora/CentOS
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
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.
That seems reasonable. I'll give it a try thank you!
 
Old 08-08-2013, 12:30 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,782
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
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.
 
Old 08-08-2013, 03:14 PM   #5
pwjohnston
LQ Newbie
 
Registered: Jul 2009
Distribution: Fedora/CentOS
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by szboardstretcher View Post
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.
Yeah, that was the direction I was going next. Iíve used LVM a little in the past and one of the VMware KB suggested it (kb.vmware.com/kb/1006371‎) I just have not worked with it enough to know. My point of reference is the Netapp filers. If you set an Aggregate pool and then you set up volumes inside you can later grow it if you run out of space. I have only used LVM on bare metal machines and didnít know if I could grow the LV after it has been allocated.

Of course, then something blew up in the data center so my test will have to wait.
 
Old 08-08-2013, 08:43 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
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.
LVM on the storage system (or hypervisor, if storage is local) is a great idea for all the reasons you mention and a few more (thin provisioning). On the VM itself, however, it may not be necessary or even a good idea (LVM in LVM).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get online with an old lappy (128mb ram, 6Gb hdd) running Puppy linux? fittanelfy Linux - Newbie 5 12-20-2010 12:59 PM
Raid5 Online HDD Build Prob sanjay2004 Linux - Server 1 03-10-2010 11:00 AM
how to online expand LUN (without reboot) m2mthu Red Hat 1 11-11-2009 06:52 PM


All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration