In config global, global is the section type. A second argument would give the section a name. A script that reads fstab.global looks for a section literally named global.
Find the path your script should read over SSH
uci show fstab
uci changes fstab
Run both read-only commands on the router. If the package fails to load, check /etc/config/fstab, any reported line number and whether block-mount is installed. Preserve pending edits. Avoid regenerating the file just to name a section.
Look for a line ending in =global. For fstab.defaults=global use uci get fstab.defaults.check_fs. For fstab.@global[0]=global try the commands below. Indices start at zero and include named sections of that type. Match the contents before choosing an index. Quotes protect the brackets from shell expansion.
uci get 'fstab.@global[0]'
uci get 'fstab.@global[0].check_fs'
If the first query returns global but the second fails, check show for an explicit check_fs option. A missing option does not imply zero. If both fail, check the package, type and index.
Reproduce the error and undo a change in a temporary package
Paste the whole block into the SSH shell. The lookup by name fails intentionally. Only the temporary examplefs files change. Leave the real fstab untouched and skip the reboot.
(
d=$(mktemp -d) || exit 1
mkdir "$d/delta" || exit 1
printf "config global\n option check_fs '0'\n" > "$d/examplefs"
u() { uci -c "$d" -P "$d/delta" "$@"; }
u show examplefs
u get examplefs.global.check_fs
u get 'examplefs.@global[0].check_fs'
u set 'examplefs.@global[0].check_fs=1'
u changes examplefs
u revert 'examplefs.@global[0].check_fs'
u changes examplefs
u get 'examplefs.@global[0].check_fs'
)
![UCI · examplefs.global → Entry not found · @global[0].check_fs → 0](/guide-assets/uci-fstab-anonymous-global-section/uci-fa2272e00239.png)
Use the verified name or index in your script. Run its get command alone and compare the value with show. If they agree but the disk is missing, check the device and mount point in cat /proc/mounts. Leave the sample value 1 uncommitted.
Verify your storage will mount at boot before enabling OpenWrt Extroot
Comments