]>
git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blob - src/initscripts/system/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 ########################################################################
20 if [ -e "/.partresize" ]; then
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 mount |
while read -r dev tmp1 mountpoint tmp2
; do
33 [ "${dev}" = "rootfs" ] && continue
35 if [ "${mountpoint}" = "/" ]; then
36 # Find root partition number
39 # Find path to the root device
41 if [ ! -b "${dev::-1}" -a "${root_dev: -1}" = "p" ]; then
45 boot_mesg
"Growing root partition to maximum size..."
46 echo -e ',+' | sfdisk
--no-reread -f -N${part_num} "${root_dev}" 2>/dev
/null
48 # Update c,h,s values of the boot partition...
49 if [ ${part_num} -ne 1 -a -b "${root_dev}1" ]; then
50 echo -e ',' | sfdisk
--no-reread -f -N1 ${DRV} &> /dev
/null
53 # The filesystem should be resized after
61 boot_mesg
"Rebooting system..."
62 mount
-o remount
,ro
/ &>/dev
/null
70 echo "Usage: ${0} {start}"
75 # End $rc_base/init.d/partresize