2 ########################################################################
3 # Begin $rc_base/init.d/partresize
5 # Description : Resize the root partition to the drivesize
7 # Authors : Arne Fitzenreiter - arne_f@ipfire.org
13 ########################################################################
20 if [ -e "/.partresize" ]; then
21 boot_mesg
"Mounting root file system in read/write mode ..."
22 mount
-o remount
,rw
/ > /dev
/null
26 while read -r dev mountpoint fs options
; do
27 [ "${dev}" = "rootfs" ] && continue
29 if [ "${mountpoint}" = "/" ]; then
30 # Find root partition number
33 # Find path to the root device
35 if [ ! -b "${dev::-1}" -a "${root_dev: -1}" = "p" ]; then
39 boot_mesg
"Growing root partition to maximum size..."
40 echo -e ',+' | sfdisk
--no-reread -f -N${part_num} "${root_dev}" 2>/dev
/null
42 # Update c,h,s values of the boot partition...
43 if [ ${part_num} -ne 1 -a -b "${root_dev}1" ]; then
44 echo -e ',' | sfdisk
--no-reread -f -N1 ${DRV} &> /dev
/null
47 # The filesystem should be resized after
55 boot_mesg
"Rebooting system..."
56 mount
-o remount
,ro
/ &>/dev
/null
64 echo "Usage: ${0} {start}"
69 # End $rc_base/init.d/partresize