Identify the boot disk and data partitions
Connect over SSH. On an x86 installation with lsblk, find the partition mounted at /, follow the tree to its parent disk and identify any later partitions on that disk. An unmounted partition may still contain data. With SquashFS or an external overlay, also identify the device that holds the writable layer in the mount table. Stop if any mapping is unclear.
lsblk -o NAME,TYPE,SIZE,RO,MOUNTPOINT
df -h /
cat /proc/mounts

The OpenWrt 25.12.6 guest in the screenshot boots from ext4. The size in lsblk is the partition capacity. The figures in df describe the mounted filesystem and its free space. These figures can differ. Keep a restorable whole-disk copy and a separate backup of application data on another disk. Use the copy to compare the start and end sectors of the partitions.
Will LuCI reuse the previous root partition size?
Using -S for one owut download does not tell you what LuCI will request next time. Read the saved value over SSH. Versions of Attended Sysupgrade that support this setting can use it even when the form has no size field.
uci -q get attendedsysupgrade.owut
uci -q get attendedsysupgrade.owut.rootfs_size
uci changes attendedsysupgrade
Skip these writes for a one-off download. To reuse a size, back up /etc/config/attendedsysupgrade and check for unrelated pending changes first. Only run this if the named section exists with type owut. Replace N with the safe whole number of MB you calculated. If the section is missing, use the one-off download.
size=N
case "$size" in
''|*[!0-9]*|0*) echo 'N = MB' ;;
*) [ "$(uci -q get attendedsysupgrade.owut)" = owut ] &&
pending=$(uci changes attendedsysupgrade) && [ -z "$pending" ] &&
uci set "attendedsysupgrade.owut.rootfs_size=$size" &&
uci commit attendedsysupgrade &&
uci -q get attendedsysupgrade.owut.rootfs_size ;;
esac
If nothing prints, the size is unconfirmed. Before requesting a build, open the Network panel in the browser developer tools. Request the image without installing it. Look for rootfs_size_mb in the body of the initial POST /api/v1/build. Later GET requests poll the job. If the field is absent, empty or unexpected, stop and use the one-off download below. Check the resulting image even if the value matches. Undo any persistent change after testing, removing only the option you added if it was absent.
Download the image and check it on a spare disk
owut --help
Look for download and --rootfs-size in local help. In the version shown, the short option is -S, the unit is MB and the build server sets the upper limit. To request a custom size, run owut download --rootfs-size N with N replaced by the integer you calculated for your partition layout. The download command builds, downloads and verifies the image. Inspect its partition table before installation. Stop if the new partition would extend into a data partition.
On a Linux computer, decompress a gzip-compressed whole-disk image to a regular file. Use the read-only command below on that file, substituting its actual path. Use the reported sector sizes to compare byte offsets for the end of the new root partition and the start of the next partition on the original disk. The ranges must not overlap.
fdisk -l /path/to/uncompressed-image.img
Boot a spare disk using the installation procedure for your device. Keep the original disk intact. Check mount sources, free space and the start of the data partition. If the data volume is missing, stop applications that write there. Once the mount is correct, have the application write and read a temporary file, then reboot and read it again. If the test fails, shut down and boot from the original disk. The screenshot is from a VM. No physical disk was flashed or resized.
Reference
Check which packages an attended OpenWrt upgrade will retain
Comments