6

I am able to access my windows drive as pointed by the red arrow. I don't want this to happen.

enter image description here

8
  • 7
    Don't mount the drive? Problem solved. Aug 15 at 17:20
  • 5
    Or encrypt the drive if access by others is your concern.
    – ubfan1
    Aug 15 at 18:02
  • 1
    @Rinzwind it should be noted that removal of the ntfs driver will succeed in being unable to use pendrives and/or portable HDDs, as they are all factory-formatted for NTFS.
    – raj
    Aug 15 at 19:07
  • 1
    It's not clear what you want to accomplish. You want the drive to be unavailable to other Ubuntu users? Not visible on the sidebar? Impossible to access in any way? You should clarify.
    – tomasz
    Aug 16 at 12:05
  • 2
    To me it is VERY simple Ari does not want to be able to mount them from the desktop, No security reasons and just an annoyance of seeing it in Nautilus. If security was the issue that would have been mentioned specifically in the question :)
    – Rinzwind
    Aug 16 at 12:32

2 Answers 2

10

Add the Windows partitions to /etc/fstab using these options:

UUID={UUID} /mnt/{mountpoint} ntfs defaults,noauto,umask=777 0 0
  • sudo blkid shows the UID of partitions.
  • noauto: prevents the partition from mounting automatically at boot.
  • The umask=777 means: no read, write, or execute permissions.
  • The mountpoint set to /mnt: Nautilus left panel never mounts /mnt (mounts in /media and /home do).
4
  • 3
    This will work of course, but it only blocks unprivileged users in this particular installation from accessing the files. Assuming physical access, someone can still boot from a USB stick and read/alter the files, or if that is blocked too, they can take the drive out, modify the files as they want, and put the drive back in. The only solution if data security is important is to encrypt the partition from within windows.
    – user000001
    Aug 16 at 8:37
  • 3
    @user000001 but that was not the question
    – Rinzwind
    Aug 16 at 12:29
  • Will this remove the entry on the panel? Or does it just change the nature of the interaction to one where the user must supply their password to mount the drive/partition, as that action is limited to a user with sudo/wheel privileges?
    – killermist
    Aug 16 at 15:07
  • The question was 2 parts: not show in nautilus and not automount. The 3rd (umask) is just to make sure you can not edit the partition. So yes it will (due to mounting in /mnt and not /home) and if it ever gets manually mounted (automount is off due to noauto) using the /etc/fstab settings the contents are empty (due to the umask). An admin can still mount but needs to supply all the options with the mount command. Also: using a live session it will also be mounted. If data safeguard is needed then yes encryption is also needed.
    – Rinzwind
    Aug 16 at 15:28
1

This seems to be a change in Ubuntu 22.04 (Jammy). To reverse it, use the Settings application, and then "Appearance Settings", to access the item "Configure dock behavior". Uncheck the box for "Include unmounted volumes". That gets the result Ari is seeking.

The option to mount them - the Windows partition being the one discussed here - is still accessible using the "+ Other Locations" item in the Sidebar under Files, as before.

1
  • Nice! I hadn’t realised I wanted to do this, but it’s much cleaner not to have unmounted volumes clogging up the dock. Thank you.
    – Will
    Sep 12 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.