LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2012, 04:45 AM   #16
sam845
Member
 
Registered: Mar 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled

Does someone know what's wrong with my swap?
 
Old 03-13-2012, 05:54 AM   #17
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Quote:
Originally Posted by sam845
I haven't checked all the logs on my system, but I have checked /var/log/dmesg and /var/log/boot, and there was nothing unusual that I could find. In particular, the words 'warning' or 'error' aren't present.
You don't mention this, but I'm assuming you used grep to serach for error and warning. If that is true: Check these log files by hand. Also check /var/log/messages.


Lets see if there are any errors in the fstab file (as michaelk suggested in post #11).

Assumptions based on the posted information:
- swap is present in /etc/fstab,
- swap partition is /dev/sda6.

Execute the following commands, as root user, and post output:
Code:
# is swap activated at the moment:
$ free

# if it is activated turn swap off using /etc/fstab information:
$ swapoff -a

# check if swap is off:
$ free

# if swap is still active:
$ swapoff /dev/sda6

# check if swap is off:
$ free

# use fstab info to mount swap
$ swapon -a

# check if swap is activated:
$ free

# check swap status
$ swapon -s
Let's see what the above tells us....
 
1 members found this post helpful.
Old 03-13-2012, 08:05 AM   #18
sam845
Member
 
Registered: Mar 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Thank you very much sir.
I found the problem, using the commands you mentioned.
swapon -a didn't work, because it said the uuid was not present. It appears the uuid of the swap was changed somehow, since the actual uuid (which I checked using gparted) was different from the one that was in /etc/fstab. I changed /etc/fstab, and now it works like a charm.
I still wonder, though, how that UUID could have been changed without me noticing.
 
Old 03-13-2012, 08:23 AM   #19
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by sam845 View Post
Thank you very much sir.
I found the problem, using the commands you mentioned.
swapon -a didn't work, because it said the uuid was not present. It appears the uuid of the swap was changed somehow, since the actual uuid (which I checked using gparted) was different from the one that was in /etc/fstab. I changed /etc/fstab, and now it works like a charm.
Glad to see you got this fixed!

Quote:
I still wonder, though, how that UUID could have been changed without me noticing.
The UUID is created when you create the actual content (be it mkswap /dev/xxx for a swap partition or mke2fs -jv /dev/yyy for a normal partition). If you would run mkswap /dev/sda6, the UUID would change and it would not be mounted during boot (assuming you did not change the UUID in the /etc/fstab file).

How this could have happened is a good question, 2 "obvious" reasons that I can think of:
- you played with the mkswap command,
- you share swap space with another distro (and it used mkswap during the set-up).

I'm guessing the first one would be the more likely cause.

BTW: Can you put up the [SOLVED] tag.
first post -> Thread Tools -> Mark this thread as solved
 
1 members found this post helpful.
Old 03-28-2012, 04:55 AM   #20
sam845
Member
 
Registered: Mar 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
If I may ask one last question... swapon -a now works, but I just noticed the swap is still not activated by default when the computer reboots. Is there a configuration file problem somewhere ? Manually adding "swapon -a" as a new command to execute when the computer launches probably works, but I was wondering if there was a better way.

Thanks.
 
Old 03-28-2012, 05:07 AM   #21
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If swapon -a works, then your /etc/fstab swap entry is ok and should be used during a (re)boot.

I assume things have changed, can you post the output of the following commands again:
Code:
cat /etc/fstab
free
fdisk -l
Hope this helps.
 
Old 03-28-2012, 06:29 AM   #22
sam845
Member
 
Registered: Mar 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
cat /etc/fstab:
Quote:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s 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 nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=2b662f05-307a-4704-9b7b-52c41a4ec816 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda7 during installation
UUID=32dd7953-711a-4514-8e5b-17a7d3ee5104 /home ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=c1c8cc7c-87b0-4ba3-b7cb-10ac516892db none swap sw 0 0


none vfat noauto 0 0
free -m
Quote:
total used free shared buffers cached
Mem: 982 956 26 0 19 202
-/+ buffers/cache: 735 247
Swap: 3859 96 3763
fdisk -l
Quote:
Disk /dev/sda: 160.0 GB
Disk identifier: 0x00030fb1

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2432 19530752 83 Linux
/dev/sda2 2432 19458 136757249 5 Extended
/dev/sda5 2433 12030 77095935 83 Linux
/dev/sda6 12031 12522 3951958+ 82 Linux swap / Solaris
/dev/sda7 12523 19458 55702528 83 Linux

Last edited by sam845; 03-28-2012 at 06:30 AM.
 
Old 03-28-2012, 07:07 AM   #23
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

All looks the way it should be.....

I'm not a gentoo user, but after a little search this came up:
Quote:
Code Listing 2.4: Display all services in boot runlevel
# ls -l /etc/runlevels/boot/

If you don't see root, procfs, mtab, swap, and fsck in the above listing, perform the following to add them to the boot runlevel:

Code Listing 2.5: Adding critical services to the boot runlevel
# rc-update add root boot
# rc-update add procfs boot
# rc-update add mtab boot
# rc-update add fsck boot
# rc-update add swap boot
If I understand this correctly there should be a swap file present in /etc/runlevels/boot/, if it is not you should run the rc-update add swap boot command.

A word of warning: I'm not a Gentoo user and am not 100% sure this is correct!

Anyway, hope this helps.
 
Old 03-28-2012, 07:20 AM   #24
sam845
Member
 
Registered: Mar 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
The machine we're talking about isn't Gentoo either. I just use this one for the web.
The machine that has that swap issue is Ubuntu 10.04.
Am I still supposed to do what you described above ?
 
Old 03-28-2012, 08:04 AM   #25
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by sam845 View Post
The machine we're talking about isn't Gentoo either. I just use this one for the web.
The machine that has that swap issue is Ubuntu 10.04.
Ok, clear.
Quote:
Am I still supposed to do what you described above ?
Nope, Ubuntu doesn't work the same as Gentoo.

I'm out of idea's, all the info given points to a correct setup. If I look how Ubuntu turns on swap during boot it also uses swapon -a (-v)

As a work-around you could add the /sbin/swapon -a command to the /etc/rc.local file (just before the exit 0 command).
 
  


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 - Newbie

All times are GMT -5. The time now is 03:30 PM.

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