8

I have this error... Slow boot, I've read other questions about that,but I don't know how to Edit fstab

  • Note that I'm dual booting 2 Linux OS

I tried this commend to Open up the fstab:

gksudo gedit /etc/fstab

It comes up like this:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=be7d4a16-5c69-... /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=ad0b043b-68a6-... none            swap    sw              0       0

I use this commend too:

ls -l /dev/disk/by-uuid

What should I do?? Should i just add # in fstab at the beginning of this line?:

UUID=ad0b043b-68a6-... none            swap    sw 

I tried to do that(leaving # and space) but when i wanna save fstab i faced with warning in terminal which says:

** (gedit:13456): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

** (gedit:13456): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

My changed fstab is here:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=be7d4a16-5c69... /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
# UUID=ad0b043b-68a6... none            swap    sw              0       0

A screen shot from gparted: is here

I think The extended partition /dev/sda2 is an other Linux OS that I have in my SSD

/dev/sda1 is root of Ubuntu /dev/sda5 is swap(of other Linux OS?I think)

A Screen shot from 1 TB HDD: is here

There is an error in /dev/sdb5 It is about the free space in my HDD...It's not important.

Sss
  • 1,032

3 Answers3

4

Your swap line in /etc/fstab is incorrect.

Update: We're going to have to create a new separate swap partition for Ubuntu...

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or loose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower part of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot the a Ubuntu Live DVD/USB
  • start gparted
  • resize (shrink) sda1 by moving the right side of the partition to the left, reducing it by 3G
  • create a new swap partition in the newly unallocated 3G space, note the sdaX number
  • click the Apply button
  • quit gparted
  • optional...
    • open terminal
    • type sudo fsck -f /dev/sdb5 # to fix errors on sdb5
  • reboot to Ubuntu

In terminal...

sudo blkid # copy the full /dev/sdaX UUID to the clipboard

sudo cp /etc/fstab /etc/fstab.bak # backup the file first

gksudo gedit /etc/fstab # edit the file, save, and quit gedit

Change this:

# swap was on /dev/sda6 during installation
UUID=ad0b043b-68a6-... none            swap    sw              0       0

To this:

# swap was on /dev/sdaX upon reconfiguration
UUID={put UUID for sdaX here} none            swap    sw              0       0

Notice the ... in the UUID numbers. The number is cut off. You need to use the full UUID taken from the sudo blkid command for /dev/sdaX.

Still in terminal...

sudo swapon -a # observe no errors when enabling swap

reboot

Update #1:

After reviewing a screenshot of gparted, it looks like something else is going on. /dev/sda6 USED to be swap, but now it's a Ext4 partition, and /dev/sda5 is a swap partition. It may be a swap for another OS. I've slightly adjusted my procedure.

Update #2:

Turns out that /dev/sda5 was a swap partition for another OS. We're going to have to create a new separate swap partition for Ubuntu. I'll rewrite some of my procedure. I'll also add a fsck for /dev/sdb5 that has errors.

heynnema
  • 73,649
2

I too have encountered this error, answer #1 should work fine, I am familiar with fstab,terminal, gparted,this is how I fixed in a few minutes. Open terminal type gksugedit locate and open etc/fstab

Open gparted locate swap partition you will be using,right click, select swapoff, if none is present follow heynnema how to create new swap partition,right click again and highlight and copy complete UUID for swap partition, do not close gparted yet

In gedit, highlight existing UUID for swap,right click and paste new swap UUID over old UUID,double and triple check you have complete UUID every digit and save, I also recieved the same error,(gedit:5506): WARNING **: Set document metadata failed, proceed anyway this will not affect the repair

Go back to gparted, select swap partition, right click,slect swapon.

Close everything and reboot. Take notice did boot time improve? Is the error still in your boot log? for me the problem was solved.Thank you heynnema

0

Thanks everyone involved.I know very little on fstab and gksudo. I have the same problem. I did followed @Joe Wicz and have issue fixed. Now it booted fast as always.

I follow your instruction it is easy but with little problems. so I write this comment to help other newbies.

  1. confirm the issue started after re-partition swap file to install 2nd Lubuntu. When I booted Ubuntu it booted so slow I press F1 so it show the start job is running for dev-disk-by x2duuid............... (... 1 min 30 seconds) I took the photo using my mobile phone to record the missing "uuid"

  2. your command "gksugedit" was brief it produce error (I just copied not understood). so I use "gksudo gedit /etc/fstab" from top post, it produce "NO Command.... error with the last line telling me how to install the gksudo. I copied and installed gksudo.

  3. open gparted and find the swap partition. Mouse right click open the new window. go to the last menu "information" click on it. It will provide uuid copy that ID (uuid). (if you see the "swap off" above "information" click "swap off" to turn off the swap partition"

  4. Go back to the terminal key in "gksudo gedit /etc/fstab" (with out the " ") After press enter the new window will pop up.

  5. Check if the last line is the same uuid that you took the photo of the slow booting looking for uuid from No.1, to confirm the issue, mine is the same it means that THIS ubuntu is looking for the swap partition using the old uuid.
  6. I just paste the copied uuid from no.3 and Click SAVE on the top right hand corner. the window will close. Ignore the error in the Terminal.
  7. Go back to Gparted and right click on Swap Partition and click on the Swap ON to make Swap Partition ACTIVE.
  8. Reboot. My Ubuntu is working fast boot as usual.

If you have problems not working as I have done. Please Ask those above 2 gurus. I just dumm follower.

aimwin
  • 25