Ventoy Forums

Full Version: [SOLVED] Is downsizing persistent.dat possible?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It is now possible to extend persistent dat file by using sudo sh ExtendPersistentImg.sh  datfile extend_size_mb (see 5. Extend persistent dat file here).

For example:


Code:
sudo sh ExtendPersistentImg.sh  persistent.dat 2048

"That means extend persistent.dat by 2048MB (+2GB), if the old size is 1GB, then it will grow to 3GB after you extend it."


My question is: Is it possible to do the opposite? Downsize persistent.dat?...

Example: Assuming I have a 96GB persistent.dat file, I want to resize to 64GB (65536MB). Can I issue the command below?


Code:
sudo sh ExtendPersistentImg.sh  persistent.dat -32768

So that, in the end, I'd get a persistent dat file reduced to 64GB (65536MB).
Download  https://github.com/ventoy/Ventoy/blob/ma...tentImg.sh
It accepts a negative number for shrinking the dat file. But:
1. Only ext4 filesystem is supported. XFS is not supported. XFS filesystem can not be shrinked.
2. You must make sure that after shrink, the dat file can still hold all the files inside it.
(09-24-2021, 02:16 AM)longpanda Wrote: [ -> ]Download  https://github.com/ventoy/Ventoy/blob/ma...tentImg.sh
It accepts a negative number for shrinking the dat file. But:
1. Only ext4 filesystem is supported. XFS is not supported. XFS filesystem can not be shrinked.
2. You must make sure that after shrink, the dat file can still hold all the files inside it.

Great to know that!

Thank you you Longpanda!
If we're gonna use the same command/function "ExtendPersistentImg.sh" to reduce file size we might as well change its name to "UpdatePersistentImg.sh" to avoid confusions