Monday, April 29, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4565  / 2 Years ago, thu, august 18, 2022, 1:23:43

After I perform a full system upgrade and install all the drivers, I usually remove Gvfs and all its dependencies and also Gigolo and any other piece of software used in Ubuntu to automatically mount NTFS or FAT partitions. Call me a paranoid, but I find it more reliable and secure this way to separate Windows files from Linux files mainly because of the incompatibility issues that may occur whenever I mix Linux with Windows.



When and if I need to access a NTFS/FAT partition from Linux, I use the mount/umount commands in a terminal and all is fine this way. But my problem is that, though I can mount and entire NTFS/FAT partition, I am not able and I have no idea how to mount just one directory from a NTFS/FAT partition without having to mount the entire partition prior to that. I am not sure if this is even possible but if it is possible, please let me know how to do it.



So far I tried command lines like these:



      sudo mount /dev/sda5/movies/Riddick/ /media/hdd/

sudo mount directory /dev/sda5/movies/Riddick/ /media/hdd/

sudo mount /sda5/movies/Riddick/ /media/hdd/


and nothing works. I can mount and read a partition, be it /dev/sda5/ or /dev/sda1/ but I can't mount just one directory from that partition. Any ideas?


More From » partitioning

 Answers
3

/dev/sda5 and friends are partitions, a type of block device. They don't have (sub-)directories, but they can contain file systems. Only file systems can have directories. To open a file system use the mount command on the block device that contains the file system:



sudo mount [block device] [mountpoint]


where [block device] is the containing device (in your case apparently /dev/sda5) and [mountpoint] is an existing directory where the content of the file system will appear¹. On success you can then look for your movies in or below [mountpoint].



It is (generally) not possible to only mount a subdirectory of a file system on an otherwise unmounted block device. If this is what you want, an equivalent solution may be symbolic links or bind mounts.



¹ shadowing the previously existing content of that directory.


[#23061] Thursday, August 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;