LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-24-2006, 01:23 PM   #1
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,495

Rep: Reputation: 52
Create swap partition after install


Hi everyone,

When I installed FC4 I did not assign a swap partition because I have 1.5GB memory and did not think I needed it. It is running just a tad slow so I was wondering if I can create a post install swap partition. I generally use Partition Commander which has worked well for me.

Will I cause any damage to the existing partitions?

Thanks for any help

Bob
 
Old 01-24-2006, 02:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
well don't create swap unless you KNOW you need to... i.e. your "free" output has none, or very very little free memory. by this though, it's mainly the size of the "cache" free you have, as linux will naturally use all physical ram for cache sooner or later to get the best performance. if you still have plenty of totally free memory (third number onthe first row of numbers) then there's no point adding a swap.

BUT if you do want to add one, i'd suggest using somethign like resize2fs to shrink a partition and add it in. I'd suggest trying to make the space as far back in the drive as possible as things like grub may be referencing a /boot partition quite far back too, depending on where you personally placed it. IF you can shrink the end one and tg it at teh very back, even better. This shouldn't be too much of a problem though as FC4 loves using ext2 fs labels in /etc/fstab meaning rahter than referencing a partition by it's location, it looks on all partitions on all devices for a certain name. meaning if it's partition id changes (e.g. hda6 becomes hda7) then it probably won't care anyway. So once you have free space, create a partition with fdisk then format it with "mkswap /dev/hda{b]X[/b]" then just use swapon to load it. if it loads fine, stick an entry in /ets/fstab to permanntly mount it on boot.
 
Old 01-24-2006, 04:46 PM   #3
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,495

Original Poster
Rep: Reputation: 52
Thank you for the reply. I have never run out of memory (checked it often while doing some heavy duty stuff.) So, I think I will stay with what I have for right now. I just felt Gnome was setting up rather slow, but it probably has nothing to do with memory. Besides, I am upgrading my machine to 2GB this weekend.

Greatful for the help.

Bob
 
Old 01-26-2006, 10:18 AM   #4
caspervn
Member
 
Registered: Jul 2005
Location: Vietnam
Distribution: Fedora Core 2
Posts: 55

Rep: Reputation: 15
If you need a guideline for creat swap partition, redhat.com have writen a tutorial. I haven't remembered which section say this acticle. But I sure it has guide for you
_http://www.redhat.com/docs/manuals/linux/

If you don't understand what I said, forget this post ^_^
 
Old 01-26-2006, 11:25 AM   #5
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 76
You can create a swap partition using the free space on your hard drive (if you have any). You can use fdisk or cfdisk to create the partition and use mkswap to format the partition as swap. To use it immediately you would use the swapon command. You can put an entry for it in /etc/fstab so that its recognised at boot up. You entry would be something like the one below,
Code:
/dev/hda5     swap     swap    defaults    0 0
 
Old 01-31-2006, 11:31 AM   #6
TruongAn
Member
 
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Rep: Reputation: 33
you can also creat a swap device using a file, and then delete it when you find it useless, see man mkswap output
 
Old 02-22-2006, 02:24 AM   #7
nguyennh
Member
 
Registered: Feb 2006
Location: Vietnam
Distribution: FC , RH , SuSE
Posts: 106

Rep: Reputation: 15
mkswap (said by TruongAn) is a tool to create swap file not swap partition . You can use fdisk (for examples) to create swap partition .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to create a swap partition dotancohen Linux - General 4 07-30-2005 12:39 PM
I installed linux and forgot to create a swap space partition Starch Linux - Newbie 5 06-22-2005 08:29 AM
Create swap partition AFTER installing slackware? dx0r515t Slackware 4 05-21-2005 11:29 PM
Can't create swap partition tiger99 Linux - Newbie 23 03-15-2004 09:34 PM
Create swap partition? mikeshn Linux - General 6 11-28-2002 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration