Auto-mount drives at boot

While not exactly the same - you get an idea of how simple it is using systemd

In your case (you won’t need the automount) create two files - one for each partition

So proceed to create a file data-part1.mount

/etc/systemd/system/data-part1.mount

with content (use lsblk -o PATH,UUID to get UUID) and replace $UUID with the actual UUID

[Unit]
Description=Data partition 1

[Mount]
What=/dev/disk/by-uuid/$UUID
Where=/data/part1
Type=auto
Options=rw,noatime

[Install]
WantedBy=multi-user.target

Create one more and name it data-part2.mount

/etc/systemd/system/data-part2.mount

with content (use lsblk -o PATH,UUID to get UUID) and replace $UUID with the actual UUID

[Unit]
Description=Data partition 2

[Mount]
What=/dev/disk/by-uuid/$UUID
Where=/data/part2
Type=auto
Options=rw,noatime

[Install]
WantedBy=multi-user.target

Then start and enable to units

sudo systemctl enable --now data-part1.mount data-part2.mount

Set permissions on the mount points as needed

sudo chmod ugo+rw /data/part1 /data/part2
4 Likes