I want to convert the following fstab entry to a systemd mount unit on CoreOS,

/dev/xvdb /data ext4 defaults,auto,noatime,noexec 0 0

I created data.mount,

[Unit]
Description=MongoDB Data Directory

[Mount]
What=/dev/xvdb
Where=/data
Type=ext4
Options=defaults,auto,noatime,noexec 0 0

However, I had to remove 0 0 because the unit failed to start.

[Unit]
Description=MongoDB Data Directory

[Mount]
What=/dev/xvdb
Where=/data
Type=ext4
Options=defaults,auto,noatime,noexec

The unit above starts, but I'm not sure about the Options= string. Reading about the fstab options I wonder if some are redundant.

According to Ubuntu Fstab - Community Help Wiki

auto - The filesystem can be mounted automatically (at bootup, or when mount is passed the -a option). This is really unnecessary as this is the default action of mount -a anyway.

defaults - Use default settings. Equivalent to rw, suid, dev, exec, auto, nouser, async.

This leads me to the following unit,

[Unit]
Description=MongoDB Data Directory

[Mount]
What=/dev/xvdb
Where=/data
Type=ext4
Options=defaults,noatime,noexec

Is this the proper way to create a mount unit using systemd on CoreOS?

Yes, it is the proper way to create a mount unit using systemd.

defaults is redundant. When any other options are in use, it can be omitted. It only exists to fill the relevant column in fstab.

And since auto is already a default, it too is redundant.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.