pablobuenaposada / HonDash

Dashboard for Hondata K-Pro & S300 ECUs
GNU Affero General Public License v3.0
66 stars 29 forks source link

Image size too big #67

Closed AndreMiras closed 4 years ago

AndreMiras commented 5 years ago

The image is currently 16G and it takes a lot of time to download and copy over. http://hondash.com/SOFTWARE.html We could probably reduce this down to 1-2 gigs.

AndreMiras commented 4 years ago

We could reduce the image size to 4G by following this guide https://blog.ronnyvdb.net/2019/01/20/howto-resize-partitions-in-raw-disk-dd-image-files-img/

# mount the image
sudo losetup --find --show HonDash_v2.1.2.img
# resize it from gparted
sudo gparted /dev/loop$DEVICE_ID
# unmount
sudo losetup -d /dev/loop$DEVICE_ID
# check last block from fdisk
fdisk -l HonDash_v2.1.2.img
# write the new image with last_block+1 in the count parameter
dd bs=512 count=8486912 if=HonDash_v2.1.2.img of=HonDash-small_v2.1.2.img

Compare both images in size:

ls -lh
-rw-r--r-- 1 andre andre 4.1G Sep 23 12:43 HonDash-small_v2.1.2.img
-rw-r--r-- 1 andre andre  15G Sep 23 12:38 HonDash_v2.1.2.img

So for now the small one is ~4G, but we could probably optimize down futher