---
title: Automount Additional Drives at Boot
description: Mount additional static drives at boot by utilizing either systemd mounts or the file found at /etc/fstab
---

import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';

This tutorial describes the basics of utilizing both systemd mount files and the fstab file located in /etc/ in order to mount static drives during boot. It briefly explains how to find a partition or drive's UUID, what some options do, and further reading should the information provided be insufficient.

## Prerequisites

- Root or sudo access

:::note[NTFS on Linux]
The NTFS filesystem can be unstable under Linux, whether using the ntfs, ntfs3 or ntfs-3g driver. Use it at your own risk. For better stability and performance, consider Linux native filesystems like ext4, xfs, or btrfs.
:::

## Safer and Beginner Friendly Method: Mounting Drives with Systemd Mount Files

The benefit of mounting via systemd is that even if you get something wrong in your mount file, your system will still boot. Whereas a mistake in the fstab can render your system unbootable.

### 1. List the UUIDs of your partitions

```sh title="Open a terminal and run the following command"
lsblk -f
```

```sh title="Example output"
NAME          FSTYPE FSVER LABEL UUID                                 FSAVAIL   FSUSE% MOUNTPOINTS
zram0                                                                              [SWAP]
nvme0n1
├─nvme0n1p1   vfat   FAT32       E04D-9F05
├─nvme0n1p2
├─nvme0n1p3   ntfs               08A24E90A24E81E4                      715.4G   50%
├─nvme0n1p4   vfat   FAT32       E09C-D4DA                             628.1M   39% /boot
├─nvme0n1p5   ext4   1.0         187a9f06-9411-48d9-b941-f03c2e605812  203.6G   47% /
└─nvme0n1p6   ntfs
nvme1n1
└─nvme1n1p1   ext4               4e55896f-3f1f-4bc5-aa8a-fec099689cd9  931.5G   0%

```

In this example, we want to mount an extra drive freshly formatted as ext4. We know it's a 1TB drive, and know that nothing has been stored on it yet. Therefore, we can determine the partition to be mounted is `nvme1n1p1` that has a UUID of `4e55896f-3f1f-4bc5-aa8a-fec099689cd9`.

### 2. Identifying your partition

Often `lsblk -f` will provide all the information you need to mount your disk with systemd at this point. If you're still unsure which is the correct partition, you can run the following command:

```sh
sudo fdisk -l
```

```sh title="Example output"
Device          Start       End         Sectors     Size    Type
/dev/nvme0n1p1  2048        206847      204800      100M    EFI System
/dev/nvme0n1p2  206848      239615      32768       16M     Microsoft reserved
/dev/nvme0n1p3  239616      2997384182  2997144567  1.4T    Microsoft basic data
/dev/nvme0n1p4  2997385216  2999482367  2097152     1G      EFI System
/dev/nvme0n1p5  2999482368  3905454079  905971712   432G    Linux root (x86-64)
/dev/nvme0n1p6  3905454080  3907026943  1572864     768M    Windows recovery environment
/dev/nvme1n1p1  2048        1953523711  1953521664  931.5G  Linux filesystem

```

We already know our UUID in this example. However, `fdisk -l` can make it a bit more clear to us by showing the exact size of the partition (931.5G) as well as its type (Linux filesystem).

That should make it abundantly clear to us that the partition we want is `nvme1n1p1` with a UUID of `4e55896f-3f1f-4bc5-aa8a-fec099689cd9` as described earlier. We knew earlier, but now we just know it for sure.

Once you are confident you've found the correct partition, copy the UUID. Copying from the terminal emulator is typically done with `ctrl+shift+C`.

### 3. Creating the Systemd Mount File
Let us say we want to use this drive primarily for games, a good place to mount that is in your user home. It can be anywhere you want, but for simplicity's sake we're going with in /home/user (replace user with your linux username). This matters because the mounting path dictates the name of the systemd mount file. Because this drive is intended for games, we'll mount it to the games folder in user home, `/home/user/games`.

For a systemd mount file, that translates to home-$USER-games.mount (forward slashes `/` get replaced with hypens `-`) and systemd mount files go in /etc/systemd/system.

:::tip
If you want to use a space, a hyphen, a CJK character, or an accented character in your mount folder name, it must be formatted differently. Let's say you want to use the folder path of `/home/grzegorz/brzęczyszczykiewicz`, run the following command to get the name you need to use with your file:
```bash
systemd-escape -p --suffix=mount "/home/grzegorz/brzęczyszczykiewicz"
```
Since you need to escape any `\`, you would create the mount file as `/etc/systemd/system/home-grzegorz-brz\\xc4\\x99czyszczykiewicz.mount`
:::

Feel free to use your text editor of choice, in this example we'll be using `micro`.

```sh
micro /etc/systemd/system/home-$USER-games.mount
```
:::note
If you are mounting in your user home, you can keep the above $USER in the file name, your username will automatically take its place.
:::

Paste this template into the empty file:
```ini
[Unit]
Description=

[Mount]
What=
Where=
Type=
Options=

[Install]
WantedBy=multi-user.target
```
Below are descriptions for each field in the file:

<Tabs>
  <TabItem label='Description'>
  Description can be anything you want, it's for your own recognition.
  </TabItem>
  <TabItem label= 'What'>
  Put in the UUID you copied earlier. Here it will be `UUID=4e55896f-3f1f-4bc5-aa8a-fec099689cd9`
  </TabItem>
  <TabItem label= 'Where'>
  This is the mount point. A folder will be created if it doesn't exist. Here, it will be `/home/user/games`. Replace "user" with your username if mounting in your home folder.
  </TabItem>
  <TabItem label= 'Type'>
  Filesystem type, here it will be `ext4`
  </TabItem>
  <TabItem label= 'Options'>
  Any mounting options you want. Here, we'll use `defaults,exec,rw,noatime`. No spaces is important here.
  </TabItem>
</Tabs>
---

Following the example, the filled out mount file should look like this:
```ini
[Unit]
Description=Mount games drive (/home/user/games)

[Mount]
What=UUID=4e55896f-3f1f-4bc5-aa8a-fec099689cd9
Where=/home/user/games
Type=ext4
Options=defaults,exec,rw,noatime

[Install]
WantedBy=multi-user.target
```

### 4. Finishing Up
To mount the drive we just created an entry for, run the following:

```sh
sudo systemctl daemon-reload
sudo systemctl enable --now home-$USER-games.mount
```

You should see the folder you chose for the mount point, and can check the status of the mount with `systemctl status home-$USER-games.mount`:

```sh
● home-user-games.mount - Mount games drive (/home/user/games)
     Loaded: loaded (/proc/self/mountinfo; enabled; preset: disabled)
     Active: active (mounted) since Sat 2026-05-02 13:02:31 CDT; 23h ago
 Invocation: e52ef8fe3d754c64a3825bc1ee89e7da
      Where: /home/user/games
       What: /dev/nvme1n1p1
      Tasks: 0 (limit: 74118)
     Memory: 316K (peak: 3.9M)
        CPU: 5ms
     CGroup: /system.slice/home-user-games.mount

May 02 13:02:31 cachyos systemd[1]: Mounting Mount games drive (/home/user/games)...
May 02 13:02:31 cachyos systemd[1]: Mounted Mount games drive (/home/user/games).
```

### tl;dr

- Find the **UUID** of your partition

```sh
lsblk -f
```

- Create the mount file

```sh
micro /etc/systemd/system/mnt-foo.mount
```

Replacing `mnt-foo` with the full path of where you want to mount, swapping the `/` for `-`.

- Fill out the mount file

```sh
[Unit]
Description=Mount drive

[Mount]
What=UUID=<partition UUID>
Where=/mnt/foo
Type=somefs
Options=defaults

[Install]
WantedBy=multi-user.target
```

Replacing `<partition UUID>`, `/mnt/foo`, and `somefs` with your UUID, directory, and filesystem. eg., ext4, as well as setting any other options you may want after defaults, such as `_netdev` for a NAS, or `nofail` for any non-critical drive.

- Reload your daemon

```sh
sudo systemctl daemon-reload
```

- Mount your drive and set it to mount on boot

```sh
sudo systemctl enable --now mnt-foo.mount
```

### Additional reading

- [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html)
- [FHS on /media/](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s11.html)
- [Manual for dump](<https://linux.die.net/man/8/dump>)
- [Manual for fsck](https://man.archlinux.org/man/fsck.8)
- [systemd-mount](https://manual.siduction.org/systemd-mount_en.html)

## Advanced Method: Adding Entries to /etc/fstab

:::danger
The fstab file is read during boot, and if there is an error in the file, it can cause your system to fail to boot. Be sure to double check your entry for any typos before rebooting. If you do make a mistake, you can typically fix it by booting into a live environment and [chrooting into your installation](/features/cachy_chroot) to edit the file.
:::

### 1. List the UUIDs of your partitions

```sh title="Open a terminal and run the following command"
lsblk -f
```

```sh title="Example output"
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
zram0                                                                              [SWAP]
nvme0n1
├─nvme0n1p1 vfat   FAT32       E04D-9F05
├─nvme0n1p2
├─nvme0n1p3 ntfs               08A24E90A24E81E4                      715.4G    50%
├─nvme0n1p4 vfat   FAT32       E09C-D4DA                             628.1M    39% /boot
├─nvme0n1p5 ext4   1.0         187a9f06-9411-48d9-b941-f03c2e605812  203.6G    47% /
└─nvme0n1p6 ntfs
```

In our example, we know that we want to mount a Windows partition, which is ntfs. We also know that roughly half its space is available. Therefore, we can determine that the partition we want to mount is `nvme0n1p3` and its UUID to be `08A24E90A24E81E4`, with a file system of `ntfs` in this example.

### 2. Identifying your partition

Often `lsblk -f` will provide all the information you need to mount your disk through /etc/fstab at this point. If you're still unsure which is the correct partition, you can run the following command:

```sh
sudo fdisk -l
```

```sh title="Example output"
Device              Start        End    Sectors  Size Type
/dev/nvme0n1p1       2048     206847     204800  100M EFI System
/dev/nvme0n1p2     206848     239615      32768   16M Microsoft reserved
/dev/nvme0n1p3     239616 2997384182 2997144567  1.4T Microsoft basic data
/dev/nvme0n1p4 2997385216 2999482367    2097152    1G EFI System
/dev/nvme0n1p5 2999482368 3905454079  905971712  432G Linux root (x86-64)
/dev/nvme0n1p6 3905454080 3907026943    1572864  768M Windows recovery environment
```

We already know our UUID in this example. However, `fdisk -l` can make it a bit more clear to us by showing the exact size of the partition (1.4T) as well as its type (Microsoft basic data).

That should make it abundantly clear to us that the partition we want is `nvme0n1p3` with a UUID of `08A24E90A24E81E4` as described earlier. We knew earlier, but now we just know it for sure.

Once you are confident you've found the correct partition, copy the UUID. Copying from the terminal emulator is typically done with `ctrl+shift+C`.

### 3. Adding an Entry to /etc/fstab

Now that we've obtained the UUID of our partition, it's time to open up the fstab file.

Feel free to use your text editor of choice. In this example, we will use nano. In order to edit the fstab file, it must be opened as root:

```sh
sudo nano /etc/fstab
```

Using the arrow keys, navigate to the bottom of the fstab file, then create our new entry on an empty new line:

```sh
UUID=08A24E90A24E81E4 /media/windows ntfs3 defaults,nofail,uid=1000,gid=1000,rw,user,exec,umask=000 0 0
```

:::note
`/media/windows` needs to exist on your filesystem. Use `mkdir` to create the directory if it doesn't.
:::

The break down of this entry is as follows:

- `UUID=08A24E90A24E81E4` is the file system we want to mount, identified by its UUID. There are other methods to identify your filesystem, though UUID tends to be safest. Additional methods listed [here](https://wiki.archlinux.org/title/Fstab#Identifying_file_systems).

- `/media/windows` is the mount point of our drive. The [Linux Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html) says that `/media/` is the proper location for removable drives to be mounted. `windows` indicates the directory we wish to mount our drive to. Each drive we want to mount will need its own directory.

- `ntfs3` is the filesystem type to be used. We are explicitly using the ntfs3 kernel driver in our example. Other examples would be `ext4`, `xfs` or similar. This explicit filesystem type declaration can be replaced with `auto` to allow the mount command to make its best guess.

- `defaults,nofail,uid=1000,gid=1000,rw,user,exec,umask=000`: These are mount options:

  - `defaults`: a standard set of options including `rw, suid, dev, exec, auto, nouser, and async.`

  - `nofail`: allows the boot process to continue even if this mount fails.

  - `uid=1000` and `gid=1000`: sets the user and group ownership of the mounted files to the user and group with ID 1000.

  - `rw`: mounts the filesystem as read-write.

  - `user`: allows a non-root user to mount the filesystem.

  - `exec`: allows execution of binaries on the mounted filesystem.

  - `umask=000`: sets the file permission mask to allow read, write, and execute permissions for everyone.

  - `the first 0` dump is typically deprecated in modern systems. Leaving this at 0 won't hurt anything. Feel free to read more about it [here](https://linux.die.net/man/8/dump).

  - `the second 0` sets the order for file system checks at boot time. For a root partition, this should be 1 unless your root file system is btrfs, which should otherwise be set to 0. All other file systems in your fstab should be either 0 (disabled) or 2. More information [here](https://man.archlinux.org/man/fsck.8).

For a more in depth look of each option, visit these two [fstab man page](https://man7.org/linux/man-pages/man5/fstab.5.html) and [mount man page](https://man7.org/linux/man-pages/man8/mount.8.html)

#### More info

As an aside, all options after the filesystem type declaration are optional if you do not change them from the default.

Thus

`UUID=<partition UUID> /media/foo somefs`

and

`UUID=<partition UUID> /media/foo somefs defaults 0 0`

are equivalent.  `somefs` followed by nothing is implicitly `somefs defaults 0 0`

### 4. Finishing Up

If you wish to mount the drive you created an entry for now, you need to run the following:

```sh
sudo systemctl daemon-reload
```

and then:

```sh
sudo mount -a
```

Your drive should now appear under `/media/windows` and will appear there each time you reboot.

```sh
ls /media/windows
# '$Recycle.Bin'             Linux                  SteamLibrary
# AMD                       Modding                swapfile.sys
# Apps                      pagefile.sys          'System Volume Information'
# bootTel.dat               PerfLogs               Users
# Development               ProgramData            WiiU
# 'Documents and Settings'  'Program Files'         Windows
# DumpStack.log.tmp        'Program Files (x86)'   XboxGames
# FanControl                Recovery               xiv_modding
# Games                     RetroArch-Win64
# Intel                    'Ship of Harkinian'
 ```

 If you wish to create a link to your newly mounted drive in your home directory, you can run the following:

 ```sh
 ln -s /media/windows ~/Windows
 ```

 To show it worked:

 ```sh
 ls ~/Windows
# '$Recycle.Bin'             Linux                  SteamLibrary
# AMD                       Modding                swapfile.sys
# Apps                      pagefile.sys          'System Volume Information'
# bootTel.dat               PerfLogs               Users
# Development               ProgramData            WiiU
#'Documents and Settings'  'Program Files'         Windows
# DumpStack.log.tmp        'Program Files (x86)'   XboxGames
# FanControl                Recovery               xiv_modding
# Games                     RetroArch-Win64
# Intel                    'Ship of Harkinian'
 ```

### tl;dr

- Find the **UUID** of your partition

```sh
lsblk -f
```

- Open `/etc/fstab`

```sh
sudo nano /etc/fstab
```

- Create an entry in the bottom of the file

```sh
UUID=<partition UUID> /media/foo somefs defaults 0 0
```

Replacing `<partition UUID>`, `foo`, and `somefs` with your UUID, directory, and filesystem. eg., ext4, as well as setting any other options you may want after defaults, such as `_netdev` for a NAS, or `nofail` for any non-critical drive.

- Reload your daemon

```sh
sudo systemctl daemon-reload
```

- Mount your drive

```sh
sudo mount -a
```

This drive is now mounted, and will now be mounted on boot moving forward as well.

### Additional reading

- [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html)
- [FHS on /media/](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s11.html)
- [Manual for dump](<https://linux.die.net/man/8/dump>)
- [Manual for fsck](https://man.archlinux.org/man/fsck.8)
- [Man page for fstab](https://man.archlinux.org/man/fstab.5.en)
- [Arch Linux Wiki entry for fstab](https://wiki.archlinux.org/title/Fstab)
