You are here
Nick - Thu, 2011/10/06 - 04:37
Hi, running Postgres appliance, and i cant seem to figure out what the swap partition is, and thus how to increase its size. I created this from the vmdk file (the ovf did not work, import error).
Forum:
Tags:
To find where the swap is
Try checking what disks are attached
I haven't got a TKL machine handy just at the moment, but that will give you a starting point. TKL v11.x uses LVM by default so the easiest way to extend the FS is to add an extra vmdk and extend the volume. But I'm not sure how that applies to swap space though? For details on working with LVM in TKL there is a great blog post here.
output from fdisk -l and df -h
Ok I've got a TKL appliance running so I can help :)
So the swap partition is a logical volume (LV). You can check the LVs with the lvscan command. Here's what mine looks like:
I'm using a 32GB virtual HDD - by default TKL uses 90% of the physical volume (PV - ie the hard drive) for the volume group (VG - where the LVs reside). You can check how much empty space there is in the volume group (VG) using the vgdisplay command. Here's mine:
So I have 3.18GB free. Yours will differ obviously. You could just use the available free space, but personally I'd be inclined to add a new virtual HDD (vmdk) - or extend the current one. Obviously you'll have to if it doesn't have as much extra room as you'd want to add.
I have only ever made a new virtual HDD (vmdk) and added it so thats what my instructions will be, if you want to extend your original vmdk you'll need to do a bit of research.
Make a new vmdk as big as you'd like (using your VM app). If you think you'll want more space for your appliance itself you can include that in the total (one single vmdk is fine - you don't need a separate one for swap). Once you have it attached (using your VM app interface - may require a reboot) then you can add it as a physical volume (PV) and extend your volume group (VG). Check that it is recognised by the system and the name of it with fdisk -l . Assuming it is /dev/sdb then add it as a PV and extend the VG like this:
To check on your PVs you can use the pvscan command. More detailed info is available with the pvdisplay command. You can also check that your VG has been extended now using the vgdisplay command again.
Now you need to extend the LV. Assuming your swap is called 'swap_1' (as displayed by lvscan) and you want to add 2GB to it use something like this:
And then extend the filesystem (I haven't done this with a swap partition so hope this works!):
Hopefully all that worked and you now have a bigger swap. Check with lvscan. Let me know how you go.
Jeremy- Thanks for the
Jeremy-
Thanks for the clearly written suggestion. I plan to attempt an lvreduce /dev/turnkey/root so i can lvextend /dev/turnkey/swap_1
Now that I know the commands to check this (thanks!) i will also try increasing the ram on the VM.
For those who may be interested or already know the answered: I am trying to get pgRouting installed and to work with osm data. I am following the workshop from the pgrouting.org site, and there was a mention somewhere that the osm2pgrouting application doesn't handle large datasets and gets messed up if the ram and swap are not large enough. I have no idea if this going to work, but at least i have learned some new linux commands!
I'll post back my results, good or bad.
Cool. glad it was useful for you! :)
I haven't personally used lvreduce but I would assume that it should work in a similar manner to lvextend. Also if you're new to Linux remember that detailed info about commands can (usually) be accessed via the man command. eg man lvreduce
It'll be great to hear how you go and even if you are unsuccessful we'll all learn something (at least you and I will!)
As for installing pgRouting, just in case you don't know, TKL is based on Ubuntu 10.04/Lucid which may make it easier to find clear and specific instructions. Although there are some TKL specifics such as sudo is not installed by default (as you may have already dicovered) and as default login is root, it is not required (and can just be removed from any instructions that use it).
Also, as a suggestion; for clarity and relevance for other users perhaps start a new thread for pgRounting specific stuff (I'll see it regardless). If you're successful, just post in 'General' or if having issues 'Support' is fine, otherwise post back here regarding LVM/swap stuff.
Good luck!
Tried lvextend -L+512
Tried lvextend -L+512 /dev/turnkey/swap_1:
Tried resize2fs... results:
Not sure if i needed to run it, lvscan shows swap_1 as increased to 1.00 GiB
I have rebuilt the VM with 4 CPUs and 2 GiB RAM instead of the defaults of 1 CPU and 256 MB RAM. Hopefully the 1.00 GiB swap will be enough.
Side note: I tried to change my original VM from 1 CPU to 4 and increased the RAM, but after one successful startup, then next reboot got me the inframfs or whatever that prompt is, thus the "do over"
Let's hope it all works
I'm not sure with swap (I've never extended a swap partition). I know with other FS types you need to run that command to get the underlaying filesystem to fill the LV (otherwise it still reports it as the original size). Perhaps swap is different somehow (well I guess obviously it is as resize2fs doesn't even see an FS). I guess if it doesn't work as expected, perhaps google has some suggestions?
Add new comment