]>
Commit | Line | Data |
---|---|---|
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 | if [ -e "/.resizefs" ]; then | |
21 | boot_mesg "Re-sizing root partition..." | |
22 | ||
23 | # Find root device | |
24 | mount | while read -r dev tmp1 mountpoint tmp2; do | |
25 | # Skip generic entries | |
26 | [ "${dev}" = "rootfs" ] && continue | |
27 | ||
28 | if [ "${mountpoint}" = "/" ]; then | |
29 | # Resize filesystem | |
30 | resize2fs -p "${dev}" | |
31 | ||
32 | # Remove marker | |
33 | rm -f /.resizefs | |
34 | break | |
35 | fi | |
36 | done | |
37 | fi | |
38 | ;; | |
39 | ||
40 | *) | |
41 | echo "Usage: ${0} {start}" | |
42 | exit 1 | |
43 | ;; | |
44 | esac | |
45 | ||
46 | # End $rc_base/init.d/26fsresize |