Mounting NTFS as read-only
Solution 1
So, I got a solution.
For those trying to do this, edit your fstab and include:
#change '/dev/sda1' to your partition id
#change '/mnt/ntfsfolder' to whatever mount point you want
/dev/sda1 /mnt/ntfsfolder ntfs-3g defaults,umask=022 0 0
With this, only the root user will be able to write on the NTFS partition, and all other users will only be able to read it. If you want to change something on such partitions, use gksu
command to execute as root. Example:
gksu nautilus
This will open Nautilus (file manager) as root.
Solution 2
I think the easiest way to achieve this is to check your /etc/fstab
and change the options for the NTFS partition to be mounted read-only.
In a running system you can do this temporarily with mount -o remount,ro /path/to/ntfs
.
Solution 3
ntfs-config
After years of development, a new NTFS driver, ntfs-3g
, which allows full write capability, is here.
Since its first stable release, it has been a wonderful success, and is daily used by thousands of people around the world. However, some people do struggle with to configure their system to use it.
The aim of the ntfs-config
project is to make life of people easier, by providing an easy way to enable/disable write capability for all their NTFS device, internal or external. You can see ntfs-config in action here.
You can find it in GNOME Menu in System - Administration
Solution 4
You could also mount it as read only using the ro-option. This way it would be read only for all users, including root
/dev/sda1 /mnt/ntfsfolder ntfs-3g defaults,ro 0 0
Solution 5
If you prefer to use GUI, try Disks: http://www.hecticgeek.com/2012/10/make-ntfs-partitions-read-only-in-ubuntu/
Related videos on Youtube
priyank
Updated on September 17, 2022Comments
-
priyank over 1 year
My PC has 3 NTFS partitions (main and backups) plus Ubuntu on dual boot. I want to keep the NTFS partitions available, but mounted as read-only by default, so that other users (and accidentally even me) do not modify them in a harmful way. I see that I can't change permissions for the NTFS partitions, which is understandable.
If possible, I'd like that only root can change the default permissions, so that none of the other users could modify them without switching to Windows. If that's not possible, making NTFS unmountable would be OK too.
This is mostly a protective measure to avoid corrupting my Windows system, as I'll still use it quite a lot.
Edit 1: this is my fstab
# <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda7 during installation UUID=4a5ff937-5220-4b4e-b994-304ba37d3448 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda8 during installation UUID=a0285d57-8247-4efe-88ca-14bee4b8630b none swap sw 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
So, I'd like to set all my 3 NTFS HDs to read only (no auto mount). Also, please tell me where to find the
/path/to/ntfs
of each partition.Additionally, can I comment the floppy entry? I don't have one anyway =)
Edit 2: relevant part of 'mount -v'
/dev/sda1 on /media/1A7099D97099BC47 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sda5 on /media/Stuff type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sda6 on /media/Backup type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
Edit 3: Ok, so I installed pysdm (Storage Device Manager), set all my NTFS partitions as mountable my any user, and as read only, and restarted. Now I can't mount the partitions:
Unprivileged user can not mount NTFS block devices using the external FUSE library. Either mount the volume as root, or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged
After some reading it seems that mounting the partitions as root is not a good idea. So, how can I allow the mounting (by any user)?
-
Admin over 13 yearsSmall correction: it's possible to map NTFS permissions to UNIX permissions, so they are not useless, but it's somewhat complicated (you have to map user-IDs between both, etc.).
-
Admin over 13 years@JanC Interesting! Thanks for the tip, it's good to know that there is a way. If someday I dual boot with multiple users on Windows, I'll try... wait, I'm trying to move out of it! Meh, just dump that crap! =D
-
Admin over 13 yearsCan you do a "mount -v | grep ntfs" and post the results?
-
Admin over 13 yearsWell, I did, but no output. After mounting all three partitions and checking 'mount -v', I got something, posted above.
-
-
priyank over 13 yearsThanks, I'll take a look. It's good to see that there is a lot of good talk about ntfs-config, because the reported bugs scare me a bit, specially the ones about breaking fstab (and being a noob Linux user, it may be troublesome for me).
-
priyank over 13 yearsThanks, I'll see if I can figure out fstab by myself. Otherwise I post it here :)
-
priyank over 13 yearsI couldn't understand what you posted, but yes, I'm thankful to all the GUI apps and frontends... I'd have a hard time if I had to learn bash properly to use Ubuntu or any other distro. Better start with GUI and then learn command line.
-
priyank over 13 yearsGuess I'll need a little help here =P fstab on the question above. Thanks!
-
ddeimeke over 13 yearsOh, I see, it is not done via /etc/fstab, so there is an other mechanism, which I unfortunately do not know.
-
priyank over 13 yearsYes, that was my first idea, but letting root write to the partition will be handy sooner or later. Better let things set up for that. :)