Score:0

How to force NTFS partition to always be mounted as root?

cn flag

I have a system with Windows and Linux installed, and Windows is installed on a driver with an NTFS partition. I want to make sure that I don't accidentally write to this partition, so I want it always mounted as read-only.

I know I can manually create an /etc/fstab entry to mount that partition at some fixed mount point and have it be read-only. But that requires me to 1) pick a fixed mount point, and 2) identify the drive manually by UUID or device.

Ubuntu currently mounts that drive dynamically. It detects the drive and creates a nice mount point. I want to build on that feature. Is there a way to tell Ubuntu that this particular NTFS device should be mounted read-only, without specifying where it should be mounted or any other mount options.

I tried using the KDE Partition Manager, but it seems to be broken. It won't actually write any entries to /etc/fstab, even though it says it will.

lord_nimon avatar
cn flag
KDE Partition Manager does ask for my password when it starts, and it can do everything else.
ru flag
But by your own statement, it does NOT add entries to /etc/fstab so either you haven't selected the right option to *write* the mounts to /etc/fstab or it can't because of AppArmor isolation or similar (hence a permissions issue).
Terrance avatar
id flag
There happens to be a bug filed for it at https://bugs.launchpad.net/ubuntu/+source/partitionmanager/+bug/1873706 and they claim that upstream in version 4.2.0 it has been fixed.
pasman pasmański avatar
mx flag
Which release of Ubuntu you use ?
vanadium avatar
cn flag
Probably writing an udev rule can help you, e.g. https://askubuntu.com/questions/683881/mount-options-for-udev-rule-mounted-ext3-fs-on14-04-3
ru flag
Unfortunately, without using the UUIDs we can't set an fstab entry. And it's pretty simple to get the UUIDs actually. KDE Partition Manager probably isn't properly running as admin to edit `/etc/fstab`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.