Search code examples
mountnfsnvidia-jetsonfstab

Jetson Nano: Mounting NFS drives at Boot


I'm migrating a system from an Odyssey Blue to a Jetson Nano 4gb. On the Odyssey Blue I could mount an NFS device with the following entry into the /etc/fstab file:

<server>/mnt/path/to/target /mnt/path/to/source nfs rw 0 0

On the Jetson this fstab entry fails on boot because the network device is not available. What appears to happen is that the Jetson boot process is faster than the systemd can mount the network device. So when the boot process looked to mount the inventory from fstab it fails.

You can however, re-run the /etc/fstab file post boot with sudo mount -av and it will mount in this configuration. So the issue is most likely a timing issue.

Unlike the Odyssey Blue the Jetson Nano boots in just a couple of seconds total time.

How do you mount a network drive at boot time on a Jetson Nano?


Solution

  • After searching for similar issues, I couldn't find anything related to non root mounts.

    Here are the options that didn't work:

    _netdev
    

    And this seems like the correct options per systemd.mount

    Here is what worked for future reference:

    <server>/mnt/path/to/target /mnt/path/to/source nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10 0 0
    

    It also took the combination of all these options.

    nofail
    

    With nofail, this mount will be only wanted, not required, by local-fs.target or remote-fs.target. Moreover the mount unit is not ordered before these target units. This means that the boot will continue without waiting for the mount unit and regardless whether the mount point can be mounted successfully.

    x-systemd.automount
    

    An automount unit will be created for the file system. See systemd.automount(5) for details.

    x-systemd.requires=
    

    Configures a Requires= and an After= dependency between the created mount unit and another systemd unit, such as a device or mount unit. The argument should be a unit name, or an absolute path to a device node or mount point. This option may be specified more than once. This option is particularly useful for mount point declarations that need an additional device to be around (such as an external journal device for journal file systems) or an additional mount to be in place (such as an overlay file system that merges multiple mount points). See After= and Requires= in systemd.unit(5) for details.

    x-systemd.device-timeout=
    

    Configure how long systemd should wait for a device to show up before giving up on an entry from /etc/fstab. Specify a time in seconds or explicitly append a unit such as "s", "min", "h", "ms".

    Note that this option can only be used in /etc/fstab, and will be ignored when part of the Options= setting in a unit file.