Mounting NTFS drives by editing /etc/fstab

Continuing the discussion from Leveraging virtualization possibly replacing multiple boot:[quote=“DaveB, post:24, topic:5097”]
Do you need help with optimum partition auto mounting fstab settings for your NTFS partitions while using Ubuntu MATE?
[/quote]

I think that I do … Reading the Ubuntu Manual was a kinda like eating an elephant - I’m taking one bite at a time - but the problem with that method is in the digestion :smirk:

I’m not entirely certain that I would call my eSATA drive a Windows Partition; hence some of my confusion. My idea is to have the entire drive identified in /etc/fstab as rw and with some label that I apply. I understand and have done:
a) looking up the drive’s uuid using sudo blkid
b) knowing ntfs-3g is included with Ubuntu MATE 16.04
c) editing /etc/fstab - my system worked - not certain correctly since directory I created for mount was empty

What I need to know is how to put this together into a line in /etc/fstab?
How does fstab related to mounting - ie does a mount point need to pre-exist?

This sounds feasible to me. And I can only say that because I do something similar with my mate host (no windows here). It is suggested by vBox that a folder be created for sharing, but I did not like this. So I instead created a link to my Host home directory and placed it in my guest system (in guest home) and called it Home2. I now have access to everything :slight_smile: So I wonder is this is possible also in windows by using Guest Machine Settings>Shared Folder. No fstab necessary.

https://help.ubuntu.com/community/VirtualBox/SharedFolders

https://www.virtualbox.org/manual/ch04.html#sharedfolders

1 Like

[quote=“pfeiffep, post:1, topic:5612”]
Reading the Ubuntu Manual was a kinda like eating an elephant - I’m taking one bite at a time - but the problem with that method is in the digestion :smirk:[/quote]

If it’s true, “You are what you eat”, then at least you’ll now have a great memory! :smile:

Okay, here goes…

For your set-up (dual booting GNU/Linux / Windows), most recognised solution for a (non-OS) shared NTFS partition is as follows…

UUID=**** /media/Storage ntfs uid=1000,gid=1000,dmask=027,fmask=137,windows_names 0 2
  • replacing “****” with relevant NTFS partition UUID string
  • replace “Storage” with preferred name (Tip: no spaces allowed)

Explanation of other settings:

  • /media - For drives you wish to show
  • /mnt - For drives you wish to hide
  • uid=1000 - User ID (normally 1000)
  • gid=1000 - Group ID (normally 1000)
  • dmask=027 - Directory permissions using octal numbers
  • fmask=137 - File permissions using octal numbers
  • windows_names - Only allow Windows compatible names
  • 0 0 (seen below) and 0 2 - Pass numbers, 0 0 = do not check, 0 1 = check this partition first (used for the OS), 0 2 = check this partition next

Here’s another example to easily hide a Windows OS NTFS partition:

UUID=**** /mnt/Windows ntfs noauto 0 0
  • replacing “****” with relevant NTFS partition UUID string

I recommend hiding a Windows OS partition so damage/boot issues will not occur if Windows OS is using fast-boot. Doing so also prevents any mistakes such as accidental system file deletion.


Tip: There’s no need to create /mnt or /media directories first, /mnt directories are hidden anyway, /media directories are automatically created upon partition mounting, or after system restart.

PS: It’s okay to use either ntfs or ntfs-3g, ntfs symlinks to ntfs-3g

2 Likes

Thank You! I can’t wait to try this - you’ve made the digesting very easy.[quote=“pfeiffep, post:1, topic:5612”]
My idea is to have the entire drive identified in /etc/fstab as rw and with some label that I apply.
[/quote] One last question prior to me getting to my H P and putting this into action … Will using gparted to apply labels to NTFS entire drives and partial drives [those with both ext4 and NTFS partitions] have any negative affect when using Windows 7?

After following your excellent guidance I will mark this thread as SOLVED!

1 Like

You are most welcome.

Never named an a drive in its entirety, is that possible? Adding partition labels using either GParted, Disks, or other method should not cause any issues for drives shared with an Windows OS environment. Only difference you will notice, instead of a partition labelled as (for example) Local Disk (D:) it will show Storage (D:)

Pleased to have been able to help.

1 Like

Thanks for your advice and examples! On the other subject about leveraging virtualization - I’m proceeding with Linux in a virtual environment for testing new releases and completely abandoning the Windows aspect - ie I will continue with dual boot :wink: