My 2nd OS drive auto-mounts at login of main install

When I log in to my main Ubuntu-MATE 20.04.3 (nvme0) OS, my secondary install (/dev/sda) is already auto-mounted.

I would prefer its icon simply be shown in "Disk Mounter" in the top panel, so that I can click on it and mount it when I want to. (The icon is there, but it's oversized and green-marked as mounted.)

Here is the /etc/fstab file for the main system (UUID 07041... is the main OS's ext4 partition, and UUID 2BD2... is the main OS's EFI partition):

 1 # /etc/fstab: static file system information.
 2 #
 3 # Use 'blkid' to print the universally unique identifier for a
 4 # device; this may be used with UUID= as a more robust way to name devices
 5 # that works even if disks are added and removed. See fstab(5).
 6 #
 7 # <file system>  <mount point>  <type>  <options>       <dump>  <pass>
 8 UUID=07041e0f-1cde-4caf-9b1d-86851e9601ed   /      ext4    errors=remount-ro   0       1
 9 /swapfile                                 none            swap    sw        0       0                                                                                                
10 UUID=2BD2-4199    /boot/efi    vfat     defaults      0       1

And here is the output of:

--> lsblk -e 7 name,fstype,size,fsused,label,partlabel,mountpoint,uuid,partuuid                               
NAME        FSTYPE   SIZE FSUSED LABEL          PARTLABEL                  MOUNTPOINT UUID                                 PARTUUID
sda                894.3G                                                                                                  
├─sda1      vfat   550.3M        SSD_ESP        ssd_EFI-system-partition              6DE5-0FF8                            684141f2-20c3-41be-b2c4-7058d9488896
└─sda2      ext4   893.7G        MATE-20.04.3   UbuntuMATE-20.04.3                    21697ef7-83e3-4414-a859-91841f61dce8 7cc6f822-eb23-4829-9039-6d09e6e0ca55
sdb                894.3G                                                                                                  
└─sdb1      ext4   894.3G        WeirdBeard     WeirdBeard                            70e15e24-a75c-4115-9c83-29cb585676f6 5ab70820-78e7-466e-9c0f-101054d5df9b
nvme0n1            931.5G                                                                                                  
├─nvme0n1p1 vfat     402M   9.7M NVME0_ESP      nvme0_EFI-system-partition /boot/efi  2BD2-4199                            337ce8d2-65a0-4051-8c12-55cc22666e7e
└─nvme0n1p2 ext4   931.1G  39.9G MATE-20.04.3   UbuntuMATE-20.04.3         /          07041e0f-1cde-4caf-9b1d-86851e9601ed 0657b873-53c2-4a40-9e60-3b26c891fd1b
nvme1n1            931.5G                                                                                                  
├─nvme1n1p1 vfat     402M        NVME1_ESP      nvme1_EFI-system-partition            E23B-29C2                            90af4214-eca8-4265-8e5f-9c2e3301bba9
└─nvme1n1p2 ext4   931.1G        No-OS-here-yet The-next-LTS-UbuntuMATE               a3cb2757-686f-4c5c-92ca-a43b3a223207 77706804-715d-4276-9824-a184ed00df4f

How can I get this drive to NOT automount at login, and how to get the top-panel icon uniform with, and same size as, 2 others there? Thanks.

If you type mount | grep sda, are there options?
usually, I pass a noauto option for that drive.

mount | grep sda, when entered on the command-line in my main install, returns nothing.

I did try modifying my /etc/fstab file thusly (with the addition of the last line (line number 11 below), but all that did was remove the sda drive's icon from the top panel, leaving no way to mount sda:

  1 # /etc/fstab: static file system information.
  2 #
  3 # Use 'blkid' to print the universally unique identifier for a
  4 # device; this may be used with UUID= as a more robust way to name devices
  5 # that works even if disks are added and removed. See fstab(5).
  6 #
  7 # <file system>  <mount point>  <type>  <options>       <dump>  <pass>
  8 UUID=07041e0f-1cde-4caf-9b1d-86851e9601ed   /      ext4    errors=remount-ro   0       1
  9 /swapfile                                 none            swap    sw        0       0                                                                                                
 10 UUID=2BD2-4199    /boot/efi    vfat     defaults      0       1
 11 UUID=21697ef7-83e3-4414-a859-91841f61dce8   /      ext4    noauto  errors=remount-ro   0       1

Also, in line number 11, this (the right-hand) portion of it was highlighted in red:

errors=remount-ro 0 1

likely indicating something wrong with the line or with that part of it.

You cannot mount the sda to / since / is already the mountpoint from the nvme.

Probably mount sda to /mydrive

UUID=21697ef7-83e3-4414-a859-91841f61dce8   /mydrive     ext4   noauto    0       0

Hmmm. Thanks for your responses.

I put your suggested line as the last line in my /etc/fstab, but that only removed the sda drive's icon from the top panel, again leaving no way to mount sda, as with my previous attempt above.

Should /mydrive be defined somewhere else as well?

For what it's worth, here is the /etc/fstab in /dev/sda itself:

# <file system> <mount point> <type> <options> <dump> <pass>

UUID=21697ef7-83e3-4414-a859-91841f61dce8	/	ext4	errors=remount-ro	0	1
/swapfile	none	swap	sw	0	0
UUID=6DE5-0FF8	/boot/efi	vfat	defaults	0	1

Your system is running with the nmve as the main OS, sda is just another drive with data. (we don't care about the fstab of the sda drive, it does nothing since sda is NOT the active OS).

If I understood, you want some icon to click on and mount sda. Use the Disks program, you should see the nmve drive and the sda, select sda and there is an option to mount it.

(I suggest you remove the last line 11 from your fstab, let Disks do its thing.)

sda is actually an internal SSD on which I also have a bootable Ubuntu-MATE 20.04.3 installation (it's not just a drive for storage, though I don't think it makes any difference in this case; I still don't want it to mount by itself).

In my top panel, I have placed "Disk Mounter," which is put there by right-clicking on the top panel and choosing "Add to Panel." Disk Mounter is one of the many choices for applets to be placed in the Panel.

I do have a disk-icon there to click on that mounts another internal SSD that is just for data. Normally, I should also have a second disk-icon there right beside it to click on that mounts the sda SSD.

Right now I do have (an oversized) disk-icon in the top panel representing sda, but the problem is that sda is already auto-mounted at login of the nvme0 OS.

For the moment, I've restored fstab to the 3 active lines that enable sda to be auto-mounted. Everything else I've tried so far only removes the icon from the panel.

Opening the "Disks" program is an extra step that I wouldn't normally have to take. Normally I can just hit sda's icon in the panel.

I've discovered that /dev/sda2 is always either:

(a) mounted upon login at /media/<myusername>/20.04.3-ssd <-- (the label I gave this partition);

(b) mounted at /run/timeshift/backup (during which time its icon does not appear in the top panel); or

(c) not mounted.

But I'm not sure how to stop it from auto-mounting at login, or how to stop it from mounting on /run/timeshift/backup when it is not auto-mounted in /media.

On my VM, um20.04 added a second disk 5GB. Started VM, used Disks to format the 5GB disk, created partition ntfs. If the disk is mounted there are mount options (gears icon), see screenshot.

At first run, I clicked on Mount at system startup, it wrote options in /etc/fstab
UUID=610A3... /data auto nosuid,nodev,nofail,x-gvfs-show 0 0
Rebooted, disk is mounted.

Back to Disks, UNclicked that option, again it wrote to /etc/fstab the option "noauto"
UUID=610A3... /data auto nosuid,nodev,nofail,x-gvfs-show,noauto 0 0
Rebooted, disk is not mounted at startup.

Does this help you?

I've been through those mount settings in the gear icon in Disks, using "noauto" in options.

However, I now believe that the problem I'm having with this comes down to a bug in Timeshift, which doesn't seem to want to let go of its target after doing a backup, as discussed here:

By the way, let me add, Pavlos: I really appreciate the efforts you've made to help me with this.

As a next step I'm going to see if I can un-mount the drive in question from /run/timeshift/backup, in the hope that it will stay unmounted and permanently release the drive from that mountpoint. I'll report the results.