How do I expand/extend VM partion (Xen, Ubuntu)
-
I've got XenCenter 7 running a Ubuntu 14.04 x64 box headless/GUI-less with Seafile.
I was initially just testing Seafile but now I want to test further and move toward production use. I started with a 16GB single VD. Even with only light testing, I've already used up this space.
I shut down the VM and used Xen to expand the disk to 50GB, that worked fine.
Now I just can't figure out how to extend the partition in Ubuntu. Some various tutorials I've read just didn't work.
It would seem that because it's just one VD, and it's the system drive, that I have to completely delete the partition in order to extend it? I'm not sure about that.
Here is
fdisk -l
output:Disk /dev/xvda: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0000a051 Device Boot Start End Blocks Id System /dev/xvda1 2048 499711 248832 83 Linux /dev/xvda2 501758 33552383 16525313 5 Extended /dev/xvda5 501760 33552383 16525312 8e Linux LVM Disk /dev/mapper/seafile--vg-root: 15.7 GB, 15699279872 bytes 255 heads, 63 sectors/track, 1908 cylinders, total 30662656 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/seafile--vg-root doesn't contain a valid partition table Disk /dev/mapper/seafile--vg-swap_1: 1195 MB, 1195376640 bytes 255 heads, 63 sectors/track, 145 cylinders, total 2334720 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/seafile--vg-swap_1 doesn\'t contain a valid partition table
I have no idea why it's saying "doesn't contain a valid partition table". Nothing is making sense now.
At the top it says /dev/xvda is 53.7GB, this seems right since I changed the drive to 50GB. But the seafile--vg-root being 15.7GB is where the extra space needs to go.
I'm not sure if this can be expanded in place, or I have to delete and recreate it, or if it has to be done by booting to a recovery disk, etc.
/dev/xvda1 is ext2
/dev/xvda5 is LVM2_member
/dev/mapper/seafile--vg-root is ext4
/dev/mapper/seafile--vg-swap_1 is swapLastly, I was thinking maybe I should start over if I'm going to use in production and switch to CentOS7 instead of this old Ubuntu. If I wipe it all out, that kind of solves that problem, I can create my partitions differently too, or separate Seafile data on different VDs or something like that.
-
@guyinpv What is the filesystem in the root partition?
-
@guyinpv The good news is that it's on an LVM, so expanding it is quite easy. I'd normally add another virtual drive as I find it easier to add a physical volume into an existing volume group. I know a guy who did a presentation on LVM recently.
pvresize /dev/xvda5 resize2fs /dev/mapper/seafile--vg-root
You might have to do the resize2fs after booting into recovery mode, can't always resize a mounted partition. Should be rare now, but you never quite know.
-
@travisdh1
So here is the output of those commands:Physical volume "/dev/xvda5" changed 1 physical volue(s) resized / 0 physical volume(s) not resized ... resize2fs 1.42.9 (4-Feb-2014) The filesystem is already 3832832 blocks long. Nothing to do!
But if I type
df -h
those 35GB or so aren't appearing anywhere. -
@guyinpv said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1
So here is the output of those commands:Physical volume "/dev/xvda5" changed 1 physical volue(s) resized / 0 physical volume(s) not resized ... resize2fs 1.42.9 (4-Feb-2014) The filesystem is already 3832832 blocks long. Nothing to do!
But if I type
df -h
those 35GB or so aren't appearing anywhere.Did you reboot since changing the drive size? If not you'll have to tell the system to re-scan the block device.
echo 1 > /sys/block/xvda/rescan
If that doesn't work, then it get's slightly more complicated knowing where to look in /sys.
-
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
-
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
-
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
I tend to not use LVM in VMs, just because mine are so small that it is realy simple to cp -va /* from live and then chroot and reinstall grub.
-
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
I tend to not use LVM in VMs, just because mine are so small that it is realy simple to cp -va /* from live and then chroot and reinstall grub.
I don't like reinstalling grub when I don't have to. And I never have to move/copy anything. Might be doing yourself a disservice in not learning logical volume management (weather that's LVM, btrfs, or zfs.)
-
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
I don't usually extend the existing group. I have a VG for the OS and a VG for the data. Then I can just unattach/reattach the disk if I need to rebuild.
-
Easy button.....blast the VM out of existence. Who has time to fight this crap?
I'll rebuild my Seafile system from the start but I just want to set it up better. Probably run on CentOS7 instead of Ubuntu, especially Ubuntu 14.
Since this is a file store, some other arrangement of VDs would probably be appropriate to make sure I have a backup of our data. That is, instead of running everything off a single large disk.
-
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
I tend to not use LVM in VMs, just because mine are so small that it is realy simple to cp -va /* from live and then chroot and reinstall grub.
I don't like reinstalling grub when I don't have to. And I never have to move/copy anything. Might be doing yourself a disservice in not learning logical volume management (weather that's LVM, btrfs, or zfs.)
It is not about not learning LVM: I use it into the host, for the very purpouse of have flaxibility in storage config/expansion.
It is about having really simple containers for my apps. -
XenCenter released for Linux? Nice, when did that happen?
-
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
not the answer you are seacrhing for. anyway while this is really rude, if I have space, I prefer to create a new disk and use stuff like a live distro to move the system to the new disk, reinstall grub and go...
Yeah, I very much prefer adding another drive myself. But you just don't have to move anything with LVM, just extend the volume group.
I tend to not use LVM in VMs, just because mine are so small that it is realy simple to cp -va /* from live and then chroot and reinstall grub.
I don't like reinstalling grub when I don't have to. And I never have to move/copy anything. Might be doing yourself a disservice in not learning logical volume management (weather that's LVM, btrfs, or zfs.)
It is not about not learning LVM: I use it into the host, for the very purpouse of have flaxibility in storage config/expansion.
It is about having really simple containers for my apps.Then just go fully containerized with docker or something like it, why tie your own shoe laces together?
-
@travisdh1 easy&sad: docker is a new technology which is by no means well known here outside the devel circles. no sysadmin is aware of them. so if I have to make something which is expected to survive me, I have to go mainstream. small VM and go...
-
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 easy&sad: docker is a new technology which is by no means well known here outside the devel circles. no sysadmin is aware of them. so if I have to make something which is expected to survive me, I have to go mainstream. small VM and go...
Containerization a new technology? I had it available in IRIX back in the 1990s, how could it be new?
-
@scottalanmiller It's called XO.
-
@travisdh1 said in How do I expand/extend VM partion (Xen, Ubuntu):
@matteo-nunziati said in How do I expand/extend VM partion (Xen, Ubuntu):
@travisdh1 easy&sad: docker is a new technology which is by no means well known here outside the devel circles. no sysadmin is aware of them. so if I have to make something which is expected to survive me, I have to go mainstream. small VM and go...
Containerization a new technology? I had it available in IRIX back in the 1990s, how could it be new?
it is not the tech is how people invest in knowledge. here is just windows server 2012+vmware. P.E.R.I.O.D.
want more knowledge? pass to enterprise level supply chains.
really, even yesterday I've talked with e potential new service provider: it was a microsoft shop. linux? naaa. unix? in the '80... -
@matteo-nunziati of course when I say windows I mean GUI not powershell. hell, the sysadmin has gone a bit nervous when he seen my server core VM and my hyper-v server install. he asked: are you sure you do not want a gui?
answer: yes please, put a cream topping on it, also!
-
of course it is a matter of market: if you move in the ICT market your providers are more skilled. but if you work in manufacturing with the S of SMB, what you get is this. It is not supply chain segmentation: it is your employer mindset which casts you to certain type of providers and you have to manage to change the mindset (good luck) and deal with daily issues to be solved.
as example: did you see my VoIP incident?