LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2005, 05:00 PM   #1
xfezz
LQ Newbie
 
Registered: Apr 2005
Posts: 7

Rep: Reputation: 0
Question add swap partition after installation?


This is my first installation of Linux. So im pretty new to this. I installed slackware 9 on an semi old system for learning puproses but I didnt make a swap partition. Is there a way that I can add one after an installation?

system specs
------------------
PII 400mhz
384 MB PC100 RAM
8gig HD
 
Old 04-20-2005, 05:02 PM   #2
Tino27
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: SuSE 8.2, Slackware current, OpenBSD 3.5-3.8, Fedora Core 2
Posts: 400

Rep: Reputation: 30
Check out the man pages for mkswap and swapon.
 
Old 04-20-2005, 05:15 PM   #3
xrado
Member
 
Registered: Dec 2004
Distribution: Zenwalk/Slackware
Posts: 98

Rep: Reputation: 15
of course

make new partition with fdisk for example

#fdisk /dev/yourdevice
type
"n" new
"p" partition
select number
and size
"t"
select number (one you created)
taype "82" (swap id)

"p" see if everything is ok

"w" to make changes (write)

#mkswap /dev/yourdeviceandpartitionnumber

add to /etc/fstab
/dev/yourdeviceandpartitionnumber swap swap defaults 0 0

thats it
 
Old 04-20-2005, 05:58 PM   #4
xfezz
LQ Newbie
 
Registered: Apr 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by xrado
of course

make new partition with fdisk for example

#fdisk /dev/yourdevice
type
"n" new
"p" partition
select number
and size
"t"
select number (one you created)
taype "82" (swap id)

"p" see if everything is ok

"w" to make changes (write)

#mkswap /dev/yourdeviceandpartitionnumber

add to /etc/fstab
/dev/yourdeviceandpartitionnumber swap swap defaults 0 0

thats it
When I select a number for the partition (1-4) it says that there is no free sectors? Im not sure what to do from there.
 
Old 04-20-2005, 07:19 PM   #5
mugwump84
Member
 
Registered: Mar 2005
Distribution: Arch Linux
Posts: 61

Rep: Reputation: 15
It is possible to create a swap file, instead of partition, which is a better option for you

This is an example direct from a book, use man on the commands to figure how to customize it for your own needs

Code:
dd if=/dev/zero of=/swap bs=1024 count=32768
chmod 0600 /swap
mkswap -c /swap 32768
sync
swapon /swap
This creates a 32MB swap file.

the dd command creates and fills the swap file with zeros. the numbers bs option is how many bytes a block is, count is the number of blocks
mkswap makes it actually a swap file, the numbers are the size of the file in kilobytes.
 
  


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
New installation needs Swap and I can't partition it alxr SUSE / openSUSE 2 11-12-2005 06:19 PM
assigning a swap partition after installation Cinematography MEPIS 3 07-28-2005 12:09 PM
problem creating swap partition during installation kristof Red Hat 11 07-03-2004 02:25 PM
Setting up swap partition for new installation tempyyyst Linux - Newbie 5 09-28-2003 11:22 AM
installation - partition / swap problem catch Linux - Software 3 03-10-2002 05:51 PM


All times are GMT -5. The time now is 03:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration