LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-09-2005, 10:09 PM   #1
jacobselvin
Member
 
Registered: May 2005
Location: Australia
Distribution: SUSE 10.1
Posts: 62

Rep: Reputation: 15
swap device not getting mounted


Hi,
In my PC I have Windows XP and RHL9. When I tried to upgrade from RHL9 to FC 4 I got an error during the begining of installation that the swap device is not found. Then when I checked in my RHL9 I have a entry in my /etc/fstab file
/dev/hdc8 swap swap defaults 0 0

but it's not getting mounted and following is the output of df -k.
[root@TAURUS root]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdc9 30692672 8835872 20297696 31% /
/dev/hdc7 101089 14825 81045 16% /boot
none 515444 0 515444 0% /dev/shm
Can someone help me to mount the swap device? Using which command I can do it and how can I make it permanent.
Thanx in advance.
- Jack
 
Old 07-09-2005, 10:23 PM   #2
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: a few...
Posts: 654

Rep: Reputation: 32
In our /etc/fstab file, do you have a line like so:

/dev/hda2 none swap sw 0 0

Note the /dev/hda2 is where my swap is, it might be different for you. If you don't know where the swap actually is check in cfdisk.

Lastly, if it fails to mount the swap partition, it could be that the swap partition is not formatted correctly - the above still needs to be in place for it being done at boot time, but do add it manually while the system is running do:

addswap /dev/hda2
(again /dev/hda2 is my configuration)

if you need to make the swap partition, use makeswap.
 
Old 07-09-2005, 10:34 PM   #3
jacobselvin
Member
 
Registered: May 2005
Location: Australia
Distribution: SUSE 10.1
Posts: 62

Original Poster
Rep: Reputation: 15
As I mentioned in my first mail I have the following entry in my /etc/fstable file
/dev/hdc8 swap swap defaults 0 0.
But still it is not getting mounted. I tried the suggestion using the addswap. But it says no such command. I tried to locate it in my hard disk without success. How can I find out whether the mounting has failed during the boot time or not? Is there any way to mount it manually?
Thanks in advance,
- Jack
 
Old 07-10-2005, 12:10 AM   #4
gbhil
Member
 
Registered: Jan 2005
Location: /dev/input/chair0
Distribution: Slackware, Gentoo, Vector, Roll-your-own-with-GNU binutils
Posts: 174

Rep: Reputation: 30
first, as suggested, check with cfdisk to be sure which partition is your swap - the following commands will wipe all data from non-swap partitions.
if the swap is indeed /dev/hdc8:
as root -
mkswap /dev/hdc8
swapon /dev/hdc8
 
Old 07-10-2005, 01:19 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,159

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Try
Code:
swapon -s
dmesg | grep swap
These will give some info - the first status from the current system, the latter any startup messages.
 
Old 07-10-2005, 04:21 AM   #6
abunsair
Registered User
 
Registered: Jul 2005
Posts: 56

Rep: Reputation: 15
/dev/hdc8 swap swap defaults 0 0
===================================

doesn't hdc refer to CD rom !
 
Old 07-10-2005, 10:19 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,813

Rep: Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958
swap will not be displayed in the output of the df command.
Look at the output of the free command. If the value of total swap is greater then zero then it is activated.

As stated make sure hdc8 is really a swap partition. You need to be logged as root to run the commands. If running the commands via su then use su - instead to include root environment.

/dev/hdc only refers to the CDROM if the drive is installed in the second IDE controller primary location. In typical PC the hard drive will be /dev/hda and the CDROM /dev/hdc but it does not matter.
 
Old 07-19-2005, 05:41 AM   #8
jacobselvin
Member
 
Registered: May 2005
Location: Australia
Distribution: SUSE 10.1
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks for all the replies.
1. Yes the swap is not getting displayed using the df -k
2. I confirm my swap is activated and when I use the free it displays a non zero value for available space. I can switch it on & off using the swapon & swapoff commands.

But when I upgrade my RHL9 to FC3 and I'm choosing upgrade option while installing, it says the swap partition failed to initialize and the installation fails eventually. Any idea what should be done to over come this?
Thaks in advance,
- Jack
 
Old 07-19-2005, 10:30 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,159

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
RH9 should be 2.4.20(-ish), so should create a type 2 swap space.
Me, I'd
Code:
swapoff /dev/hdc8
mkswap /dev/hdc8
swapon  /dev/hdc8
If you really feel the need to confirm, after all that try
Code:
dd if=/dev/hdc8 bs=1 skip=4000 count=96
Look for SWAPSPACE2 (will probably have the record count, 96, appended right after it).
Then try the upgrade.
 
Old 07-20-2005, 09:48 AM   #10
jacobselvin
Member
 
Registered: May 2005
Location: Australia
Distribution: SUSE 10.1
Posts: 62

Original Poster
Rep: Reputation: 15
strange problem while upgrading RHL9 to FC3

I tried using the mkswap and tried to reinstall again. But I'm still getting the error "Error enabling swap device hdc9 no such file or directory. This most likely means the swap partition is not initialized".
I got to notice a strange thing while installing. Mine is a IDE hard disk and it is installed in secondary IDE controller as master. So when I boot using my RHL9 my partitions are named as hdc1, hdc2 etc and my swap is in hdc9. But FC3 always assumes it as SCSI. And it says existing RHL9 installation found at hda (but which is the instalation CD itself). When I boot in rescue mode using the installation CD and if I run fdisk -l I'm getting all the partitions named hda1, hda2, etc and the swap partition says hda9. From here I couldn't find my hdc partitions. Could you someone help me get out of this mess? (My CD Drive has been installed at the primary IDE controller as master)
Thanx,
- Jack
 
  


Reply



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
SWAP partion not being mounted Boffy Linux - General 6 02-14-2005 03:37 PM
swap partition not mounted after Debian installation codeape Linux - Hardware 4 02-12-2004 03:11 PM
3 issues: Making swap, fixing partitions, changing ownership of mounted filesystem. Dunedain Linux - Newbie 2 01-27-2004 03:52 PM
Mounted Device names Rodzilla Linux - Newbie 7 09-25-2003 10:39 AM
swap partition not being mounted jclark00001 Linux - Newbie 28 02-15-2003 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:59 PM.

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