View previous topic :: View next topic |
Author |
Message |
ponx n00b
Joined: 07 Nov 2004 Posts: 13 Location: UK
|
Posted: Sun Nov 07, 2004 4:30 pm Post subject: swapon cannot find /dev/swap..?! |
|
|
Since allowing my newly upgraded system to update 37 or so config files under /etc, I now get the following line during boot:
swapon: cannot find /dev/swap: no such file or directory (or words to that effect)
I had a look in /dev and it wasn't kidding - there was no swap file or dirctory listed! My fstab remains unchanged from before the update.
Does this mean my swap partition is not active?
How do I resolve this error?
Thanx in advance.
ponx _________________ ----------------------
Excuse me for butting in, but I'm interrupt driven... |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54817 Location: 56N 3W
|
Posted: Sun Nov 07, 2004 4:50 pm Post subject: |
|
|
ponx,
You have trashed your /etc/fstab with etc-update and probably other things as well. You need to fix it so that the /dev/BOOT, /dev/SWAP and /dev/ROOT point tothe actual partitions, just as you did at the original install. (replace the words in uppercase). _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Nov 07, 2004 4:54 pm Post subject: |
|
|
still IF he did hose is /etc/fstab with a etc-update (done that once - NEVER again!!) how did he boot into his system since hte root entry would have been reset as well??? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54817 Location: 56N 3W
|
Posted: Sun Nov 07, 2004 5:02 pm Post subject: |
|
|
Naib,
The root filesystem is mounted using the root= entry in the kernel command line in grub.conf.
Think about it, the kernel cannot read /etc/fstab to find root until the root filesystem is mounted. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Nov 07, 2004 5:09 pm Post subject: |
|
|
NeddySeagoon wrote: | Naib,
The root filesystem is mounted using the root= entry in the kernel command line in grub.conf.
Think about it, the kernel cannot read /etc/fstab to find root until the root filesystem is mounted. |
doh!!! Homer effect, yup you are right - soo dumb
def overwriting working /etc/fstab with default |
|
Back to top |
|
|
ponx n00b
Joined: 07 Nov 2004 Posts: 13 Location: UK
|
Posted: Mon Nov 08, 2004 11:52 am Post subject: |
|
|
As far as I can tell, my fstab file is intact. The correct hd partitions are mounted, even the ntfs is correctly mounted at boot time.
The file /dev/swap is missing though (I assume it was there before, otherwise swapon would've complained then too).
Any other ideas?
ponx. _________________ ----------------------
Excuse me for butting in, but I'm interrupt driven... |
|
Back to top |
|
|
john36 Tux's lil' helper
Joined: 16 Jul 2002 Posts: 141 Location: Boston
|
Posted: Mon Nov 08, 2004 9:57 pm Post subject: |
|
|
Post your /etc/fstab so we can do more than speculate.
Also if you can run fdisk on the drive where swap is supposed to be that might be useful as well. |
|
Back to top |
|
|
ponx n00b
Joined: 07 Nov 2004 Posts: 13 Location: UK
|
Posted: Mon Nov 08, 2004 9:58 pm Post subject: |
|
|
Ok, I have a further clue:
In /etc/fstab I changed the device section of the swap line from /dev/swap to /dev/hda3 and the error changed to:
swapon: /dev/hda3: Device or resource busy
So does this mean that the swap space is being initialised twice somehow?
ponx. _________________ ----------------------
Excuse me for butting in, but I'm interrupt driven... |
|
Back to top |
|
|
ponx n00b
Joined: 07 Nov 2004 Posts: 13 Location: UK
|
Posted: Wed Nov 10, 2004 2:35 pm Post subject: |
|
|
Right, here's an update on my investigation of this problem...
Firstly, I can't cut 'n' paste my fstab file coz it's on a nearly-fresh X-less installation of Gentoo on my laptop. I'm doing this forum thing from work! However, my fstab file is fine, trust me - it has the following line:
/dev/swap none swap sw 0 0
Or something like that.
But anyway, during boot, before I get the login prompt, I can see the following line where my original error message was:
Activating (possibly) more swap...
swapon: cannot find /dev/swap: No such file or directory [!!]
Now I framebuffered my console, I can see another line printed further up the screen:
Activating (possibly) swap... [ok]
So, my swap space is getting set up twice ?! I did a grep for swap through every file under the /etc tree, and in the file /etc/init.d/local.mount (or some similarly named file - I'm writing all this from memory as my laptop is at home) I saw the line about activating more swap (above).
Ok then, does anyone know why my swap is being activated twice, or is that normal? And, what part of the boot sequence is activating it the first time?
I may try and comment out the line '/sbin/swapon -a' in the /etc/init.d/local.mount and see if that works, but I'm not happy having to hack prewritten startup scripts.
ponx. _________________ ----------------------
Excuse me for butting in, but I'm interrupt driven... |
|
Back to top |
|
|
Pepek Guru
Joined: 25 Apr 2004 Posts: 313 Location: Tarnowskie Góry - Poland - Europe
|
Posted: Thu Nov 11, 2004 4:03 am Post subject: |
|
|
ponx wrote: | However, my fstab file is fine, trust me - it has the following line:
/dev/swap none swap sw 0 0
Or something like that. |
This is not fine. You have to change this /dev/swap to the /dev/hdXY, where X is a letter for your disk and Y is a number of your swap partition. I.e. my line about swap in the /etc/fstab is sth like that :
Code: | /dev/hda5 none swap defaults 0 0 |
If you don't know what partition is your swap partition, then do that : Code: | # fdisk -l | grep swap |
Cheers. _________________ For Polish users :
$ man mas
Nie ma strony manuala dla mas
For Other users :
Sorry for my english, I know it's bad, but I think it's at least understandable |
|
Back to top |
|
|
|