]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/partresize
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 ########################################################################
21 boot_mesg
"Mounting root file system in read/write mode ..."
22 mount
-o remount
,rw
/ > /dev
/null
25 boot_mesg
"Create /etc/mtab..."
27 mount
-f / || failed
=1
32 ROOT
=`mount | grep -m1 " / " | cut -d" " -f1`;
33 if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then
34 DRV
=${ROOT::`expr length $ROOT`-2}
36 DRV
=${ROOT::`expr length $ROOT`-1}
39 boot_mesg
"Change Partition ${DRV}3 to all free space ..."
40 echo -e ',+' | sfdisk
--no-reread -f -N3 ${DRV} 2>/dev
/null
42 boot_mesg
"Update c,h,s values of ${DRV}1 ..."
43 echo -e ',' | sfdisk
--no-reread -f -N1 ${DRV} &> /dev
/null
45 # Erase symlink, it should run only once
46 rm -f /etc
/rc.d
/rcsysinit.d
/S25partresize
48 boot_mesg
"Rebooting ..."
50 mount
-o remount
,ro
/ &> /dev
/null
56 echo "Usage: ${0} {start}"
61 # End $rc_base/init.d/partresize