fix(nfs): switch to unfs3 user-space NFS (kernel nfsd unavailable on HA OS)

This commit is contained in:
2026-03-31 11:58:49 +02:00
parent 5cc5363936
commit 8d5668252f
4 changed files with 12 additions and 32 deletions

View File

@@ -11,9 +11,9 @@ for index in $(bashio::config 'shares|keys[]'); do
MOUNT_PATH="/${FOLDER}"
if bashio::var.true "${READ_ONLY}"; then
OPTIONS="ro,sync,no_subtree_check,no_root_squash"
OPTIONS="ro,no_root_squash"
else
OPTIONS="rw,sync,no_subtree_check,no_root_squash"
OPTIONS="rw,no_root_squash"
fi
bashio::log.info "Exporting ${MOUNT_PATH} to ${NETWORK} (${OPTIONS})..."
@@ -22,26 +22,6 @@ done
cat /etc/exports
# Load NFS kernel module
bashio::log.info "Loading nfsd kernel module..."
modprobe nfsd 2>/dev/null || bashio::log.warning "nfsd module not available, assuming built-in..."
# Mount nfsd filesystem if not already mounted
if ! mountpoint -q /proc/fs/nfsd 2>/dev/null; then
bashio::log.info "Mounting nfsd filesystem..."
mount -t nfsd nfsd /proc/fs/nfsd || bashio::log.warning "Could not mount nfsd filesystem, it may be built-in..."
fi
# Start NFS services
bashio::log.info "Starting NFS services..."
rpcbind
exportfs -ra
# Start rpc.statd for file locking
rpc.statd &
# Start the NFS server kernel threads
rpc.nfsd
# Start rpc.mountd in the foreground to keep the container running
exec rpc.mountd --no-udp -F
# Start unfs3 user-space NFS server in foreground
bashio::log.info "Starting unfs3 NFS server..."
exec unfsd -d -e /etc/exports