DSL Ideas and Suggestions :: dsl-config should mount mydsl read-only
When mounting the mydsl device for loading drivers and extensions the dsl-config initscript should mount the device read-only since read-write access is not needed in this context. This is particularly important if the mydsl location is on a USB flash disk which has a limited number of possible write operations.
The read-only mount can be done by substituting the 'mount' calls with calls to the following 'mount_ro' function:
mount_ro() {
local mpoint="$1"
local entry="$(awk "(\$2==\"$mpoint\") {print; exit}" /etc/fstab)"
if [ -z "$entry" ]; then
echo "mount_ro: can't find $mpoint in /etc/fstab" >&2
return 1
fi
local mdev=$(echo "$entry" | awk '{print $1}')
local type=$(echo "$entry" | awk '{print $3}')
local opts=$(echo "$entry" | awk '{print $4}')
mount -t $type -o "$opts,ro" $mdev $mpoint
}
Hi dizzy, can you help me?
How to mount root(/) read only so that system boots normally after power failure?
original here.