Auto mount Windows partition on startup

You must disable Windows functions such as hibernation, hybrid sleep and fast startup.

If you fail to disable those services - Linux will not mount the device.

Create a file using below snippet - paste it into the terminal

sudo tee -a /etc/systemd/system/data-windows.mount > /dev/null <<EOT
[Unit]
Description=My Windows Partition
[Mount]
What=/dev/disk/by-uuid/$(lsblk -no UUID /dev/sda1)
Where=/data/windows
Type=auto
Options=rw,noatime
[Install]
WantedBy=multi-user.target
EOT

start and enable the mount

sudo systemctl enable --now data-windows.mount

Now your windows partition will be available at the path /data/windows

What the first part did was to construct a mount unit - then use tee to write it to the correct location. The UUID is inserted as the result of a command which lists the UUID of the partition in question.

More info on the concept of mount units

1 Like