Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide reduce img file size of backup
#1
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.
Reply
#2
(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/
Reply
#3
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
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
Thanks for the feedback guys.

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

[Image: hexeditor.jpg]
Reply
#5
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 ?
Reply
#6
(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...amoyed.jpg
Reply
#7
I've used

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

And this also one
https://gist.github.com/matteomattei/86e...35fb178a5d

With good success.
Reply


Forum Jump: