In expand last partition script btrfs support added Improvement, expand-on-first-boot: support for btrfs added v2: the mount point for btrfs filesystem to resize is under /dev/shm by default but a variable defined in the running environment can change the temporary directory path. The /dev/shm has been chosen because in some systems /tmp can be on a RO root filesystem and /tmp not yet mounted with tmpfs. This requires the system to have /dev/shm configured into the kernel. v3: the previous version was using a bashism but the shebang is /bin/sh this means that the script will fail in a customized system in which /bin/sh do not link to bash or bash is not available. v4: Felix suggested using mktemp for the temporary directory in which to mount the btrfs filesystem to resize. The default path /tmp could be changed using the variable TMPDIR to set in the running environment. v5: typo fixes into the patch description v6: mktemp does a reasonable second try with -p /dev/shm before failing Sent by elastic mail SMTP and gone in moderation, also here in attachment. Best, R-