1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- disk="/dev/sda1"
- disk-size="25G"
- touch /etc/initramfs-tools/hooks/resizefs
- chmod +x /etc/initramfs-tools/hooks/resizefs
- cat >/etc/initramfs-tools/hooks/resizefs<<'EOF'
- #!/bin/sh
- set -e
- PREREQS=""
- prereqs() { echo "$PREREQS"; }
- case $1 in
- prereqs)
- prereqs
- exit 0
- ;;
- esac
- . /usr/share/initramfs-tools/hook-functions
- copy_exec /sbin/e2fsck
- copy_exec /sbin/resize2fs
- exit 0
- EOF
- touch /etc/initramfs-tools/scripts/local-premount/resizefs
- chmod +x /etc/initramfs-tools/scripts/local-premount/resizefs
- cat >/etc/initramfs-tools/scripts/local-premount/resizefs<<'EOF'
- #!/bin/sh
- set -e
- PREREQS=""
- prereqs() { echo "$PREREQS"; }
- case "$1" in
- prereqs)
- prereqs
- exit 0
- ;;
- esac
- /sbin/e2fsck -yf $disk
- /sbin/resize2fs $disk $disk-size
- /sbin/e2fsck -yf $disk
- EOF
- update-initramfs -u
- reboot
-
- rm /etc/initramfs-tools/hooks/resizefs
- rm /etc/initramfs-tools/scripts/local-premount/resizefs
- update-initramfs -u
- tune2fs -l /dev/sda1 | grep "Block "
- fdisk -l /dev/sda
- fdisk /dev/sda
|