File: occupy-space.sh

package info (click to toggle)
debootstick 2.8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 296 kB
  • sloc: sh: 1,364; makefile: 34
file content (26 lines) | stat: -rwxr-xr-x 544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
THIS_DIR=$(cd $(dirname $0); pwd)
. $THIS_DIR/tools.sh

booted_device=$(get_booted_device)
disk_size_mb="$(device_size_mb "$booted_device")"

if [ "$((100*disk_size_mb))" -lt $((105*IMAGE_SIZE_MB)) ]
then
    echo "Note: debootstick will not try to span partitions over this disk because it is not significantly larger than original image."
    exit
fi

echo "** Spanning over disk space..."

{
    process_volumes "none" "$booted_device" "expand"

    set_final_vg_name

    echo RETURN 0
} | filter_quiet

echo "** Done."