Ubuntu – Reset ‘Disks’ package to automount at startup using command line

automountboothard drivemountpartitioning

I am using Ubuntu 14.04 64bit on an internal hard drive that is running out of space and have decided to clone this hdd on to a larger hdd using Clonezilla on cd, to over come the capacity problem.

Clonezilla requires both the source hd and the target hd to be unmounted but does not appear to have any facility to unmount any drives.

Having removed the Clonezilla cd and booted up on the hd as normal, I then used the Disks package that comes installed in Ubuntu to disable the auto-mount hd at startup and shutdown the pc.

I then wondered, if I cloned an unmounted hd on startup, how would it boot up? So I did not clone the hd but instead powered up the pc and now I get this message:

       An error occurred while mounting /.
       Press S to skip or M for manual recovery.

When M is pressed it goes to a command line screen at root:

root@hs:~#

I assume that I need to access the Disks package using the command line and change it back to auto-mount at start up or maybe uninstall Disks and then reinstall it and hope that it reverts to auto-mount at startup by default. Is
this assumption correct?

Either way or anything else, all help and suggestions will be hugely appreciated.

Please note my Ubuntu skills are at beginner level. Thanks.


7 Nov 2017

Hi muru, thankyou for your reply, I have included the outputs of cat /etc/fstab and
lsblk as shown below:

screen shot 1

the next photo is the right hand side of the screen:

screen shot 2

Look forward to your suggestions, thanks.


9 Nov 2017

Hi muru, thanks for your reply, shown below are the outputs for
cat /etc/fstab and lsblk:

 root@hs:~# 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/sda1 during installation
 # swap was on /dev/sda5 during installation
 # UUID=f6e4c577-2c98-49c7-8b24-5e87d6b96b69 none          swap    sw               0      0
 /dev/mapper/cryptswap1 none swap sw 0 0
 UUID=6d49a8c5-64b6-4035-a9c4-c33a4fe0890d / ext4 errors=remount-ro,noauto,x-gvfs-show 0 1
 root@hs:~# lsblk
 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 sda      8:0    0  38.2G  0 disk
 |-sda1   8:1    0  35.4G  0 part /
 |-sda2   8:2    0     1K  0 part
 `-sda5   8:5    0   2.8G  0 part
 sr0     11:0    1  1024M  0 rom
 root@hs:~# _

Look forward to your further suggestions, thanks.


26 Nov 2017

Earlier this month, I think I provided the correct information that was requested for cat /etc/fstab and lsblk but have not yet received any further comments.

Would you please let me know if the information provided is incorrect in any way and I will be happy to rectify it so that progress can be made to get to a solution, thanks.


27 Nov 2017

Hi, user535733 thank you for comment. I will take your advice and not clone the disk. Instead, I will look to delete/uninstall to create space.

However, this still leaves me with a disk that does not boot up. Have
you got any ideas on how to resolve the main problem to get this disk to boot again? Thanks.


28 Nov 2017

Hi sudodus, thank you for the comprehensive information on a fresh install
and disk clone using Clonezilla, which I will use after my current problem
has been resolved. (Otherwise, I will just be producing a cloned disk which
will not boot-up).

My current problem is that I have a disk which will not boot-up because
the Disks package (gnome-disks) stops it from being mounted at startup, as
explained earlier…(I used the Disks package that comes installed in Ubuntu
to disable the auto-mount hd at startup).

After the power switch is pressed the boot-up process starts for a short
while but then stops (assume when gnome-disks is reached) and an error message
is displayed as shown in the above earlier text.

So is there a way of preventing the gnome-disks utility from running (guess
comment it out, deleting it, or anything else?). Please let me know. Thanks.


29 Nov 2017

Hi sudodus, thanks for your suggestion. I am currently searching around trying to find a way of how to get the mountpoint path, so that I can try your renaming suggestion. If you can help, please let me know. I will post back on here after trying it out, thanks.


30 Nov 2017

Hi Organic Marble, thank you for your solution. It has worked a treat and the
disk boots up again, well thought out and a great help.

Re: Using Clonezilla, I will look for a way to write-protect a hard drive
(just for the cloning process) to avoid mishaps, hope there is a way.

Also, thanks to everyone else for their suggestions.

Best Answer

Please read this problem statement, shorn of all the history in your question. If it accurately describes your problem I will explain the effects of what you did, and proceed to tell you how to fix it.

Problem Statement I used "Disks" and, ignoring the warning in yellow, unchecked "mount at startup" on the partition containing my Ubuntu system. Now my computer won't boot.

enter image description here

Diagnosis What this did, was simply remove the entry for your system partition from fstab. (fstab is a critical system file which contains the information your system uses to control the mounting of your computer's partitions at boot time.) Here is an after and before compare of fstab from when I tried this on a virtual machine. Note the deleted line.

enter image description here

Your fstab posted in your question sorta confirms that this is the problem. It shows the same comment / was on /dev/sda1.... with no line below this to actually mount the partition. But there is a line further down that tries to mount a system partition. I am not sure how that line got there...I suggest commenting it out. (Perhaps the noauto is the problem, I don't know that option or the x-gvfs-show option, so let's get rid of this whole line and redo it)

How to Fix Fortunately, fixing fstab on an unbootable machine is actually rather routine. I will describe a brief outline of the necessary steps. If you need more information or details on how to carry out each step, reply in comments and I will expand them.

  1. Boot your nonworking machine from a live USB and select the "try Ubuntu" option.

  2. Obtain the partition number and UUID of your system partition by opening a terminal and typing sudo blkid. I do not know a bomb-proof way to tell you which partition this is unless you labeled it as system. Based on your fstab, it may be sda1, but sometimes this changes. Perhaps you already know which partition it is; I hope so.

  3. In the terminal type sudo mount /dev/sd__ /mnt where __ is the last two digits in the name of of the partition that contains your Ubuntu system. [Perhaps a1]. Note the space before the /mnt

  4. Now edit the fstab file with the command sudo nano /mnt/etc/fstab. Restore the line that was deleted. The line should look like

UUID=your-partitions-UUID-here / ext4 errors=remount-ro 0 1

  1. Save your changes. Shut down your system, remove the USB, and power on.

Extra information related to your history above Don't do what you did to use Clonezilla! It is completely unnecessary. When you boot Clonezilla, the partitions in your system will not be mounted. You do not have to take any action to unmount them before booting Clonezilla.