Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

My Ongoing Linux/Ubuntu Swap Issues


  • Please log in to reply
59 replies to this topic

#1 Rocky Bennett

Rocky Bennett

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 20 January 2016 - 10:52 AM

First of all, this is a continuation of ongoing issues that I have encountered with my swap area, as documented in this thread http://www.bleepingcomputer.com/forums/t/601300/triple-boot-partitioning/. I have to thank Al for his patience, but because this topic is different than the subject of the original thread, then I have created this separate thread.

 

My current issue is the assigned swap area that I configured does not automatically turn on when I restart into Ubuntu. When I start up my Linux 17.3, I can go into system monitor and see that the swap area is active. This action must happen automatically upon startup. When I restart into my Ubuntu 15.10 and go into system monitor, I see that the swap area is not activated. Today I simply followed the directions at this site http://superuser.com/questions/22081/turn-on-swap-memory-on-ubuntu in order to activate the swap area. It really wasn't difficult to turn on the swap area, but I would really like to have this action done automatically on startup. Is there a way that I can do this?

 

I will provide screenshots and/or any other information that is requested so that I can work this situation out. Thanks in advance to everyone in my ongoing Linux journey.

 

Rocky Bennett


594965_zpsp5exvyzm.png


BC AdBot (Login to Remove)

 


#2 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:07:39 AM

Posted 20 January 2016 - 11:36 AM

So you've got multiple distributions installed, using the same partition for swap?  Sorry, I haven't read the other thread yet.  When you are booted into Ubuntu 15.10, what are the contents of /etc/fstab?  Does it have an entry pointing to the correct partition as sw?  If you have the device as "/dev/xxxxx" it may not be correct for the Ubuntu boot, but correct for the other one.  That's where the UUID can help.   When you are "activating swap" exactly what commands are you doing?  Just swapon or the whole mkswap, swapon, etc?


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#3 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 20 January 2016 - 12:05 PM

So you've got multiple distributions installed, using the same partition for swap?  Sorry, I haven't read the other thread yet.  When you are booted into Ubuntu 15.10, what are the contents of /etc/fstab?  Does it have an entry pointing to the correct partition as sw?  If you have the device as "/dev/xxxxx" it may not be correct for the Ubuntu boot, but correct for the other one.  That's where the UUID can help.   When you are "activating swap" exactly what commands are you doing?  Just swapon or the whole mkswap, swapon, etc?

 

 

Today I just used the swap on command and it seemed to work. Yesterday I went through a whole lot more commands, but they might not have been necessary.


594965_zpsp5exvyzm.png


#4 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:07:39 AM

Posted 20 January 2016 - 01:47 PM

What form of the swapon command did you use?  swapon -a  or swapon /dev/xyz?  The first would go and read /etc/fstab to find swap devices and activate them, which means you have  it in /etc/fstab.  If you used the second, then you may need to add a line to /etc/fstab.

 

Here's something that's a bit old, but should still be valid

http://ubuntuforums.org/showthread.php?t=1073802


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#5 pcpunk

pcpunk

  • Members
  • 5,855 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:07:39 AM

Posted 20 January 2016 - 02:23 PM

RB, Here is another of Al's directions that were made for me, but it will show you how to go through the procedure again to check if swap UUID is correct in /etc/fstab .  Do this while in Ubuntu, check it, if it is wrong Edit the File and save it - Re-Boot.  Or if you like the original directions in the link you provided use that, but my thread is pretty short and simple.

http://www.bleepingcomputer.com/forums/t/594197/how-to-activate-swap-file/#entry3847478

 

If you are still having issues then post your Terminal info so it can be looked at:

sudo blkid

And

cat /etc/fstab

Edited by pcpunk, 20 January 2016 - 02:30 PM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#6 NickAu

NickAu

    Bleepin' Fish Doctor


  • Moderator
  • 13,247 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:127.0.0.1 Australia
  • Local time:09:39 PM

Posted 20 January 2016 - 04:15 PM

If you are using hibernate then each distro must have its own swap.


Arch Linux .
 
 Come join the fun, chat to Bleeping computer members and staff in real time on Discord.
 
The BleepingComputer Official Discord Chat Server!


#7 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 20 January 2016 - 04:21 PM

Thanks guys. Today I have my Grand kids over so I can't delve into this.

 

mremski, I used the swap on dev/xyz command.

 

Nick, I was not really using hibernate per say, all I did was hit restart.

 

I am going to have to delve into this later.

 

Thanks.


594965_zpsp5exvyzm.png


#8 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 21 January 2016 - 06:57 AM

Thanks again to everybody that is trying to help me. Here is part of the out put;

 

rocky@rocky-All-Series:~$ sudo blkid
[sudo] password for rocky:
/dev/sda1: LABEL="My Stuff" UUID="BCB0A7DEB0A79E00" TYPE="ntfs" PARTUUID="000af26d-01"
/dev/sda3: UUID="cd3b2eb6-8a72-46a4-81e4-dc4022802427" TYPE="swap" PARTUUID="000af26d-03"
/dev/sda4: UUID="5656cc39-2d72-4e76-91a7-073c25607f0d" TYPE="ext4" PTTYPE="dos" PARTUUID="000af26d-04"
/dev/sda5: UUID="34141e98-3a44-4d8f-b1d8-9591f0bc1808" TYPE="ext4" PARTUUID="000af26d-05"
/dev/sdb1: UUID="c71361a2-2dca-4961-b56d-c6303b9222c3" TYPE="ext4" PARTUUID="00030ed0-01"
/dev/sdc1: LABEL="System Reserved" UUID="78F444CDF4448EF6" TYPE="ntfs" PARTUUID="6729d5f9-01"
/dev/sdc2: UUID="169C46E49C46BE4D" TYPE="ntfs" PARTUUID="6729d5f9-02"
/dev/sdd1: LABEL="Elements" UUID="2EC6C3B6C6C37D19" TYPE="ntfs"
/dev/sde1: LABEL="My Book" UUID="3690AD2E90ACF591" TYPE="ntfs" PARTUUID="6c81475f-01"
rocky@rocky-All-Series:~$
 

 

And here is part of the output;

 

rocky@rocky-All-Series:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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>
# / was on /dev/sda2 during installation
UUID=5656cc39-2d72-4e76-91a7-073c25607f0d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
#UUID=1c938257-88d9-49b8-a300-86983d10320c none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0
rocky@rocky-All-Series:~$
 

 

The funny thing is that the UUID is correct for my swap partition when I ran the first command. I hope that this info helps.


594965_zpsp5exvyzm.png


#9 Al1000

Al1000

  • Global Moderator
  • 7,700 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:12:39 PM

Posted 21 January 2016 - 07:33 AM

I can see what the problem is. You need to change this UUID in /etc/fstab:
 

#UUID=1c938257-88d9-49b8-a300-86983d10320c none            swap    sw              0       0

 
..to this one:
 

/dev/sda3: UUID="cd3b2eb6-8a72-46a4-81e4-dc4022802427" TYPE="swap" PARTUUID="000af26d-03"

 
 
Also, uncomment the line in /etc/fstab (remove the # symbol)
 
You did all of this before, presumably with Mint, so just do the same again with Ubuntu. Basic instructions are in post #44 in the other thread, beginning at the section "Now all that remains to be done is to edit a file in Ubuntu, so that it recognises the new swap partition and mounts it automatically."
 
For more detailed instructions, please refer to posts #74, #75 and #76 in the same thread.
 
This is what you want /etc/fstab to look like:
 
 

rocky@rocky-All-Series:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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>
# / was on /dev/sda2 during installation
UUID=5656cc39-2d72-4e76-91a7-073c25607f0d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
UUID=cd3b2eb6-8a72-46a4-81e4-dc4022802427 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0


Edited by Al1000, 21 January 2016 - 07:37 AM.


#10 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:07:39 AM

Posted 21 January 2016 - 07:48 AM

Thanks Al, that all confirms where I was heading with it.


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#11 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 21 January 2016 - 07:52 AM

Thanks Al. I will work on this and report back.


594965_zpsp5exvyzm.png


#12 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 21 January 2016 - 11:33 AM

Al, the problem that I am having is that I followed the steps in post #44 completely through twice, and it only worked until I restarted the computer. I am going to it one more time and then restart my system.


594965_zpsp5exvyzm.png


#13 Rocky Bennett

Rocky Bennett
  • Topic Starter

  • Members
  • 2,667 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Mexico, USA
  • Local time:05:39 AM

Posted 21 January 2016 - 12:56 PM

OK, I just edited my fstab folder again in the text editor, and I closed everything and then reopened the fstab folder in the text editor and the new information was still there. Then I restarted the system and again the old information was back in the fstab folder. I need to figure out how to edit that folder and keep it saved even through restarts.


594965_zpsp5exvyzm.png


#14 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:07:39 AM

Posted 21 January 2016 - 01:58 PM

OK, I just edited my fstab folder again in the text editor, and I closed everything and then reopened the fstab folder in the text editor and the new information was still there. Then I restarted the system and again the old information was back in the fstab folder. I need to figure out how to edit that folder and keep it saved even through restarts.

That is odd.  When you restarted, you booted back into Ubuntu or whatever you were in while editing?  Permissions on the file?  Did you edit as root or via sudo?


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#15 Guest_GNULINUX_*

Guest_GNULINUX_*

  • Guests
  • OFFLINE
  •  

Posted 21 January 2016 - 03:02 PM

gksudo gedit /etc/fstab

Use gedit or replace it with the editor you prefer...  :wink:
 
Greets!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users