[PLUG] Mount command creates new folders

John Jason Jordan johnxj at gmx.com
Tue Oct 23 05:19:00 UTC 2018


On Sat, 20 Oct 2018 08:54:25 -0700
Ben Koenig <techkoenig at gmail.com> dijo:

>1) It creates a folder in /media
>2) It mounts the volume to the folder it just created.
>
>IF you already have a folder that you manually created, then the
>automounter will ignore it, and use a different name.
>
>That's why your system is creating a new folder '/media/jjj/Data1'.
>It's not the mount command doing this. the "user friendly" nature of
>Ubuntu is to automatically mount such devices and is conflicting with
>your mountpoints in fstab.

That explains what is happening, but not how to stop it from happening.
I started by trying to figure out how to turn off the automounter
(autofs, actually), but I didn't succeed. But then 'man mount' told me
that mount starts by looking for a mount point for the device in fstab
and uses that if there is one, so I added lines to fstab with UUIDs and
the mount points.

To back up a moment, there are two drives that bug me; normal flash
drives have never been a problem. One is an internal 1TB drive that I
had given the label Data. The other is an external USB drive that I had
given the label Movies. 

When I opened fstab I noted that / and /home were identified by UUIDs,
so I used lsblk to find the UUIDs of Data and Movies, then created the
mount information for them, specifying /media/jjj/Data
and /media/jjj/Movies. Having done so I rebooted, and it worked. That
was Saturday morning.

On Sunday I took the computer to the Clinic, where I shut it down for
the journey. When I got to Free Geek it would not boot. The obvious
culprit was what I had done to fstab, so I edited it by commenting out
the two new lines. Note that the Movies drive was still at home, but
the internal Data drive was there in the computer, so I started by just
commenting out the line for the Movies drive. But it still would not
boot, and even after commenting out the line for the Data drive, it
continued to error out on boot. It took Wes' help to solve the problem
(about an hour of poking at things), until finally Wes commented out
the lines for / and /home and rewrote them with /dev/sdb1 for /
and /dev/sdb2 for /home, instead of the UUIDs. At that point it finally
booted. 

At that time lsblk showed that the UUIDs for the two lines were
perfectly correct, but the boot process apparently didn't agree. The
only thing I can conclude is that UUIDs are evil. 

Having gotten the computer to boot I uncommented my lines for Data and
Movies and rebooted, and all went well. Note that I left the UUIDs in
place for those two devices. This was still at Free Geek.

For the journey home again I shut the computer down, and when I got
home, once more it would not boot. So once again I edited fstab and
commented out my lines for Data and Movies, and then it booted. But
that left Data and Movies unmounted, so I mounted them by clicking on
them in the GUI (Nautilus), and when I did so, as before, they were
mounted in Data1 and Movies1. So I unmounted them, uncommented the
lines for them in fstab, and then mounted them from the command line,
and this time they were mounted in /media/jjj/Data and .../Movies. 

But my whole purpose of all of this was to get these two devices to
automount when the computer was booted, and to be mounted where I
wanted them mounted. So I started searching the web for 'Ubuntu
automount' and similar things, and finally found the solution. 

It turns out the Ubuntu has for a long time included a little GUI
utility called 'Disks' that has some of the features of Gparted. I have
used it in the past to create and label partitions. According to one
helpful fellow on Ubuntu forums, you can use it to edit the mount
options for a partition. When I did so I had the option to turn off
automount (Yes!), specify the mount point, tell it to be mounted at
startup, and even how to identify it. For the latter one of the options
was 'Label=Data' and 'Label=Movies.' When I set up each drive, as I
clicked on OK I noted that the Disks utility added a line to fstab for
the device. Here are the two new lines that it created:

LABEL=Data /media/jjj/Data auto nosuid,nodev,nofail,x-gvfs-show 0 0
LABEL=Movies /media/jjj/Movies auto nosuid,nodev,nofail,x-gvfs-show 0 0

And the best part of all is that it works, and the devices are
automatically mounted where I want them, although boot time is kind of
long now.

So my problem is solved, except that I still want to know why Ubuntu
suddenly decided not to recognize UUIDs. Not that I will ever use one
again, mind you. 



More information about the PLUG mailing list