LinuxQuestions.org
Review your favorite Linux distribution.
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-01-2005, 03:42 PM   #1
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Rep: Reputation: 15
Telling Linux what to use as its swap partition


How can I get Linux to recognize its swap partition? Somehow, the information became lost, and it does not realize it has a 1 GB swap partition set aside for it. This is bad, because setup will not let me upgrade to Fedora Core 3 without a swap partition. I have one, but my Core 3 Test 1 install does not recognize it anymore. Little help anyone?

Thanks!
 
Old 01-01-2005, 04:14 PM   #2
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
First of all swap partition must be formated as swap hextype is 82
Secondly you enable it by typing "swapon"
Just an example:
$mkswap /dev/hda2
$swapon /dev/hda2

Last edited by SlackerLX; 01-01-2005 at 04:15 PM.
 
Old 01-01-2005, 04:16 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,229

Rep: Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217
First do you know what partition your swap should be? Log in as root and enter the follow command:
fdisk -l (that is a small L)

Check the /etc/fstab file and see if it matches. Look for
/dev/hdxy swap swap defaults 0 0 (or similar). Where xy is the drive a partition ID.

Look at the output of the free command. If total swap space is 0 then it isn't activated.
To activate swap
swapon /dev/hdxy (again replace xy with the ide of thepartition)

If your getting errors activating the drive then you can reformat swap with the command.
mkswap /dev/hdxy

The try a swapon command again. Check the output of the free command to see if everything is working.
 
Old 01-01-2005, 04:32 PM   #4
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks guys. Three problems.

First: No fdisk.
[root@pcp04376218pcs danny]# fdisk -l
bash: fdisk: command not found

I found the swap partition anyway, though. It's /dev/hdf6.

Second and third: No swapon or mkswap either.
[root@pcp04376218pcs danny]# swapon /dev/hdf6
bash: swapon: command not found
[root@pcp04376218pcs danny]# mkswap /dev/hdf6
bash: mkswap: command not found

Any pointers?

Thanks!

P.S. Running Fedora Core 3 Test 1, as mentioned above.

Last edited by timelord726; 01-01-2005 at 04:36 PM.
 
Old 01-01-2005, 04:36 PM   #5
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Please, be sure that you enter commands like "fdisk" or "cfdisk" as superuser, in fact, CFDISK is easier to use
$su
<PW>
$cfdisk
 
Old 01-01-2005, 04:40 PM   #6
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Original Poster
Rep: Reputation: 15
I am logged in as root. fdisk, cfdisk, swapon, and mkswap all come up with command not found errors.
 
Old 01-01-2005, 04:46 PM   #7
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Easy solution is, of course, LiveCD, which has all options you need for lowformatting
 
Old 01-01-2005, 05:01 PM   #8
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Original Poster
Rep: Reputation: 15
Is there another way to go through with this without LiveCD? Alternatively, how do I get LiveCD? (Alternate solution would be more appreciated.)
 
Old 01-01-2005, 05:06 PM   #9
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
OK. First answer to second question. Any distro as well as LiveCD my be downloaded free at http://distrowatch.com
Second, let us try again, shall we:
CTRL+ALT+F1
$login
<PW>
$cfdisk
 
Old 01-01-2005, 05:07 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 16,744

Rep: Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473Reputation: 2473
Quote:
Originally posted by timelord726
I am logged in as root. fdisk, cfdisk, swapon, and mkswap all come up with command not found errors.
Sounds like you don't have your path set correctly.
Try /sbin/swapon /dev/????
fdisk and mkswap should also be in /sbin
 
Old 01-01-2005, 05:10 PM   #11
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
syg00 may be also right in this case.
Try what he wrote....
 
Old 01-01-2005, 07:18 PM   #12
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Ah, come on, please. Log in as root correctly. That means, use su --login or the two short-forms su -l or su -, but don't use just "su". It's not enough. Then run:

parted /dev/hda print
 
Old 01-01-2005, 07:30 PM   #13
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by misc
Ah, come on, please. Log in as root correctly. That means, use su --login or the two short-forms su -l or su -, but don't use just "su". It's not enough.
Wow, sorry, sir. You don't need to snap at people who don't know as much about Linux as you. The "su" command has worked for me in the past, so jeez. My sincere apologies for not being perfect.

I found and fixed the problem and am now confronted with a new one though. I recently installed a new hard drive, and for some reason it started looking for the swap partition in the same spot on the new drive. Fixed that, and both Linux and FC3 setup worked correctly. I got my installation upgraded to Fedora Core 3, but now whenever I boot it, it refuses to load at all.

It does:

Initializing hardware: network (something else I can't remember) audio [ OK ]

Then it does:

Configuring kernel parameters:

And just stops and won't boot past that. This problem just went from marginally annoying to very serious...

Thanks for your help.
 
Old 01-01-2005, 07:38 PM   #14
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Quote:
Originally posted by timelord726

I found and fixed the problem and am now confronted with a new one though.
It does:
timelord726!
Please, take time to reply when the initial problem is fixed, because people keep posting regarding the initial one. We take time to help you - you take time to at least notify.

Regards
 
Old 01-01-2005, 07:40 PM   #15
timelord726
Member
 
Registered: Jul 2004
Distribution: Ubuntu 4.10 Warty
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by SlackerLX
timelord726!
Please, take time to reply when the initial problem is fixed, because people keep posting regarding the initial one. We take time to help you - you take time to at least notify.
Umm... I thought I just did that. I fixed it, and then I notified you as soon as I could. Do you expect me to just hop onto my cell phone and use its internet access to post on here when my computer is otherwise occupied? Once again, sorry for not being perfect...
 
  


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
doing away with linux swap partition? kahn Linux - Hardware 3 06-26-2005 04:14 PM
telling linux to use not ram but swap ? supersucker Linux - Newbie 5 05-19-2005 05:28 PM
16 GB of RAM and Linux still uses over 1 GB of a 2 GB swap partition!? lumberjack77 Linux - Software 8 09-25-2003 01:07 PM
Swap partition in Linux mikeshn Linux - General 5 04-15-2002 10:22 AM
Linux put the swap partition on my second HD. Don't want it there. rdaves@earthlink.net Linux - General 3 09-21-2001 08:42 AM

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

All times are GMT -5. The time now is 04:49 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