Files
bpfire/src/initscripts/init.d/fsresize
Arne Fitzenreiter c0504c5cc5 part/fsresize: fix on systems without initrd.
/proc/mounts has no correct entry for / on such systems.
Use mount instead.
2014-11-05 19:08:30 +01:00

47 lines
891 B
Bash

#!/bin/sh
########################################################################
# Begin $rc_base/init.d/fsresize
#
# Description : Resize the root filesystem in the background
#
# Authors : Arne Fitzenreiter - arne_f@ipfire.org
#
# Version : 1.01
#
# Notes :
#
########################################################################
. /etc/sysconfig/rc
. ${rc_functions}
case "${1}" in
start)
if [ -e "/.resizefs" ]; then
boot_mesg "Re-sizing root partition..."
# Find root device
mount | while read -r dev tmp1 mountpoint tmp2; do
# Skip generic entries
[ "${dev}" = "rootfs" ] && continue
if [ "${mountpoint}" = "/" ]; then
# Resize filesystem
resize2fs -p "${dev}"
# Remove marker
rm -f /.resizefs
break
fi
done
fi
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac
# End $rc_base/init.d/26fsresize