From 701ac9da01ac50b888a495f5f758114d17f7c72f Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 1 Apr 2013 17:47:47 +0400 Subject: [PATCH] force to remount,ro --- sbin/e4rat_switch.sh | 4 ++-- sbin/gentoo-upgrade.sh | 4 ++-- sbin/kernel-clean.sh | 6 +++--- sbin/kernel-getlast.sh | 4 ++-- sbin/kernel-rebuild.sh | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sbin/e4rat_switch.sh b/sbin/e4rat_switch.sh index e894210..5be6d52 100755 --- a/sbin/e4rat_switch.sh +++ b/sbin/e4rat_switch.sh @@ -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 ;; *) diff --git a/sbin/gentoo-upgrade.sh b/sbin/gentoo-upgrade.sh index f1c9174..2ec112f 100755 --- a/sbin/gentoo-upgrade.sh +++ b/sbin/gentoo-upgrade.sh @@ -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++ diff --git a/sbin/kernel-clean.sh b/sbin/kernel-clean.sh index 9131f6c..5197e5b 100755 --- a/sbin/kernel-clean.sh +++ b/sbin/kernel-clean.sh @@ -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 diff --git a/sbin/kernel-getlast.sh b/sbin/kernel-getlast.sh index f6a79d4..0ee072c 100755 --- a/sbin/kernel-getlast.sh +++ b/sbin/kernel-getlast.sh @@ -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 diff --git a/sbin/kernel-rebuild.sh b/sbin/kernel-rebuild.sh index 6237267..4e41fdd 100755 --- a/sbin/kernel-rebuild.sh +++ b/sbin/kernel-rebuild.sh @@ -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