Click to See Complete Forum and Search --> : Resize Swap space


redhatmandrake
06-10-2004, 08:33 PM
When setting up Fedora 2 i accidentaly gave 8 gigs to swap. I want some back, but how do i go about resizing my swap space.

DSwain
06-10-2004, 08:56 PM
i'm not positive but FC2 may have QTParted which should allow you to easily modify your partition scheme.

redhatmandrake
06-10-2004, 09:51 PM
Wow sounds all fascinating but what does it mean...

DSwain
06-10-2004, 10:56 PM
lol sorry i jumped it a bit too fast.

Well, your Fedora Core 2 swap got pushed to 8 gigs (i'd recommend 1gb btw if you care to know) so what i would do is look for an app called QTParted. QTParted is a disk partitioner (pretty similar to a low-key Partition Magic if you know that app from Windows.) That should easily allow you to resize any of your partitions, including your swap. Look for that app somewhere within the Fedora 2 menu's somewhere, or open up a terminal and type "qtparted." From there the app should be fairly straightfoward. If not, just post again what your troubles are.

Uranus
06-11-2004, 02:09 AM
Why the complicated stuff? You can just delete the partition and make a new (smaller) one since this isn't a filesystem with precious files that need to be saved and stuff. The downside to this is that maybe the numbering is changed (unless the SWAP-space is the last partition).
Then just "mkswap /dev/hdXX".
HTH
Sam

redhatmandrake
06-11-2004, 06:50 AM
So i take it i just do thinging like rm /dev/XXX and mkdir /dev/xxx or if there s tool like fdisk or somthing.

Uranus
06-11-2004, 07:36 AM
No, don't "rm /dev/hdXX"
Just fire up fdisk (or, preferably cfdisk) and if you're using fdisk type p. This will show you the partition table. Check if the SWAP-space you want to resize is at the end of the drive, if it is just type d and then the number of the swap partition. Then type n, ENTER, and +#M, where # is the size in megabytes.You will then have some free space.
Have a look at the Partition How-To:
http://tldp.org/HOWTO/Partition/index.html
If it's not at the end it might be nicer to resize - but that's your own choice. Otherwise you'll have to edit some files (especially fstab, maybe more).
HTH
Sam

mdwatts
06-11-2004, 11:41 AM
If this is a new installation, would it not be easier to just reinstall and this time ensure the partition sizes are correct?

Unless you know what you are doing by resizing swap, freeing up space and either merging into a existing partition or creating a new while modifying the partition assignments in /etc/fstab, you would likely be better off just reinstalling.

redhatmandrake
06-13-2004, 11:02 AM
In the end i tried cfdisk and it worked fine. Although i wanted to merge that extra space with my /, but in the end i have a second partition for backup which is better since i always end up destroying linux and rebuilding it back again. Thanks all.....