LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-08-2010, 07:08 AM   #1
kususe
Member
 
Registered: Oct 2010
Posts: 54

Rep: Reputation: 0
Impossible to use swap


I have a problem with my swap on my Debian Squeeze.
This is the output of "free -m"

Code:
   total       used       free     shared    buffers     cached
Mem:           501        491         10          0         28        256
-/+ buffers/cache:        206        295
Swap:            0          0          0
this is my /etc/fstab

Code:
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/hda1 during installation
UUID=0817464a-4ce5-4691-969e-909096babd34 /               ext4    errors=remount-ro 0       1
# /home was on /dev/hda2 during installation
UUID=876840e1-5af7-4c91-80b3-9e5187cdbddf /home           ext4    defaults        0       2
# swap was on /dev/hda3 during installation
UUID=aa037805-a2f5-443e-89f0-fe60cd57f996 none            swap    sw              0       0
this is what I obtain when I use "swapon -a":

Code:
swapon: cannot find the device for UUID=aa037805-a2f5-443e-89f0-fe60cd57f996
Suggestions?
 
Old 11-08-2010, 07:15 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
The command ls-l /dev/disk/by-uuid gives the partitions of the disk and its UUID
You can find out if the UUID of the swap partition has changed or do not exist any more
If the swap file is gone you can create a new one
 
Old 11-08-2010, 07:16 AM   #3
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Use blkid in order to get id of drives/partitions.
Then make changes in fstab. Reboot (you can also use swapon for immediate use).
 
Old 11-08-2010, 07:19 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I haven't used vol_id before myself. I just tried it on a Centos system. I'm not sure it is in the same place on Debian. But this command (as root) may give the info you need:
Code:
/lib/udev/vol_id --uuid /dev/sd*
Edit: While I was testing/typing that others posted suggestions that look at least as good as my suggestion.

Any of those methods should tell you whether you have a swap partition and if so whether it has a UUID and what that is.

It is possible you have an unitialized swap partition, so you would need to use the mkswap command to initialize it before it can be used. See the man page for mkswap.

Last edited by johnsfine; 11-08-2010 at 07:24 AM.
 
Old 11-08-2010, 07:25 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
It's a bit surprizing that the UUID of the partition have changed.

Anyhow try fdisk -l /dev/hda or if unsuccessfull fdisk -l /dev/sda.

Then in /etc/fstab replace the UUID of your swap partition by its device name given by the cfdisk command and reboot.
 
Old 11-11-2010, 09:12 AM   #6
kususe
Member
 
Registered: Oct 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Ok solved.
Uuid in "/etc/fstab" was changed. I copied the Uuid of swap of "blkid" output in /etc/fstab and now it's ok.
Thanks to everybody.

Last edited by kususe; 11-11-2010 at 09:13 AM.
 
  


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
How to swap out (to swap area) page frames a process use? entertainyou Linux - Kernel 3 03-23-2011 09:52 PM
Gparted says swap has 5 Gb, grep SwapTotal /proc/meminfo says swap has 800 Mb rickrandall Red Hat 3 02-24-2010 12:09 PM
Use Windows pagefile.sys (swap) as Linux swap? bluesword1969 Linux - General 3 02-19-2010 02:35 PM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:02 AM.

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