Click to See Complete Forum and Search --> : partitions and swap


roborocker
08-28-2001, 12:17 AM
Hi all,

Just a simple question I can't seem to find a straight answer on. I've recently added tons of RAM to my system and want to remove the swap space altogther. I'm running thin on free space and have allocated far too much swap space prior to getting the new RAM addition. Here's what I need.

1. The command to see every partion I have
2. How to remove the swap partition.
3. How to tell Linux not to look for the swap on boot.
4. Reallocate the free space to another partition.

I have researched this and have some of the answers, but I don't want to say what I know so not to distract from the questions. I'm running Red Hat 7.1 with kernel 2.4.2-2
I can't think of any other info I can give that would be of any use to what I seek.

Many thanks in advance for any help offered. This forum makes for a great learning/sharing environment. Kudos to all!!!

Richie
robo_rocker_69@hotmail.com

VRay
08-28-2001, 02:14 AM
1. df
2. dunno, but why remove the swap? A few hundred meg that you'll never miss.
3. no idea
4. Partition magic if you have a win dual boot?

Sorry i couldn't be more help.

bdl
08-28-2001, 02:39 AM
Its pretty simple to do what you want; I'd say keep the swap partition, but if you're running low on hdd space, it may help you out in the short term.

To answer your questions, in order:

(all commands are executed as root)

1) The command to see your partition setup is :

fdisk -l /dev/hda

..where of course you substitute /dev/hda for whichever drive linux is installed on. That's an 'l' as in 'list'.

2) To remove swap, first you have to stop its allocation with the command:

swapoff -a

Then you can partition that particular drive as you see fit, but be forewarned, data loss and the inability to boot your system may occur. Procede at your own risk. Danger Danger.

3) To keep Linux from mounting swap on boot, edit your /etc/fstab and comment out or delete the entry for swap. Mine looks like this:

/dev/hde1 swap swap defaults 0 0

Just stick a pound sign '#' in front of it or delete it altogether and you're set.

4) Reallocating the free space to an existing partition is a tough one, and I admit I don't know how you might go about it. Partition Magic claims to do things such as this, but I don't believe it will work on EXT2 partitions, only on FAT/FAT32. Best thing to do would be just create a new, seperate partition like '/usr/local' or '/var' (if you dont already have one) and move the existing files over to the new partition, helping save some space on the 'root' partition (and adding a measure of security with the new '/var' partition, if you choose to go that route).

Luck!

[ 28 August 2001: Message edited by: bdl ]