]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/fsresize
core76: Sort exclude file alphabetically.
[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 root filesystem in the background
6 #
7 # Authors : Arne Fitzenreiter - arne_f@ipfire.org
8 #
9 # Version : 1.01
10 #
11 # Notes :
12 #
13 ########################################################################
14
15 . /etc/sysconfig/rc
16 . ${rc_functions}
17
18 case "${1}" in
19 start)
20 boot_mesg "Background Autoresize root partition to use the whole drive"
21 # Detect device
22 ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
23 DRV=${ROOT::`expr length $ROOT`-1}
24
25 boot_mesg "resize ${DRV}3 ..."
26 nice -n 19 $0 background ${DRV}3 > /dev/null &
27 ;;
28 background)
29 resize2fs -p $2
30
31 # Erase symlink, it should run only once
32 rm -f /etc/rc.d/rcsysinit.d/S42fsresize
33 sync
34 exit 0;
35
36 ;;
37
38 *)
39 echo "Usage: ${0} {start}"
40 exit 1
41 ;;
42 esac
43
44 # End $rc_base/init.d/26fsresize