PDA

View Full Version : [SOLVED] No Swapon at Boot and No fstab



rbscairns
January 21st, 2010, 05:42 AM
My HDD is partitioned as shown in the attached Gparted Screenshot. The problem is that whenever I boot, I need to go into Pgarted to set Swap on for the linux-swap partition.

I think this may have something to do with the fstab (file system table) file /etc/fstab. File Browser shows this file as having 0 bytes. When I open this file using gedit Text Editor, the file appears to be empty.

Am I going down the correct path and, if so, how do I get a working fstab file?

warfacegod
January 21st, 2010, 05:55 AM
Here's mine. You'll have to modify it to reflect your UUID, hardware and partition scheme but I don't see why replacing yours won't work. Keep in mind that my swappiness is zero.


# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sda1 :
UUID=5088cbe7-0042-4b4d-932a-2f8ccc675f98 / ext4 errors=remount-ro 0 1
# Entry for /dev/sda5 :
UUID=3ca8c2c4-854a-4b7b-bb28-6df2bf1fff1e none swap sw 0 0

warfacegod
January 21st, 2010, 05:57 AM
I forgot to mention that you can use Gparted to get your UUID's. Right click the drive and select Information.

rbscairns
January 21st, 2010, 06:21 AM
I made the following file-
# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sda1 :
UUID=81a4491a-f076-42d9-b94b-ff7fb61c9527 / ext4 errors=remount-ro 0 1
# Entry for /dev/sda5 :
UUID=3df805fa-9adf-40f4-b1e4-c551f3e7525f none swap sw 0 0Used the UUID's that I got from Gparted for my /dev/sda1 and /dev/sda5 partitions.

I don't know what swappiness is so only changed the UUID's in your example file.

I am unable to save the fstab file in /etc as it appears that I don't have permission. As a temporary measure, I have saved my new fstab file in /home/myname/Documents.

What should I do next?

Cheezespread
January 21st, 2010, 06:38 AM
Are you logged in as root ?.As in the super-user ?

try
sudo gedit /etc/fstab from the terminal . Then try to paste contents. That should let you save the file.

rbscairns
January 21st, 2010, 07:38 AM
Thanks Cheesespread. That worked. Now swap on is the default state at bootup.

It there a way to check that my swap file system is now properly working?

This is what I now get in Gparted after a reboot-

Cheezespread
January 21st, 2010, 09:26 AM
free -m or

topshould give you the memory details . I am not sure if the SWAP will be used if you had a good enough RAM . If you have some memory intensive apps running and if you Swappiness is left high ( default is 60 i reckon) , you should see the swap memory usage as well.

Elfy
January 21st, 2010, 09:57 AM
I'd be a bit concerned about the fstab - here you appear to have one

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

Edit - if you have edited/deleted it check to see if you have a backup


ls /etc/fstab*

porchrat
January 21st, 2010, 12:54 PM
I forgot to mention that you can use Gparted to get your UUID's. Right click the drive and select Information.

I didn't know Gparted had that functionality. I always used to instruct people to use the terminal ("blkid"), but it is far simpler to just get them to use the GUI.

Not that I think the constant reliance on GUIs is necessarily helpful as all users at some point are going to need to familiarise themselves with the terminal.

warfacegod
January 21st, 2010, 01:53 PM
I didn't know Gparted had that functionality. I always used to instruct people to use the terminal ("blkid"), but it is far simpler to just get them to use the GUI.

Not that I think the constant reliance on GUIs is necessarily helpful as all users at some point are going to need to familiarise themselves with the terminal.

I agree. GUI reliance can be a serious hindrance. However, I have also seen too many users get totally flustered and lost when several posts come into a thread, all spouting different Terminal Commands. The Terminal has a look and feel to it that makes many users fear fragging their systems with it. Especially when commands are posted without any real explanation as to what they do.

GUI's and the Terminal both have their places and uses.

Besides, if GUI's were that bad, we'd all be staring at black screens and text!

rbscairns
January 22nd, 2010, 01:02 AM
I'd be a bit concerned about the fstab - here you appear to have one

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

Edit - if you have edited/deleted it check to see if you have a backup


ls /etc/fstab*
Yes, I had an fstab file before but lost it. I think it was when using some of the code in the quoted link. One problem solved then created another problem.

When I use
ls /etc/fstab*I assume what I am doing here is a search in the /etc folder for a list of all files starting with the name fstab (the * being a wildcard). The result I get is
/etc/fstab /etc/fstab~The /etc/fstab is obviously the fstab that I created from Warfacegod's post above. I have no idea on the /etc/fstab- result as it does not appear in the file browser when looking at the files in /etc. Maybe it is some sort of hidden file that I am not meant to ever know about.

rbscairns
January 22nd, 2010, 01:14 AM
free -m or

topshould give you the memory details . I am not sure if the SWAP will be used if you had a good enough RAM . If you have some memory intensive apps running and if you Swappiness is left high ( default is 60 i reckon) , you should see the swap memory usage as well.
Again thank you Cheezespread. I used
free -mas you suggested (not knowing what it means) and looks like it lists a memory usage summary. My summary is
total used free shared buffers cached
Mem: 2005 815 1189 0 87 506
-/+ buffers/cache: 222 1783
Swap: 4102 0 4102so it looks like my system does have the Swap partition available.
topgives me a lot of info, but most is currently beyond my comprehension.

warfacegod
January 22nd, 2010, 01:26 AM
Hidden files can be viewed in the browser by hitting Crtl+H

rbscairns
January 22nd, 2010, 01:55 AM
Thank you. As you may see, I am still learning, but I am learning.

My /etc/fstab- is a zero size file and Gedit also shows it as empty. Looks like I have well and truly lost my original fstab.

Not to worry, Warfacegod set me straight.

Next will be to try and get Hibernate and Suspend to work. First a search, then study and finally a new topic if I cannot solve my problem.

warfacegod
January 22nd, 2010, 02:43 AM
Thank you. As you may see, I am still learning, but I am learning.

My /etc/fstab- is a zero size file and Gedit also shows it as empty. Looks like I have well and truly lost my original fstab.

Not to worry, Warfacegod set me straight.

Next will be to try and get Hibernate and Suspend to work. First a search, then study and finally a new topic if I cannot solve my problem.

Does that mean that putting your UUID's in my fstab worked?

rbscairns
January 22nd, 2010, 07:10 AM
Does that mean that putting your UUID's in my fstab worked?Yes, it is now working great. Your assistance is very much appreciated and I am learning more with each problem solved.