force to remount,ro

This commit is contained in:
Kolan Sh 2013-04-01 17:47:47 +04:00
parent e7449d103f
commit 701ac9da01
5 changed files with 11 additions and 11 deletions

View File

@ -21,7 +21,7 @@ case $1 in
sed -i "s~init=/sbin/e4rat-[a-z]*~init=/sbin/e4rat-collect~g" \
$GRUB_CFG_FLIST && \
echo "remounting /boot -> ro" && \
mount -o remount,ro /boot && \
mount -o remount,ro -force /boot && \
echo -e "#/bin/bash\n\n(/usr/sbin/e4rat_finalize.sh && rm -f /etc/local.d/e4rat_finalize.start)&\n" \
> /etc/local.d/e4rat_finalize.start && \
chmod 755 /etc/local.d/e4rat_finalize.start
@ -34,7 +34,7 @@ case $1 in
sed -i "s~init=/sbin/e4rat-[a-z]*~init=/sbin/e4rat-preload~g" \
$GRUB_CFG_FLIST && \
echo "remounting /boot -> ro" && \
mount -o remount,ro /boot
mount -o remount,ro -force /boot
[ 0 -ne $? ] && echo "e4rat_switch.sh $1 failed" && exit -1
;;
*)

View File

@ -566,8 +566,8 @@ if [ $STAGE_CNT -eq $STAGE ]; then
echo "======= STAGE $STAGE: remounting file systems rw->ro ======="
for fs in $RO_REMOUNT; do
echo "remounting $fs -> ro"
mount -f -o remount,ro $fs
[ 0 -ne $? ] && echo "Stage $STAGE: mount -o remount,ro $fs failed ;-( =======" && exit $STAGE
mount -f -o remount,ro -force $fs
[ 0 -ne $? ] && echo "Stage $STAGE: mount -o remount,ro -force $fs failed ;-( =======" && exit $STAGE
done
let STAGE++

View File

@ -25,7 +25,7 @@ cd /lib/modules && $NICE_CMD rm -rf `ls | grep -v "^$REVISION$"`
# rm old kernel revisions
mount -o remount,rw /boot
cd /boot && rm -f `ls System.map-* config-* vmlinuz-* initramfs-* 2>/dev/null | grep -vE "$REVISION$|$REVISION.img$"`
mount -o remount,ro /boot
mount -o remount,ro -force /boot
# rm old sources
cd /usr/src && $NICE_CMD rm -rf `find -maxdepth 1 -name "linux-*" -type d | grep -v "$SOURCES$"`
@ -34,8 +34,8 @@ cd /usr/src && $NICE_CMD rm -rf `find -maxdepth 1 -name "linux-*" -type d | grep
for fs in $RO_REMOUNT; do
if [[ "$fs" =~ ^/+usr/*$ || "$fs" =~ ^/+boot/*$ ]]; then
echo "remounting $fs -> ro"
mount -o remount,ro $fs
[ 0 -ne $? ] && echo "mount -o remount,ro $fs failed ;-( =======" && exit -1
mount -o remount,ro -force $fs
[ 0 -ne $? ] && echo "mount -o remount,ro -force $fs failed ;-( =======" && exit -1
fi
done

View File

@ -72,8 +72,8 @@ else # using kernel-rebuild
for fs in $RO_REMOUNT; do
if [[ "$fs" =~ ^/+usr/*$ || "$fs" =~ ^/+boot/*$ ]]; then
echo "remounting $fs -> ro"
mount -o remount,ro $fs
[ 0 -ne $? ] && echo "mount -o remount,ro $fs failed ;-( =======" && exit -1
mount -o remount,ro -force $fs
[ 0 -ne $? ] && echo "mount -o remount,ro -force $fs failed ;-( =======" && exit -1
fi
done

View File

@ -105,8 +105,8 @@ cd $pwdtmp
for fs in $RO_REMOUNT; do
if [[ "$fs" =~ ^/+usr/*$ || "$fs" =~ ^/+boot/*$ ]]; then
echo "remounting $fs -> ro"
mount -f -o remount,ro $fs
[ 0 -ne $? ] && echo "mount -f -o remount,ro $fs failed ;-( =======" && exit -1
mount -f -o remount,ro -force $fs
[ 0 -ne $? ] && echo "mount -f -o remount,ro -force $fs failed ;-( =======" && exit -1
fi
done