2 Answers
2

Here XXX is my user id. You can find yours with id command and /dev/sda7 is the partition I want to restrict access to.

Create a folder named EXTRA in /media/ as follows,

sudo mkdir /media/EXTRA

Now whenever you login you need to mount it as,

sudo mount /dev/sda7 /media/EXTRA

Done!

Explanation:
If a particular partition contains a VFAT or NTFS filesystem and you only wish to be able to access it yourself, it's pretty simple:

Include the options "noauto", "uid=XXX", and "umask=7" in fstab line and remove the "user" and/or "users" options if they appear there now.

This means that at boot time the system will come up with that partition unmounted, and only you (operating as root, using sudo presumably) can mount it.

Once mounted, it will be owned by your unprivileged user (assuming that that user's uid is XXX, which is given to the first user created at install time in MDV installs - check with the "id" command run as that user, and adjust fstab accordingly) and
will be inaccessible to all other local users.

To mount your restricted 4 partitions by issuing mount command four times is a boring task. To cut that boring task, I have written a shell script: