Skip to content

J501 + AGX Orin: flash fails with "mount.nfs: access denied" when host uses ZFS filesystem #4148

@mvalancy

Description

@mvalancy

Environment

Problem

Following the J501 Getting Started guide, the flash command fails at the NFS mount step:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1 --network usb0

Error:

mount.nfs: access denied by server while mounting [fc00:1:1:0::1]:/path/to/mfi_xxx/rootfs
Flash failure
Either the device cannot mount the NFS server on the host or a flash command has failed.

The flash script successfully boots the Jetson into initrd, establishes the USB network (IPv6 fc00:1:1::/48), and connects via SSH — but the Jetson cannot NFS-mount the rootfs and images directories from the host.

Root Cause

The NVIDIA flash script (tools/kernel_flash/l4t_network_flash.func) uses exportfs -o to create temporary, in-memory NFS exports. This does not work on ZFS because the Linux NFS kernel server cannot auto-derive filesystem identifiers (fsid) for ZFS datasets. The export appears to succeed on the host, but the NFS server returns "access denied" to clients trying to mount.

Ubuntu has offered ZFS as a root filesystem option during installation since 19.10, so this affects anyone who chose that option.

This is not specific to the J501 — it affects any Jetson board flashed via l4t_initrd_flash.sh from a ZFS host. The NVIDIA forums have several reports (1, 2).

Fix

NFS exports from ZFS require an explicit fsid= parameter (small integer, 1–255) and must be written to /etc/exports rather than created as temporary in-memory exports.

Quick workaround

Add these lines to /etc/exports before flashing (adjust the path to match your MFI directory):

# No square brackets around IPv6 address, no space before opening parenthesis
/path/to/mfi_xxx/rootfs fc00:1:1::/48(rw,nohide,insecure,no_subtree_check,async,no_root_squash,fsid=1)
/path/to/mfi_xxx/tools/kernel_flash/images fc00:1:1::/48(rw,nohide,insecure,no_subtree_check,async,no_root_squash,fsid=2)

Then reload and verify:

sudo chmod 755 /path/to/mfi_xxx/rootfs /path/to/mfi_xxx/tools/kernel_flash/images
sudo chown root:root /path/to/mfi_xxx/rootfs /path/to/mfi_xxx/tools/kernel_flash/images
sudo systemctl restart nfs-kernel-server
sudo exportfs -rav   # verify both exports appear

Patch the flash script

You also need to patch tools/kernel_flash/l4t_network_flash.func so the enable_nfs_for_folder() function writes to /etc/exports with fsid= and calls exportfs -ra, instead of using exportfs -o. Otherwise the script's cleanup cycle will delete your manual exports and recreate broken temporary ones.

Replace enable_nfs_for_folder with:

enable_nfs_for_folder ()
{
    local nfs_dir=$1
    local networkargs=$2
    local arr=
    IFS=':' read -r -a arr <<< "${networkargs}"
    local target_ip=${arr[1]:-fc00:1:1::/48}

    chmod 755 "${nfs_dir}"
    chown root.root "${nfs_dir}"

    # ZFS fix: use /etc/exports + exportfs -ra instead of exportfs -o
    # fsid= is required because ZFS has no stable device numbers
    local fsid_val
    if echo "${nfs_dir}" | grep -q "rootfs"; then
        fsid_val=1
    else
        fsid_val=2
    fi

    sed -i "\\|^${nfs_dir} |d" /etc/exports 2>/dev/null || true
    echo "# Entry added by NVIDIA initrd flash tool" >> /etc/exports
    echo "${nfs_dir} ${target_ip}(${PERMISSION_STR},fsid=${fsid_val})" >> /etc/exports
    exportfs -ra
}

Alternative

Copy the entire MFI directory to an ext4 filesystem (or ext4 loopback image) and flash from there.

Suggested wiki addition

A note in the Prepare the JetPack Image section would save people a lot of debugging time:

Note: If your host machine uses a ZFS filesystem (common when Ubuntu is installed with the "Erase disk and use ZFS" option), the flash will fail with mount.nfs: access denied. See [this issue] for the workaround, or copy the MFI directory to an ext4 partition before flashing.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationPage update or add at the wiki platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions