X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Finitscripts%2Finit.d%2Fpartresize;h=f9b1aa92f09f6a2aa38aecefd9f6c01cfe2c7823;hp=ae70ff99b85f153e055f2079a6f7acc3009dc8c9;hb=d2b1aa09df81e7a26cf831fe54a6d6282075ca0d;hpb=fef20dab7453231b19228efb90577070d2548c50 diff --git a/src/initscripts/init.d/partresize b/src/initscripts/init.d/partresize index ae70ff99b..f9b1aa92f 100644 --- a/src/initscripts/init.d/partresize +++ b/src/initscripts/init.d/partresize @@ -2,11 +2,11 @@ ######################################################################## # Begin $rc_base/init.d/partresize # -# Description : Resize the /var partition to the drivesize +# Description : Resize the root partition to the drivesize # # Authors : Arne Fitzenreiter - arne_f@ipfire.org # -# Version : 1.00 +# Version : 1.04 # # Notes : # @@ -22,6 +22,12 @@ case "${1}" in mount -o remount,rw / > /dev/null evaluate_retval + boot_mesg "Create /etc/mtab..." + > /etc/mtab + mount -f / || failed=1 + (exit ${failed}) + evaluate_retval + # Detect device ROOT=`mount | grep -m1 " / " | cut -d" " -f1`; if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then @@ -30,15 +36,19 @@ case "${1}" in DRV=${ROOT::`expr length $ROOT`-1} fi - boot_mesg "Change Partition 4 to all free space ..." - echo -e 'd\n4\nn\np\n4\n\n\nw\nq\n' | fdisk ${DRV} + boot_mesg "Change Partition ${DRV}3 to all free space ..." + echo -e ',+' | sfdisk --no-reread -f -N3 ${DRV} 2>/dev/null + + boot_mesg "Update c,h,s values of ${DRV}1 ..." + echo -e ',' | sfdisk --no-reread -f -N1 ${DRV} &> /dev/null # Erase symlink, it should run only once rm -f /etc/rc.d/rcsysinit.d/S25partresize boot_mesg "Rebooting ..." sync - mount -o remount,ro / > /dev/null + mount -o remount,ro / &> /dev/null + sleep 15 reboot -f ;; @@ -49,4 +59,3 @@ case "${1}" in esac # End $rc_base/init.d/partresize -