Change Size of Virtual Disk

This is for discussing general topics about how to use VirtualBox.

Re: Change Size of Virtual Disk

Postby loukingjr » 4. Dec 2010, 18:43

this looked like it might be a good place to ask my question. I have a crunchbang statler guest with two partitions. the / partition is already full because apparently when I first installed it the installer made the /home partition over two times larger than /. so in reading things I thought maybe I should just clone it to a larger VD but first I tried gparted to resize the partitions. well it seems it won't let me grow or move the / partition at all, even though there's 12.5 GB of free space.

so my question is, if I clone the drive to a larger one, am I still going to be stuck with a full / partition?

thanks
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
 
Posts: 8827
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Change Size of Virtual Disk

Postby Sasquatch » 4. Dec 2010, 20:39

Pretty much, because all you do is make the end further away. Since your / is probably before your /home, all you get is space after /home, but not after /. What your problem is, is that /home is in an extended partition. You have to change it's size too before the primary partition / can be changed.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Change Size of Virtual Disk

Postby loukingjr » 4. Dec 2010, 21:02

Sasquatch wrote:Pretty much, because all you do is make the end further away. Since your / is probably before your /home, all you get is space after /home, but not after /. What your problem is, is that /home is in an extended partition. You have to change it's size too before the primary partition / can be changed.


thanks
/home is in an extended partition. can I resize that or should I just re-install?
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
 
Posts: 8827
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Change Size of Virtual Disk

Postby Sasquatch » 5. Dec 2010, 00:17

Read what I wrote a bit better. Then Google for the terms I've used if you have no idea what they mean.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Change Size of Virtual Disk

Postby loukingjr » 5. Dec 2010, 00:21

Sasquatch wrote:Read what I wrote a bit better. Then Google for the terms I've used if you have no idea what they mean.


well, I thought I had tried to resize the extended partition before. I will take a look at it again.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
 
Posts: 8827
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Change Size of Virtual Disk

Postby loukingjr » 5. Dec 2010, 01:49

Sasquatch wrote:Read what I wrote a bit better. Then Google for the terms I've used if you have no idea what they mean.


okay, I have it all sorted out. because I couldn't move/resize the extended partition the first time I tried, I thought you were saying because they were in an extended partition it was going to be a "problem" to fix. I guess I did something wrong in gparted the first time around because everything worked fine the second time.

thanks
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
 
Posts: 8827
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Change Size of Virtual Disk

Postby madmac88 » 8. Dec 2010, 01:16

I got a VDI with Linux on it that was getting a little tight on space and here's how I expand the VDI (let's call this VDI-1):

1. Create a new VDI (VDI-2) with the desired size
2. Run another Linux guest with VDI-1 and VDI-2 attached as additional storage devices
3. Duplicate the old disk with:
Code: Select all   Expand viewCollapse view
dd if=[VDI-1 device] of=[VDI-2 device] bs=1M conv=noerror

4. Use GPartEd to move/enlarge your partitions
5. Shutdown the guest Linux system and detach VDI-1 and VDI-2
6. Change the storage device for the old Linux guest from VDI-1 to VDI-2

A bit tedious, but it gets the job done for me. Of course, it helps that I always have a few Linux guest systems around. :)

P.S. Beware that the UUID of the new VDI is the same as the original VDI. I just deleted the old one once I confirmed that it was working, so this didn't matter to me.
madmac88
 
Posts: 2
Joined: 23. Jan 2009, 20:19
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Linux, Windows Server 2003/2008

Previous

Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 6 guests