Moode Forum
[How to do instruction] reduce img file size of backup - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9)
+--- Thread: [How to do instruction] reduce img file size of backup (/showthread.php?tid=416)



reduce img file size of backup - hifix - 08-19-2018

I've been trying to trim the size of a backed up img file (from an 8 gig micro sd card).  After win32diskimager has done its thing, i'm still stuck with an 8 gig image.

Tried : installing linux on a virtual machine using pishrink only to have a questionably sized, non bootable img.

Found a much easy way (and tested it).
1.  Install a hex editor (i used hex editor neo).
2.  Remove the zeros from the end of the file to the end of the code.  I left a few 0's behind just incase.
3.  Save file. 

That's it.


RE: reduce img file size of backup - Man in a van - 08-20-2018

(08-19-2018, 07:19 PM)hifix Wrote: I've been trying to trim the size of a backed up img file (from an 8 gig micro sd card).  After win32diskimager has done its thing, i'm still stuck with an 8 gig image.

Tried : installing linux on a virtual machine using pishrink only to have a questionably sized, non bootable img.

Found a much easy way (and tested it).
1.  Install a hex editor (i used hex editor neo).
2.  Remove the zeros from the end of the file to the end of the code.  I left a few 0's behind just incase.
3.  Save file. 

That's it.

Would you have time to pop a couple of screen shots up please.

win32diskimager v1.0 has a procedure to reduce the size of the file. I have found that sometimes it works and at other times it doesn't Sad

These days I use

https://www.alexpage.de/usb-image-tool/

to make a copy onto a usb stick and run pishrink on a raspberyypi3B or 3B+. Works very well.

Ronnie


https://www.alexpage.de/usb-image-tool/


RE: reduce img file size of backup - Tim Curtis - 08-20-2018

You could try using moOde's resizefs.sh command. Make sure you have a backup of the SD Card.

Boot up the SD Card with the 8GB image.

1. Change max partition size to 3GB in the command script
sudo sed -i "/PART_END=/c\PART_END=+3000M" /var/www/command/resizefs.sh

2. Resize the partition
sudo /var/www/command/resizefs.sh start

3. Reboot
sudo reboot

4. Change max partition size back to default (max size of media) in the command script
sudo sed -i "/PART_END=/c\PART_END=\"\"" /var/www/command/resizefs.sh

5. Verify partition size
df -h

-Tim


RE: reduce img file size of backup - hifix - 08-22-2018

Thanks for the feedback guys.

Man in a van, heres a screen capture showing the hex editor.

[Image: hexeditor.jpg]


RE: reduce img file size of backup - johannes - 08-25-2018

Hi
Could you advice me to find the very end of the image-file in a Hex-Editor (at 8GB or, much worse 16GB) ?
Your Example seems to show a not that large Image-File (jpeg), doesn't it ?


RE: reduce img file size of backup - hifix - 08-27-2018

(08-25-2018, 12:02 PM)johannes Wrote: Hi
Could you advice me to find the very end of the image-file in a Hex-Editor (at 8GB or, much worse 16GB) ?
Your Example seems to show a not that large Image-File (jpeg), doesn't it ?

Sure,

Just scroll all the way down and it is the right most entry on last line with "00" on it.
With my 8GB card the moode code was in the top 1/3 (approx).

The example is from an image file with a much smaller file size.  I couldnt not show the selection of the highlighting of the start and end points with an 8GB moode image.

Here is a link to the file that i used for the example:
https://en.wikipedia.org/wiki/File:11.10.2015_Samoyed.jpg


RE: reduce img file size of backup - FizzyTea - 10-08-2018

I've used

The well known PiShrink 
https://github.com/Drewsif/PiShrink

And this also one
https://gist.github.com/matteomattei/86e06f24808f7c549b615935fb178a5d

With good success.