0

I have a fixed vdi disk in an ubuntu server (it's a virtual machine, i'm using virtualbox for handle this from my ubuntu desktop so). I installed a lot of things, and the disk is full (i wasn't pretty sure how much space i was going to need when i started).

So, i want to increase the size of the disk, let's call it my main disk. I search the web and it can't be done from command line using VBoxManage modifyhd tool.

I keep searching, and i find a video that help me doing it. But, this video it's useful until 4:57 (from that point, the author uses gparted for managing partitions, and i can't do that, because in my case are LVM partitions). I will post the steps that i did just in case that you guys don't have time to see the video:

  • Backup the virtual machine and all files related.
  • Create a disk, /dev/sdb of the same settings (vdi fixed size) from virtual box, but with more size than /dev/sda. /dev/sdb will have 5 GB and /dev/sda will still having 4.
  • Clone /dev/sda in /dev/sdb, this will create /dev/sdb5, lvm disk of 4 GB (with dd)
  • Create a new disk in the free (unallocated) space, a 1GB lvm disk, this is /dev/sdb3

So, i have two physical volumes (PV) in /dev/sdb.

  • /dev/sdb2 (it contains /dev/sdb5 with 4 GB)
  • /dev/sdb3, with 1 GB

I add /dev/sdb3 in the same Volume Group (VG) that /dev/sdb2. And now i wan't to shrink or delete /dev/sdb3 and assign this free space to /dev/sdb5. But i can't find the right command to do it. Can this be donde?

I can't do this from LVM GUI because i don't have space for installing it.

0

A current version of GNU parted (not GParted) can expand contract or move the Logical Volumes within theIR Volume Group IN almost any lvm2 or Raid partition.It can manipulate them as their native file types including most that are endorsed by VirtualBox GNU parted cannot format into LVM2 anymore however. That formatting and building ability has now been deprecated from GNUParted but it was once there when LVM was decided to be The Next big Thing for linux.

| improve this answer | |
  • I don't understand the existing difference (if any) between GParted and GNU Parted, but you were right @mikaloyd, there is an old version of GParted/GNU Parted, the 0.14 version has LVM support for use it with GUI, but in my experience isn't truly stable, so i don't recommend it for production environments. – chomp May 2 '15 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.