]>
Commit | Line | Data |
---|---|---|
a6d0d790 AF |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/fsresize | |
4 | # | |
3e011c27 | 5 | # Description : Resize the root filesystem in the background |
a6d0d790 AF |
6 | # |
7 | # Authors : Arne Fitzenreiter - arne_f@ipfire.org | |
8 | # | |
3e011c27 | 9 | # Version : 1.01 |
a6d0d790 AF |
10 | # |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | ||
18 | case "${1}" in | |
19 | start) | |
3e011c27 | 20 | boot_mesg "Background Autoresize root partition to use the whole drive" |
a6d0d790 AF |
21 | # Detect device |
22 | ROOT=`mount | grep -m1 " / " | cut -d" " -f1`; | |
23 | DRV=${ROOT::`expr length $ROOT`-1} | |
a6d0d790 | 24 | |
3e011c27 AF |
25 | boot_mesg "resize ${DRV}3 ..." |
26 | nice -n 19 $0 background ${DRV}3 > /dev/null & | |
27 | ;; | |
28 | background) | |
29 | resize2fs -p $2 | |
a6d0d790 AF |
30 | |
31 | # Erase symlink, it should run only once | |
3e011c27 | 32 | rm -f /etc/rc.d/rcsysinit.d/S42fsresize |
fbb2ebd6 | 33 | sync |
a6d0d790 | 34 | exit 0; |
3e011c27 | 35 | |
a6d0d790 | 36 | ;; |
3e011c27 | 37 | |
a6d0d790 AF |
38 | *) |
39 | echo "Usage: ${0} {start}" | |
40 | exit 1 | |
41 | ;; | |
42 | esac | |
43 | ||
44 | # End $rc_base/init.d/26fsresize |