You are not logged in.
Pages: 1
A couple days ago, I had tried clearing my swap space by using swapoff and then swapon, because I didn't feel like rebooting my system to clear it. However, running swapon did not work. Running sudo swapon -L /dev/sda2 gives me the message "swapon: cannot find the device for /dev/sda2". So I rebooted, figuring that would fix the problem. Now, when I booted up my computer this morning, I saw that it apparently didn't work. When the boot process gets to the part where it activates the swap space, it says "fail."
How do I fix this?
Last edited by Falcata (2008-06-19 17:16:52)
Offline
I don't think your disk has the label "/dev/sda2". So using the swapon -L switch seems strange. But I don't know why it doesn't work on startup. Does "sudo swapon -a" work? If not, please post the output and your /etc/fstab.
Offline
Running "sudo swapon -a" gives me this:
swapon: /dev/sda2: Invalid argument
And here's my /etc/fstab:
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
# /dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0
# /dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0
# /dev/fd0 /mnt/fd0 vfat user,noauto 0 0
/dev/sda1 /boot ext2 defaults,noatime,nodiratime 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext3 defaults,noatime,nodiratime,data=journal 0 1
/dev/sda4 /home ext3 defaults,noatime,nodiratime,data=journal 0 1
And just in case it's relevant, here's my /etc/mtab:
/dev/sda3 / ext3 rw,noatime,nodiratime,data=journal 0 0
none /dev ramfs rw 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0
none /dev/shm tmpfs rw 0 0
/dev/sda1 /boot ext2 rw,noatime,nodiratime 0 0
/dev/sda4 /home ext3 rw,noatime,nodiratime,data=journal 0 0
/dev/sr0 /media/Oblivion udf ro,nosuid,nodev,uid=1000 0 0
EDIT: Here's my /proc/partitions, since it's mentioned in the manpage for swapon:
major minor #blocks name
8 0 78125000 sda
8 1 72292 sda1
8 2 1052257 sda2
8 3 38796975 sda3
8 4 38202570 sda4
Last edited by Falcata (2008-06-19 15:41:24)
Offline
Ok, time for stupid questions. Do /dev/sda2 exist? Is it a swap partition?
Offline
How about running `mkswap /dev/sda2 && swapon /dev/sda2` ?
Offline
How about running `mkswap /dev/sda2 && swapon /dev/sda2` ?
how about checking it's the right partition first!
But if he messes his installation even more this means more posts on this forum and a bigger community (hell, I'm torn apart)
Offline
Well, it appears to have worked. Thanks for the help.
Offline
If it's fixed, please mark the topic as [SOLVED]
Offline
Falcata: One small curiosity, what is the output of
fdisk -l /dev/sda
?
sniffles wrote:How about running `mkswap /dev/sda2 && swapon /dev/sda2` ?
how about checking it's the right partition first!
But if he messes his installation even more this means more posts on this forum and a bigger community (hell, I'm torn apart)
/etc/fstab seemed to indicate that /dev/sda2 was his designated SWAP partition (i.e. the one he was using as swap before running swapoff). /proc/partitions indicated that /dev/sda2 did in fact exist.
Last edited by sniffles (2008-06-19 17:29:24)
Offline
Running fdisk gives me this output:
Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x09449bca
Device Boot Start End Blocks Id System
/dev/sda1 * 1 9 72292 83 Linux
/dev/sda2 10 140 1052257+ 82 Linux swap / Solaris
/dev/sda3 141 4970 38796975 83 Linux
/dev/sda4 4971 9726 38202570 83 Linux
Offline
Looks good. Cheers.
Offline
Pages: 1