mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 11:35:54 +02:00
47 lines
891 B
Bash
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
|