You are not logged in.

#1 2007-12-03 16:27:35

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

[Solved] Failing to initialize swap?

I have been rebooting alot recently when I noticed that on boot up it was failing to initialize swap!
I used the command free and it returned that swap had zero space! what is going on?
here is my fstab for reference.

# 
# /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/sda1 /boot ext3 defaults 0 1
/dev/sda2 / ext3 defaults 0 1
/dev/sda3 /home ext3 defaults 0 1
/dev/sda5 swap swap defaults 0 0

did it not get formatted properly in the install or something?

Last edited by semperfiguy (2007-12-28 14:52:28)

Offline

#2 2007-12-03 16:34:19

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 1,872

Re: [Solved] Failing to initialize swap?

Just run mkswap /dev/sda5, if you have verified it's really the right partition.


I hate sigs. This one only exists to remind myself to get an avatar.

Offline

#3 2007-12-03 16:38:02

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: [Solved] Failing to initialize swap?

mkswap /dev/sda5 and a reboot worked. Thank You

Offline

#4 2014-05-20 15:11:50

Gezbarb
Member
Registered: 2014-01-19
Posts: 6

Re: [Solved] Failing to initialize swap?

Since this is coming up in the Google results concerning this message, I thought I'd mention a solution to a related problem. In my case, Linux seemed to be renumbering the drives at some point before initializing swap so the swap partition was renamed from /dev/sda2 to /dev/sdc2 and /dev/sda2 became an NTFS partition on another drive. Since /etc/fstab listed /dev/sda2 as swap, and /dev/sda2 now pointed to a partition on another drive, the OS failed to initialize swap.

What seemed to work for me was to change the line in /etc/fstab

/dev/sda2             none            swap            defaults        0 0

to

UUID=50e1a18a-d1d5-452b-99cb-69408befc029       none            swap            defaults        0 0

You'll need to figure out the UUID of your swap partition (it may be listed in /etc/fstab). These are randomly generated when you do mkswap. Just make sure you don't mkswap on the wrong drive because of this renumbering!

Offline

#5 2014-05-20 15:32:53

ANOKNUSA
Member
From: Minneapolis, MN, USA
Registered: 2010-10-22
Posts: 1,937
Website

Re: [Solved] Failing to initialize swap?

Don't necrobump old threads, Gezbarb. Your "solution" is unrelated to this thread; swap was not working for the OP because a swap partition did not exist.

Linux does not change drive order/priority, the motherboard firmware does. Avoiding this is what UUIDs and disk labels are for, as you've discovered.

Offline

#6 2014-05-20 15:37:35

ewaller
Forum Moderator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 9,165

Re: [Solved] Failing to initialize swap?

Closing.  https://wiki.archlinux.org/index.php/Fo … Bumping.22
The exception in the third bullet does not apply here.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
One difference between the two OSs though is that Linux progresses.  The other decays.. --Trilby
----
How to Ask Questions the Smart Way

Online

Board footer

Powered by FluxBB