Public bug reported:

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_begin_msg "Mounting $MTPT filesystem 
read-only"
        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=$(/lib/udev/vol_id -t $DEV 2> /dev/null)
                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
}

** Affects: wubi
     Importance: Undecided
         Status: New

** Affects: sysvinit (Ubuntu)
     Importance: Undecided
     Assignee: Evan Dandrea (evand)
         Status: New


** Tags: wubi

** Also affects: wubi
   Importance: Undecided
       Status: New

** Tags added: wubi

** Changed in: sysvinit (Ubuntu)
     Assignee: (unassigned) => Evan Dandrea (evand)

-- 
umountroot cannot handle fuse host mounts
https://bugs.launchpad.net/bugs/186114
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to