← Back to list

How I set up a shared partition between Windows and Linux for my projects.

What is NTFS? What is and how to use FSTAB in Linux?

Marco Zoratti · 2024-08-15 21:30 · 35 claps · 4.1 min read
#fstab #linux #partition #ntfs #terminal
Open on Medium ↗
Wiki topics: 🔓 · Open Source

How I set up a shared partition between Windows and Linux for my projects.

What is NTFS? What is and how to use FSTAB in Linux?

Little sad story :)

I recently switched my primary OS from Windows 11 to Fedora 40 but (sadly) i noticed that I still need few Win tools to study and program, so i decided to share projects and important files between the two OSes.

I’m going to use Linux for the most, but I want to work on the same files on Win if needed.

The idea

Create a partition that can be read and wrote by both Linux and Win without any problem or incompatibility.

The best partition type for my case is NTFS which is developed by Microsoft but…

NTFS read/write support is available on Linux […] using NTFS3. NTFS3 is fully functional NTFS Read-Write driver. (Wikipedia and TLKA).

So, I need to create a new NTFS partition, put in my projects and files, configure it in both OSes and try it out.

Also, I want to automatically mount the partition within the Fedora home, specifically within the /home/marco/Projects folder.

At work

  1. I have 1 TB SSD on my pc. Fedora occupies around 300 GB, Windows around 600 GB, so the last 100GB are used by the NTFS partition called “Progetti” (“Projects” in Italian).
  2. To read/write files from/to the NTFS partition, we need to install NTFS-3G and FUZE drivers on our Linux distro.

For Fedora (and RPM distros):

sudo dnf install ntfs-3g fuse

For Ubuntu and derivates:

sudo apt-get install ntfs-3g fuse

I noticed that this packages are pre-installed in Fedora 40 but always check it, otherwise you can’t R/W the NTFS partition.

  1. I moved all my files and folders into the new partition. For now, the total weight of the partition is about 5 GB and it’s organized very easily:

Some names are obscured due to privacy

Some names are obscured due to privacy

  1. I also wanted to automatically mount the new partition in my /home/marco/Progetti folder on boot.

To do this, I edited the /etc/fstab file (with sudo permissions obv):

FSTAB is a configuration file in Linux systems that defines how partitions and storage devices should be mounted. It’s read during boot and is located at /etc/fstab.

Each line in the fstab file typically contains six fields:

  1. Device: The device name or UUID of the partition.
  2. Mount point: The directory where the partition will be mounted.
  3. File system type: The type of file system (e.g., ext4, NTFS, FAT32).
  4. Mount options: Additional options for the mount (e.g., defaults, noexec, rw).
  5. Dump: Used by the dump utility (usually 0 or 1).
  6. Pass: Used by the fsck utility (usually 0 or 1).

Here is my FSTAB (you can read your with the command “cat /etc/fstab” ):

#
# /etc/fstab
# Created by anaconda on Mon Jul 22 23:16:29 2024
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
#
#...
#
# My root partition: 
UUID=ef749c64-0a9b-4034-861c-e32a24e9aaf7 / ext4    defaults        1 1

# My efi partition:
UUID=8480-F1A9 /boot/efi  vfat    umask=0077,shortname=winnt 0 2

#---------------------------NEW PARTITION ADDED---------------------------

# My Projects NTFS partition:
UUID=1CF44DF1F44DCDA8 /home/marco/Progetti ntfs uid=1000,gid=1000,dmask=022,fmask=033  0 1

Notice that in the mount option I added:

uid=1000,gid=1000,dmask=022,fmask=033

I try to explain what and why:

What are UID and GID? What is “1000”?

In Linux, UID (User ID) and GID (Group ID) are numerical values that are used to uniquely identify users and groups within the system.

In my case, my user id and user group id are “1000”. You can check yours running the command id:

$id
  uid=1000(marco) gid=1000(marco)  [...]

This means that the “/home/marco/Progetti” is owned by the user n.1000 and by the group n.1000, that’s my user!

So Progetti folder is own by me; we can check it typing “ls -lh” in the home directory:

Italian OS…

Italian OS…

What are dmask and fmask? Why strage values like “022" or “033”?

In Linux, dmask (directory mask) and fmask (file mask) are options used to set default permissions for directories and files when mounting a filesystem, especially non-native filesystems like FAT32, NTFS, or exFAT.

fmask sets the default permission bits for files.

dmask sets the default permission bits for directories.

They control which permission bits will be “masked” or turned off when files/dir are created:

The default permissions for files are usually 666 (read and write for user, group, and others). The fmask value is subtracted from 666 to determine the final permission bits.

Example:

If fmask=022, it means:

666 - 022 = 644 (which translates to rw-r--r--).

Files will be created with read and write permissions for the owner, and read-only permissions for the group and others.

Test it

To test it, I rebooted Fedora and everything worked file.

In fact, my “Progetti” folder was automatically mounted on boot in the home directory and I can work on it.

I also booted Windows and everything worked fine there, too!

Now I am able to use, edit and read the same files on both OSes :)

Summary of commands and tools used

I used only basic commands and tools in this simple guide:

  1. “sudo dnf install [package]” to install packages in your Fedora OS (check out “apt” for Debian-based distros like Ubuntu).
  2. cat [file_path]” is a simple but powerful tool to read the content of a file.
  3. id” useful command to get some informations about ids on our machine.
  4. ls -lh” lists the file in the current directory. “-lh” are optional parameters to show better output.

I recommend to read the manual of each tool to get more detailed info.

To do it, just type in your terminal “man [command_name]”.

Thank you ❤

I apologize for my poor English; I am still learning a lot…

The content of this post is deliberately simplified so that everyone can learn and know something new.

If I have made any mistakes, please let me know with a comment. If you liked the story, let me know with some claps!

See you next time!


메타데이터
post_id
c01c8a4b80a0
slug
how-i-set-up-a-shared-partition-between-windows-and-linux-for-my-projects-c01c8a4b80a0
url
https://medium.com/@marco-zora/how-i-set-up-a-shared-partition-between-windows-and-linux-for-my-projects-c01c8a4b80a0
canonical_url
https://medium.com/@marco-zora/how-i-set-up-a-shared-partition-between-windows-and-linux-for-my-projects-c01c8a4b80a0
author_url
https://medium.com/@marco-zora
status
ok
fetched_at
2026-06-27 18:20:27