]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/fsresize
proxy.cgi: add more speed steps and some filetypes.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / fsresize
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/fsresize
4 #
5 # Description : Resize the /var filesystem
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
18 case "${1}" in
19 start)
20 boot_mesg "Mounting root file system in read/write mode ..."
21 mount -o remount,rw / > /dev/null
22 evaluate_retval
23
24 boot_mesg "Autoresize /var partition to use the whole drive ..."
25 # Detect device
26 ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
27 DRV=${ROOT::`expr length $ROOT`-1}
28 boot_mesg " * check filesystem on ${DRV}4 before resize ..."
29 fsck -f -y ${DRV}4
30
31 boot_mesg " * resize ${DRV}4 ..."
32 resize2fs -p ${DRV}4
33 evaluate_retval
34
35 # Erase symlink, it should run only once
36 rm -f /etc/rc.d/rcsysinit.d/S26fsresize
37 sync
38
39 exit 0;
40 ;;
41 *)
42 echo "Usage: ${0} {start}"
43 exit 1
44 ;;
45 esac
46
47 # End $rc_base/init.d/26fsresize