Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
# /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
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!
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 ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.