# On one system, blkid is missing some partitions.
# maybe we need a flag, like FUZZY_BLKID or something, so we
# can check that at least some exist.
# On one system, blkid is missing some partitions.
# maybe we need a flag, like FUZZY_BLKID or something, so we
# can check that at least some exist.
# if we repartition to the same as an old partition,
# we don't want any old fses hanging around.
for (( i=1; i <= lastn; i++ )); do
# if we repartition to the same as an old partition,
# we don't want any old fses hanging around.
for (( i=1; i <= lastn; i++ )); do
- disk_mib=$(( $(parted -m $dev unit MiB print | \
- sed -nr "s#^/dev/[^:]+:([0-9]+).*#\1#p") - 1))
- if [[ ! min_disk_mib ]] || (( disk_mib < min_disk_mib )); then
- min_disk_mib=$disk_mib
+ cur_mib=$(dev-mib)
+ if [[ ! $disk_mib ]] || (( cur_mib < disk_mib )); then
+ disk_mib=$cur_mib
if [[ $DISTRO == debianbuster_bootstrap ]]; then
cat > /tmp/fai/fstab <<EOF
$first_boot_dev / btrfs noatime,subvol=$boot_vol 0 0
if [[ $DISTRO == debianbuster_bootstrap ]]; then
cat > /tmp/fai/fstab <<EOF
$first_boot_dev / btrfs noatime,subvol=$boot_vol 0 0