Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to initialize SWAP SPACE

1,038 views
Skip to first unread message

Jason Eccles

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to
Hi all.

I hope that somebody can help, and I know that it is probably in the
docs, but please...
I developed a partition table error on my dual boot system, so I re
F-Disked. I kept my linux partition, cos it's important, but I lost my
swap space. I have since re-created the SWAP partition but can't figure
out how to format it.

Can somebody please help

Thanks in advance

Jason

Chris Beauchamp

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to

"Jason Eccles" <ja...@warpsoft.org.uk> wrote in message
news:38447CD2...@warpsoft.org.uk...

> Hi all.
>
> I hope that somebody can help, and I know that it is probably in the
> docs, but please...
Naturally...

> I developed a partition table error on my dual boot system, so I re
> F-Disked. I kept my linux partition, cos it's important, but I lost my
> swap space. I have since re-created the SWAP partition but can't figure
> out how to format it.
>

man mkswap

Chris

Jason Clifford

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to
On Wed, 1 Dec 1999, Jason Eccles wrote:

> I developed a partition table error on my dual boot system, so I re
> F-Disked. I kept my linux partition, cos it's important, but I lost my
> swap space. I have since re-created the SWAP partition but can't figure
> out how to format it.

Ensure that the partition type is set to swap. Then use the command
`mkswap /dev/hda2' (this assumes that the partition is the second one on
the first IDE hard drive) to initialise the swap.

Then add an entry to your /etc/fstab file like this
/dev/hda3 swap swap defaults 0 0

Now simply call /sbin/swapon to activate the swap.

Jason Clifford http://www.definitelinux.com/
Definite Linux - The UK's leading distribution with crypto support
**** Linux Workstation and Server Systems ****


Jim Howes

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to uk.comp.os.linux
Jason Eccles wrote:
>
> I have since re-created the SWAP partition but can't figure
> out how to format it.

To set up the appropriate stuff in a partition, CAREFULLY type
mkswap DEV, where DEV is the block special file in /dev which
represents your swap partitions, something like:

mkswap /dev/hda2

Before you attempt to swap on this partition, you will probably
have to sync first. Then, swapon /dev/hda2. I say CAREFULLY
because mkswap, like any sort of filesystem creation, is not
good for existing filesystems. You might want to run badblocks
on the partition first, although there's probably no major need
if the disk is reliable.

Your system should pick this up automatically next time you
boot, if you have the partition in your fstab.

For instance (from my /etc/fstab)

/dev/sda1 / ext2 defaults 1 1
/dev/hda2 swap swap defaults 0 0

(Anything of type swap is swapon'd at boot time with swapon -a)

SammyTheSnake

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to
Jason Clifford fell asleep on the keyboard and...

>On Wed, 1 Dec 1999, Jason Eccles wrote:
>
>> I developed a partition table error on my dual boot system, so I re
>> F-Disked. I kept my linux partition, cos it's important, but I lost my
>> swap space. I have since re-created the SWAP partition but can't figure

>> out how to format it.
>
>Ensure that the partition type is set to swap. Then use the command
>`mkswap /dev/hda2' (this assumes that the partition is the second one on
>the first IDE hard drive) to initialise the swap.
>
>Then add an entry to your /etc/fstab file like this
>/dev/hda3 swap swap defaults 0 0
>
>Now simply call /sbin/swapon to activate the swap.

a great example of why you should be very careful indeed when using commands
like mke2fs and mkswap...

SammyTheSnake
--
SammyT...@SammyServ.Tollon.co.uk SammyT...@Hotmail.com
PHUAE / S.A.Penny@(dcs.)Warwick.ac.uk (E)TLA page www.warwick.ac.uk/~phuae/
-=SF9=- a team based FPS game with AI by SammyTheSnake & JB www.symbiosys.org
primrose up 26 days, 9:55, load average: 2.40, 2.66, 2.61

0 new messages