Auto-mounting my NTFS partitions in my dual-booted Linux

Yes uhh this is another problem I’ve been having. I want to be able to access my NTFS partitions on Linux. Mainly so I can get into my git repos and do my game dev without having whole separate copies which apparently requires a bit more fiddling to get working but, anyway!

It’s easy enough to set drives to mount automatically. You do this by editing /etc/fstab, I’ll copy my file below:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=REDACTED /              ext4    defaults,noatime 0 1
UUID=REDACTED                            /boot/efi      vfat    umask=0077 0 2
UUID=REDACTED /home          ext4    defaults,noatime 0 2
# windows partitions
UUID="REDACTED" /mnt/Drive1 ntfs-3g auto,rw,uid=1000,gid=1000 0 0
UUID="REDACTED" /mnt/Drive2 ntfs-3g auto,rw,uid=1000,gid=1000 0 0

The process goes like this. On a new line you write a new entry consisting of several variables, which are separated by whitespace. Comment lines start with a # and blank lines are OK.

Like the comment says you can run blkid to get the UUIDs of all your drives, which is apparently the best way to identify them. So you start a new entry with UUID=abcdewhatever.

Then you want the directory the drive’s going to be at. You can put it pretty much anywhere; you can see that I’ve put my NTFS drives in the /mnt/ directory, which I’m not sure is ‘proper’ but it hasn’t caused any problems. That I know of.

The third variable is the filesystem that the partition you want to mount uses. Or rather, I think, the driver that Linux uses to read the filesystem. In the case of NTFS the driver is called ntfs-3g and depending on your distro it might not already be installed.

The fourth variable is a comma-separated list of options you want to set. There’s a list of them in fstab‘s man page. I think auto should be enough, it sets a bunch of default options. Including rw that I’m setting separately! I thought it would help with the problem I’m about to get to, but it didn’t, but I’m leaving it there anyway. I’m also setting uid=1000 and gid=1000, which means the owners of the partition will be user 1000 and group 1000. I got those options from here. Use the id command to find your users IDs!

The last two options set what happens to the filesystem if the computer crashes, and whether it’s checked for errors at boot time. I don’t want Linux to mess with anything Windows might do, so I set both to 0, or ‘do nothing’, even though it’s probably fine.

Now on to the problem. Saving /etc/fstab and restarting the computer will get these partitions mounted. But. In Windows’ quest to be ever more inconvenient it apparently doesn’t shut down properly anymore! So my partitions remained locked, and read-only. This is no good.

The solution is real simple for the amount of trouble it caused me. When shutting down Windows, I needed to hold the Shift key as I clicked Shut Down. Then it shuts down properly and fully, freeing up my partitions for Manjaro Linux to use (which both boots and shuts down much faster, despite doing it the right way…) :p