That’s great, good spot. I’ve just tested and merged. Thank a lot
This fix will be included in all emonPi/emonBase/emonSD units by default. Existing users can pull in the fix via admin > emonpiupdate.
For reference here is the output I got expanding to a 16Gb card:
Current Disk Info:
Disk /dev/mmcblk0: 14.5 GiB, 15552479232 bytes, 30375936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x50c2568e
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 96663 88472 43.2M c W95 FAT32 (LBA)
/dev/mmcblk0p2 98304 8290303 8192000 3.9G 83 Linux
/dev/mmcblk0p3 8290304 30273536 21983233 10.5G 83 Linux
======================================================
Proposed changes to be made:
SD card total disk size = 14.484375Gb
Data Partition size = 10.4824223518Gb
Are you sure you want to proceed? [Y/n]
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
This error message can however be disregarded, because your system
is about to be rebooted, and the new partition table will then be
read by your operating system.
Writing the resize2fs_once script
======================================================================
So far, so good... in 20s your system will reboot
and resize the /home/pi/data filesystem to fill the resized partition.
**THIS OPERATION WILL TAKE UP TO 20 MINUTES**
When completed the Pi will poweroff and close down.
PLEASE DO NOT UNPLUG THE POWER FOR AT LEAST 30min
because it will likely result in an unusable filesystem.
=====================================================================
Then after waiting for the unit to shutdown then reboot:
pi@emonpi:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.9G 1.6G 2.2G 42% /
devtmpfs 484M 0 484M 0% /dev
tmpfs 489M 0 489M 0% /dev/shm
tmpfs 489M 6.6M 482M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
tmpfs 50M 208K 50M 1% /var/log
tmpfs 1.0M 0 1.0M 0% /var/tmp
tmpfs 30M 0 30M 0% /tmp
/dev/mmcblk0p1 43M 22M 21M 52% /boot
/dev/mmcblk0p3 11G 113M 9.7G 2% /home/pi/data
tmpfs 98M 0 98M 0% /run/user/1000