Swap off !

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
pennylurcher
Level 1
Level 1
Posts: 21
Joined: Wed Nov 21, 2007 1:59 pm

Swap off !

Post by pennylurcher »

Mint 5 was running perfect on my old hard drive.
My son bought me a new hard drive for fathers day so I copied my mint 5 on to it from my old hard drive using Acronis Backup.
Everything is working great ,but, if I go into Partition Editor swop is off !
I have to go in and turn it on Manually in Partition Editor each time I restart my computer.
How do I fix it please?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

Re: Swap off !

Post by 67GTA »

Look in your file system and post a copy of your /etc/fstab file. Also post the output of

Code: Select all

sudo fdisk -l
from a terminal.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
pennylurcher
Level 1
Level 1
Posts: 21
Joined: Wed Nov 21, 2007 1:59 pm

Re: Swap off !

Post by pennylurcher »

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda5
UUID=e1ed2f0f-22d7-4339-9534-4ed39e9687c2 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda6
UUID=c07ff63a-1b38-4d06-a2b5-432d0ada70aa none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0

========================================================================================
I did the sudo fdisk -1 and got this ?

fdisk: invalid option -- 1

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors
=============================================================================
so I did sudo fdisk -l
this is what I got

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd5718b35

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9082 72951133+ 7 HPFS/NTFS
/dev/sda2 9083 30401 171244867+ 5 Extended
/dev/sda5 9083 29966 167750698+ 83 Linux
/dev/sda6 29967 30401 3494106 82 Linux swap / Solaris

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0xf3e7f3e7

Device Boot Start End Blocks Id System
/dev/sdb1 1 155060 78150208+ 7 HPFS/NTFS
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

Re: Swap off !

Post by 67GTA »

That looks normal. I thought maybe the partition numbering had been altered when it was copied to the new HD. You can check to see if it is being used with

Code: Select all

cat /proc/sys/vm/swappiness
Also try turning it on with

Code: Select all

sudo swapon -a
See if these commands give you any relevant errors. Check with the partition manager to see if the swap partition is active, and what flags it has(right click on the partition). If none of that gets you any closer, then probably the easiest thing to to would be to use a live CD and the partition manager to just deleted and recreate the swap partition.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
rbanavara

Re: Swap off !

Post by rbanavara »

Also its worth verifying the UUID (ubuntu based systems use UUID instead of partition numbers)

from fstab:
# /dev/sda6
UUID=c07ff63a-1b38-4d06-a2b5-432d0ada70aa none swap sw 0 0

Just the swap partition still has the same UUID (run vol_id /dev/sda6, probably as root), If they are not same, update the entry in fstab with correct UUID and try. If not , you can try out 67GTA's suggestions
pennylurcher
Level 1
Level 1
Posts: 21
Joined: Wed Nov 21, 2007 1:59 pm

Re: Swap off !

Post by pennylurcher »

cat /proc/sys/vm/swappiness
60
===================================
sudo swapon -a
swapon: cannot canonicalize /dev/disk/by-uuid/c07ff63a-1b38-4d06-a2b5-432d0ada70aa: No such file or directory
swapon: cannot stat /dev/disk/by-uuid/c07ff63a-1b38-4d06-a2b5-432d0ada70aa: No such file or directory

====================================
I restarted the computer with the cd ,deleted the swap file , re installed it.
turned computer off then on again ,went into partition editer the swap file is turned off !!
I have to click on swapon to turn it on.
MagnusB
Level 6
Level 6
Posts: 1252
Joined: Sun Nov 18, 2007 12:39 pm
Location: Norway

Re: Swap off !

Post by MagnusB »

You might have some UUID issues, edit fstab and change the UUID to /dev/sda6 (assuming that is the swap partition).
Image
You're not drunk if you can lie on the floor without holding on.
--Dean Martin
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

Re: Swap off !

Post by 67GTA »

I think MagnusB and rbanavara have it right. Open a terminal and run

Code: Select all

sudo blkid
This will show you the UUID of your partitions. Check your UUID for sda6 against the one shown in fstab. MagnusB has the best solution for fixing that.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
pennylurcher
Level 1
Level 1
Posts: 21
Joined: Wed Nov 21, 2007 1:59 pm

Re: Swap off !

Post by pennylurcher »

Thank-you very much for your help ,you've solved my problem :D
the UUID'S were different, edited the fstab one and everything is OK now.
Best wishes
Bernard (g6tet)
Locked

Return to “Beginner Questions”