-   Linux - General (
-   -   Create swap partition? (

mikeshn 11-27-2002 07:20 PM

Create swap partition?
I don't know how that's happened but after installing Red Hat 7.3 than Red Hat 8.0 I figured that swap partition is not exist.

During the boot up it takes a couple of seconds to enable swap space.

The hardrive looks like this:

[mike@localhost mike]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda7 9.6G 2.5G 6.6G 28% /
/dev/hda6 50M 14M 34M 28% /boot
none 125M 0 124M 0% /dev/shm

How can I create swap partition? What should I do ?


DavidPhillips 11-27-2002 07:25 PM

if you have free space you can create a partition on it and make it type 82 with fdisk

if not make a swapfile

dd if=/dev/zero of=/root/swapfile bs=1k count=512

using your desired parameters

then run mkswap on the partition or file

DavidPhillips 11-27-2002 07:26 PM

once that's done

add it to /etc/fstab

and run

swapon -a

deadbug 11-27-2002 07:40 PM

Re: Create swap partition?

Originally posted by mikeshn

none 125M 0 124M 0% /dev/shm

If this isn't the swapfile, what is it?

DavidPhillips 11-27-2002 08:23 PM

no it's a memory filesystem for shared memory, not a swap partition

je_fro 11-27-2002 11:23 PM

Just a thought, but I think parted is nicer to work with, then later you can mke2fs ext3 and mkeswap on the partitions that you made...


just a thought.

DavidPhillips 11-28-2002 02:42 AM

well it ain't gotta be nice, you just need to create the swapfile or partition and mount it...

All times are GMT -5. The time now is 08:42 AM.