September 14, 2025

Creating a shared partition for Windows and Linux

I recently moved from Windows 10 to dual booting Debian 13 and Windows 11. I wanted to share a partition between them, to access my data on both sides. Things like Obsidian notes, KeePass databases, and music.

Choose the file system

The most important decision is the file system. There are a few options:

  • NTFS is natively supported by Windows, and works on Linux with the ntfs-3g driver.
  • BTRFS is well supported by Linux. There is a community run driver for Windows, but from my experience it isn’t very reliable.
  • FAT32 is used by flash drives and is well supported by both, but has a file size limit of 4GB.
  • exFAT is similar and does not have this limitation, but it is an antiquated file system missing many basic features.

After looking at all these options, sticking with NTFS seemed like the most sane choice. Windows supports it out of the box, and Linux needs some configuration to work just as well afterwards.

Setup on Windows

The only step is to disable fast startup. This ensures that Windows frees up the partition on shutdown, so it can be used by Linux.

Setup on Linux

Find the right partition

To list the partitions available, use lsblk.

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0   1.8T  0 disk 
├─nvme0n1p1 259:1    0   100M  0 part /boot/efi
├─nvme0n1p2 259:2    0    16M  0 part 
├─nvme0n1p3 259:3    0 465.1G  0 part 
├─nvme0n1p4 259:4    0   642M  0 part 
├─nvme0n1p5 259:5    0 931.5G  0 part
├─nvme0n1p6 259:6    0  18.6G  0 part [SWAP]
└─nvme0n1p7 259:7    0   447G  0 part /

We can get some hints from the partition size. To confirm we have the right partition, we can temporarily mount it to view its contents.

sudo mount -t ntfs-3g /dev/nvme0n1p5 /mnt/data

Here, nvme0n1p5 is the partition to be mounted, and /mnt/data is the folder it’ll be mounted to.

Add the partition to the file system table

To permanently mount a drive, we create an entry in the file system table /etc/fstab. Edit it with sudo to add this line:

/dev/nvme0n1p5 /mnt/data ntfs-3g fmask=111,umask=002,uid=1000,gid=1000 0 0

Since NTFS does not support Linux file permissions, everything in the drive is given the permission 777. The ls command will color these files with a blue-over-green font.

The options fmask=111,umask=002,uid=1000,gid=1000 mask the permissions to be identical to that of the home directory of my user (uid and gid can be retrived from the id command).

Reboot, and test that things are working the way you expect.

Syncthing

I want to sync some folders in this partition with my phone. Here’s how both OSes can use the same Syncthing database and configuration:

  1. cd into a folder inside the shared partition (or just its root). This will be the starting directory for Syncthing.
  2. Run syncthing serve --home=HOME_PATH, where HOME_PATH is a folder where Syncthing’s data will be stored. This path should also be inside the shared partition.
  3. Inside Syncthing’s Web UI, when adding folders for syncthing, always specify them with relative file paths with respect to the starting directory.