]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/initscripts/init.d/fsresize
kernel: updated omap and rpi kernel to 2.6.42.19 (aka 3.2.19).
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / fsresize
CommitLineData
a6d0d790
AF
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
18case "${1}" in
19 start)
fbb2ebd6
AF
20 boot_mesg "Mounting root file system in read/write mode ..."
21 mount -o remount,rw / > /dev/null
22 evaluate_retval
a6d0d790 23
fbb2ebd6 24 boot_mesg "Autoresize /var partition to use the whole drive ..."
a6d0d790
AF
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 ..."
2d57443b 29 fsck -f -y ${DRV}4
a6d0d790
AF
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
fbb2ebd6 37 sync
a6d0d790
AF
38
39 exit 0;
40 ;;
41 *)
42 echo "Usage: ${0} {start}"
43 exit 1
44 ;;
45esac
46
47# End $rc_base/init.d/26fsresize