eclipse-leda / leda-distro

Eclipse Leda provides a Yocto-based build setup for SDV.EDGE components
https://eclipse-leda.github.io/leda/
Apache License 2.0
14 stars 8 forks source link

growdisk on RPi4 with sfdisk instead of parted (signaling kernel) #59

Closed stlachev closed 1 year ago

stlachev commented 1 year ago

We are using now sfdisk instead of parted. The SD card last partition grows till the end, but we cannot signal kernel to update the size in order tools as: df -h to see it. fdisk -l works fine Upon reboot everything is ok and all tools show the correct size. How we can signal kernel to rescan for new size. echo 1 > /sys/block/$DEVICE/device/rescan didn't work raspberry-growdisk.sh

mikehaller commented 1 year ago

I think the echoing to /sys is doing a device-level rescan, not a partition-table re-read.

partprobe seems to be part of the parted package, so we would not be able to use that (license).

blockdev is mentioned by sfdisk as a replacement for the legacy -R option of sfdisk. If it's the one from https://github.com/util-linux/util-linux it would be GPL-2

Unfortunately, when i run it on the shell, i get the following:

blockdev --rereadpt /dev/vda
blockdev: ioctl error on BLKRRPART: Device or resource busy

Not sure, but partx is available on the image, so you may also try something like partx --update /dev/

Ref.:

d-s-e commented 1 year ago

fixed with https://github.com/eclipse-leda/meta-leda/commit/21d86efde707246cf3fa1deed37c49e3ce88db05