Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have two NTFS partitions that constitute a Windows 7 install. I am running Ubuntu and virtualize that Windows install off the physical disk. While the VM is working it could be disastrous if mount any of those partitions and make changes to them.

How do I prevent Ubuntu from mounting these partitions _at_all_?

Tried something along the

/dev/sda none ntfs,ro 0 0

in /etc/fstab but that just gave me an error..

Thanks!

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

You could try putting a space between ntfs and ro. And add a ,noauto to the ro (without a space before the comma.

Good luck!

share|improve this answer
    
Gosh was I that stupid... Indeed spacing it out and noauto works almost as good as I want it to. The only problem left is that I can still mount the drive via Nautilus and the FS is fully writeable. That's OK though, I have learned to be careful. :) –  lightrush Mar 13 '12 at 14:37
add comment

This can be accomplished by blacklisting the NTFS kernel module.

Begin by typing the following into a terminal:

sudo gedit /etc/modprobe.d/blacklist.conf

At the bottom of the file, add the line:

blacklist ntfs

Save the file and restart your computer - you should now be unable to mount any NTFS partitions.

share|improve this answer
    
Is there anything more fine grained? –  lightrush Nov 17 '11 at 17:05
add comment

I did it my way. It works only if you have an administrator account (who has installed the system), but work normally as an ordinary restricted user.

  1. Create a mount point in the private area of the admin.

    Login as the administrator.

    sudo -i
    cd /media/ADMIN-NAME
    mkdir Reserved

    I tried chmod 700 Reserved but it seemed to be overwritten after booting.

  2. In /etc/fstab add a line like:

    /dev/sda1 /media/ADMIN-NAME/Reserved ntfs -r 0 0

    where sda1 and ADMIN-NAME have to be adapted to your situation.

That's it. As an administrator, you may test your fstab by:

    sudo mount -a   

and a subsequent mount.

The administrator has access to the Windows partition for emergencies. The -r option in fstab should allow for read access only, but I preferred not to try.

A normal user gets an error message when he wants to access the partition. This remains true even if he has acquired access to another Windows partition (maybe for common data like photos, etc.).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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