I've lost my swap space

Just noticed that one of my Linodes doesn't have any swap space:

top - 11:13:17 up 13 days,  1:53,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 110 total,   2 running, 108 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    553180k total,   533972k used,    19208k free,    46260k buffers
Swap:        0k total,        0k used,        0k free,   378272k cached

There is a 256MB swap image configured in the Linode Manager.

It's configured in fstab:

[root@vps:~] cat /etc/fstab
/dev/xvda  /  ext3  grpquota,suid,dev,noatime,usrquota,exec  0  1
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/xvdb               swap                    swap    defaults        0 0

But doesn't exist:

[root@vps:~] swapon -a
swapon: cannot stat /dev/xvdb: No such file or directory

[root@vps:~] ls /dev/x*
/dev/xvda

Any suggestions for what I should do? Thanks.

11 Replies

I know you mentioned it's configured in the manager, but is it also marked as an active drive in the configuration profile? It's under Drive Setup.

Yes it is. In Drive Setup I see:

/dev/xvda - CentOS 5.0 Disk Image

/dev/xvdb - 256 MB Swap Image

Did you restart, just to make sure the drive is being recognized by the kernel? My only other guess is that the device node doesn't exist for whatever reason. I'm still on UML, so I can't tell you what the major/minor number is supposed to be.

I'll try a reboot in a few hours, once the workday winds down for clients on the server.

Thanks :)

A reboot from the Linode Manager seems to have fix the issue. The swap space is now there.

@sleddog:

A reboot […] seems to have fix the issue.

Well, duh! The first thing you always try is rebooting the box - don't you know anything about the Microsoft Windows operating system?

James

Sorry but I think you're wrong there – RE-booting is the second thing you do to a Windows box :lol:

FWIW, swapon -a should activate swap space listed in your fstab (haven't tested it on Linode, though).

@Vance:

FWIW, swapon -a should activate swap space listed in your fstab (haven't tested it on Linode, though).

@sleddog:

[root@vps:~] swapon -a
swapon: cannot stat /dev/xvdb: No such file or directory

RTFP.

Thank you for bringing the oversight to my attention.

This is an old thread, but I just wanted to add that this too happened to me about a month ago. I was updated some packages and they failed due to lack of core. I checked and there was no swap device. The block device was not present either.

A reboot fixed my issue as well.

Weird.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct