]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/initscripts/init.d/partresize
flash-image: improve mount/dismount at partition resize.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / partresize
CommitLineData
a6d0d790
AF
1#!/bin/sh
2########################################################################
3# Begin $rc_base/init.d/partresize
4#
5# Description : Resize the /var partition to the drivesize
6#
7# Authors : Arne Fitzenreiter - arne_f@ipfire.org
8#
9# Version : 1.00
10#
11# Notes :
12#
13########################################################################
14
15. /etc/sysconfig/rc
16. ${rc_functions}
17
18case "${1}" in
19 start)
20
fbb2ebd6
AF
21 boot_mesg "Mounting root file system in read/write mode ..."
22 mount -o remount,rw / > /dev/null
23 evaluate_retval
a6d0d790
AF
24
25 # Detect device
26 ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
27 DRV=${ROOT::`expr length $ROOT`-1}
28
29 boot_mesg "Change Partition 4 to all free space ..."
30 echo -e 'd\n4\nn\np\n4\n\n\nw\nq\n' | fdisk ${DRV}
31
32 # Erase symlink, it should run only once
33 rm -f /etc/rc.d/rcsysinit.d/S25partresize
34
35 boot_mesg "Rebooting ..."
fbb2ebd6
AF
36 sync
37 mount -o remount,ro / > /dev/null
a6d0d790
AF
38 reboot -f
39
40 ;;
41 *)
42 echo "Usage: ${0} {start}"
43 exit 1
44 ;;
45esac
46
47# End $rc_base/init.d/partresize
48