umountroot cannot handle fuse host mounts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Wubi |
Fix Committed
|
Medium
|
Unassigned | ||
sysvinit (Ubuntu) |
Fix Released
|
Undecided
|
Evan |
Bug Description
Binary package hint: sysvinit
If root is loopmounted the host mount will be handled by the initrd and will not show up in fstab
Hence explicit DEV and TYPE are required. For fuse mounted hosts the TYPE in /proc/mounts is
fusblk so we need to rely on vol_id first to get the real filesystem type.
Following is the proposed code that should replace remount_ro within umountroot. We first
try to remount as usual and if that fails, we try to use explicit DEV and TYPE.
remount_ro () {
# ntfs-3g in hardy does not allow remounts (v 1.1120, gutsy v 1.913), and does not take -n why?
# use sed instead of awk: sed -n "\:^/[^ ]* $MTPT :p" /proc/mounts
echo remounting $1
local MTPT=$1
[ "$VERBOSE" = no ] || log_action_
MOUNT_FORCE_OPT=
[ "$(uname -s)" = "GNU/kFreeBSD" ] && MOUNT_FORCE_OPT=-f
# This:
# mount -n -o remount,ro /
# will act on a bind mount of / if there is one.
# See #339023 and the comment in checkroot.sh
mount $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev $MTPT 2>/dev/null \
|| mount $MOUNT_FORCE_OPT -n -o remount,ro dummydev $MTPT 2>/dev/null \
|| mount $MOUNT_FORCE_OPT -n -o remount,ro $MTPT 2>/dev/null
ES=$?
if [ $ES != 0 ]; then
local MOUNT="$(sed -n "\:^/[^ ]* $MTPT :p" /proc/mounts)"
local DEV=${MOUNT%% *}
local TYPE=$(
if [ -z "$TYPE" ]; then
TYPE=${MOUNT#* $MTPT }
TYPE=${TYPE%% *}
fi
mount $MOUNT_FORCE_OPT -n -o remount,ro -t $TYPE $DEV $MTPT 2>/dev/null || \
mount $MOUNT_FORCE_OPT -o remount,ro -t $TYPE $DEV $MTPT
ES=$?
fi
[ "$VERBOSE" = no ] || log_action_end_msg $ES
}
Changed in sysvinit: | |
assignee: | nobody → evand |
Changed in sysvinit (Ubuntu): | |
status: | New → Fix Released |
Depends on https:/ /bugs.launchpad .net/wubi/ +bug/186117