Score:1

Mount subfolder from NTFS drive via entry in /etc/fstab

ua flag

I have a NTFS hard drive connected to my Raspberry Pi. The structure of the drive is:

F:\
- Images
- Other
- Movie

I would like to mount only the F:\Movie folder in /mnt/disk/Movie in read-only.

My fstab looks like:

UUID=(lots of letters and numbers) Movie /mnt/disk/Movie   ntfs   defaults,uid=0,gid=0,fmask=0022,dmask=0022,noatime,nofail,x-systemd.device-timeout=2

but it doesn't work. What am I doing wrong?

ChanganAuto avatar
us flag
Welcome. What exactly doesn't work?
zwets avatar
us flag
Do you consider it an issue if the whole partition is mounted? If not, then just remove `Movie` from the `fstab` entry, and the `Movie` directory will mount at `/mnt/disk/Film/Movie`. If you want it mounted elsewhere, change `/mnt/disk/Film` appropriately and/or use a bind mount. In all cases, `Images` and `Other` will also be mounted. If that is your issue, I think you'll have to use some trickery to hide them.
John avatar
ua flag
Yes, because I would like to mount one subfolder (/mnt/disk/Movie) in read-only mode and another one (/mnt/disk/Images) in rw.
Score:1
cn flag

It is not possible to mount only one subfolder of a complete partition - also in Windows you cannot just set a drive letter for only one folder in the Disk Managment.

You will have to mount the whole partition - you can do this read-only. Then you can access all three folders. If you want to have some software not be directly aware of the other folders, you could create a soft-link to that specific folder.

First remove the folder name ("Movie") from the fstab entry and while unmounted, create a folder /mnt/disk/Film. When you mount the partition, all folders will be contained in /mnt/disk/Film.

If you want to have the "Movie" folder in /media/Film, then you first ensure that the folder /media exists. Then execute ln -s /mnt/disk/Film/Movie /media/Film and you can access /media/Film to get the contents of F:\Movie.

The soft link will even continue to exist if the partition is unmounted, but will then point to the empty mount folder. This could lead to the situation where a mount hides files that were written during the unmounted phase - you can reveal them again by unmounting.

John avatar
ua flag
Ok, if mounting only one subfolder is not possible then I'll explain better my need. I would like to have one subfolder (/mnt/disk/Movie) in read-only mode and another one (/mnt/disk/Images) in rw (the "Other" folder can be in whatever mode). Is that possible? The problem here is that I cannot change the permissions with chmod because the filesystem is NTFS.
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.