~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/initscripts/init.d/fsresize

  • Committer: Dirk Wagner
  • Date: 2014-12-23 08:02:23 UTC
  • mfrom: (4405.56.108)
  • Revision ID: git-v1:601f8347ccb1e9c5e3f250ff26d4097ecd698875
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into asterisk-update

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
case "${1}" in
19
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
 
 
 
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
36
38
                ;;
37
39
 
38
40
        *)