Reducing the size of the Savefile.

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
April
Posts: 493
Joined: Tue Dec 29, 2020 9:06 pm
Has thanked: 57 times
Been thanked: 28 times

Reducing the size of the Savefile.

Post by April »

From the start we have never been able to reduce the size of the Savefile . Over the years I have started of with the installation size whatever it be and as I filled it I would just increase it bit by bit. So right now I have an 8 GB sized Savefile and I have dumped a whole lot of stuff off it and its now got 5 GB free !

So I can't reduce it which means any backups or copies I want to do does so on the full 8 GB size every time ?
This is crazy because starting afresh means I loose all of the extra programs and passwords etc etc that I have and takes days to get back to something useable again. That's why I stick downloaded programs in "Software" in my Savefile now.

So surely there must be a way to just backup 5 GB . I guess i can just copy over the selected Directories but that means I can't use any automated backup services ,I have to physically do it myself. Especially difficult if you just want to update changed files in existing backups.

So has anybody got any suggestions or could I point someone to develop a shrinker?

Last edited by April on Mon Nov 29, 2021 8:49 pm, edited 2 times in total.

The Australian State Governments have all enacted laws to steal your assets on your death. All legal paperwork is binned and all assets seized on one disgruntled child's complaint.Move them well before you die or go into a home.

williwaw
Posts: 1931
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 170 times
Been thanked: 365 times

Re: Reducing the size of the Savefile.

Post by williwaw »

.

Last edited by williwaw on Mon Nov 29, 2021 1:15 am, edited 1 time in total.
williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Reducing the size of the Savefile.

Post by williams2 »

If you write zero bytes to all the unused data bytes in the save files's file system, it will compress to a smaller size. For example, I have a script called zero-savefile:

Code: Select all

#!/bin/sh
echo 'zeroing save file ...'
dd status=progress if=/dev/zero of=/root/dd.bin
sync
sync
rm /root/dd.bin
sync

Then you can backup the save file by copying it then compressing it:

Code: Select all

# cd /mnt/home/
# cp bionicpup64save.3fs /tmp/
# cd /tmp/
# gzip bionicpup64save.3fs
#
# ls -lh /mnt/home/bionicpup64save.3fs bionicpup64save.3fs.gz 
-rwxr-xr-x 1 root root  21M Nov 28 17:34 bionicpup64save.3fs.gz
-rwxr-xr-x 1 root root 256M Apr 24  2020 /mnt/home/bionicpup64save.3fs
#

Or you can create a zipped backup file directly, like:

Code: Select all

# cat /mnt/home/bionicpup64save.3fs | gzip > /tmp/bionicpup64save.3fs.gz 
# ls -lh /mnt/home/bionicpup64save.3fs /tmp/bionicpup64save.3fs.gz 
-rwxr-xr-x 1 root root 256M Apr 24  2020 /mnt/home/bionicpup64save.3fs
-rwxr-xr-x 1 root root  21M Nov 28 17:41 /tmp/bionicpup64save.3fs.gz
#

You should be able to to create an empty save file and copy all the files from the original save file to the smaller save file. Something like:

Code: Select all

# cd /mnt/home/
# dd if=/dev/zero bs=1M count=128 > out.3fs
# mkfs.ext3 out.3fs
#
# mount -o loop out.3fs /mnt/data/
# mount -o loop bionicpup64save.3fs /mnt/tmp/
# rsync -a /mnt/tmp/ /mnt/data/
#

I don't remember if I ever tried this.

EDIT: tested by copying all the files from a 256MB save file to an empty 128MB save file.
It booted with no problems.

User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: Reducing the size of the Savefile.

Post by JASpup »

I simply:

  1. backup the existing save with a compression utility

  2. create a new save of the existing save's contents with mke2fs in PackIt

  3. boot the new save

  4. enlarge the new save with Resize personal storage from Utility

  5. send the over-sized save to ether

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

proebler
Posts: 87
Joined: Sun Aug 23, 2020 6:48 am
Location: AU-TAS
Been thanked: 23 times

Re: Reducing the size of the Savefile.

Post by proebler »

Attached is a little known utility from the old forum.
Remove the .pet and you have a shell script.
Running the script allows you to do various things to/with a savefile.
It may work for you

convert-pupsave.pet
(13.15 KiB) Downloaded 72 times
User avatar
April
Posts: 493
Joined: Tue Dec 29, 2020 9:06 pm
Has thanked: 57 times
Been thanked: 28 times

Re: Reducing the size of the Savefile.

Post by April »

proebler wrote: Mon Nov 29, 2021 10:05 am

Attached is a little known utility from the old forum.
Remove the .pet and you have a shell script.
Running the script allows you to do various things to/with a savefile.
It may work for you

convert-pupsave.pet

5) Change from an ext3 to an ext2 pupsave, or vice-versa.

It would probably have worked years back but I now use "ext4 " and have much less trouble with it. Clearly I would not try it on an ext4 file system at this stage so I will investigate some earlier suggestions .

My thanks though.

The Australian State Governments have all enacted laws to steal your assets on your death. All legal paperwork is binned and all assets seized on one disgruntled child's complaint.Move them well before you die or go into a home.

User avatar
April
Posts: 493
Joined: Tue Dec 29, 2020 9:06 pm
Has thanked: 57 times
Been thanked: 28 times

Re: Reducing the size of the Savefile.

Post by April »

williams2 wrote: Sun Nov 28, 2021 10:46 pm

If you write zero bytes to all the unused data bytes in the save files's file system, it will compress to a smaller size. For example, I have a script called zero-savefile:

Code: Select all

#!/bin/sh
echo 'zeroing save file ...'
dd status=progress if=/dev/zero of=/root/dd.bin
sync
sync
rm /root/dd.bin
sync

[/code]
.

Will this work on an "ext4" file system?
I'd set up a new one myself and give it a run but I am afraid I always seem to bugger up stuff like that for some reason . I don't dare mess with my savefiles too often .

The Australian State Governments have all enacted laws to steal your assets on your death. All legal paperwork is binned and all assets seized on one disgruntled child's complaint.Move them well before you die or go into a home.

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Reducing the size of the Savefile.

Post by williams2 »

Will this work on an "ext4" file system?

Creating a temporary file filled with zeros to over write all the unused bytes in a file system should work in any file system (ext2/3/4, fat32, ntfs, etc)

This erases the unused bytes, which are often old data from deleted files.
It also allows compression, like gzip, xz, etc to be able to compress the file system more, so a backup of a file system could take less space.

Some file systems support sparse files. Ext4 and ntfs support sparse files. I don't remember if ext3 supports sparse files. if the file system supports sparse files, creating a 5G file could actually be using little or no space on the physical drive. Supposedly, this should tell you how much space a file is actually using on the drive:

Code: Select all

# dd if=/dev/zero bs=1M count=1048 > dd.bin
#
# du -h --apparent-size dd.bin ; du -h dd.bin 
1.1G	dd.bin
1.1G	dd.bin

I don't dare mess with my savefiles too often

If you are careful not to write to the original save file, copying the files in the save file to a smaller save file should not change the original file at all. just be very careful that you are not telling it to copy to the wrong file.

Post Reply

Return to “Users”