dsl-config should mount mydsl read-only


Forum: DSL Ideas and Suggestions
Topic: dsl-config should mount mydsl read-only
started by: dizzy

Posted by dizzy on Feb. 23 2007,19:30
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
}

Posted by ecc1234 on Mar. 22 2007,13:35
Hi dizzy, can you help me?

How to mount root(/) read only so that system boots normally after power failure?

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.