Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Is downsizing persistent.dat possible?
#1
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).
OSes: Debian Buster, Ventoy Multi Boot USB with Persistence with Linux Lite, Manjaro, MX Linux, Ubuntu Studio, Zorin and others
HW: ASUS TUF X570-Pro, AMD Ryzen 9 5900X 12-Core, 4200 Mhz, 128 GB RAM, SAMSUNG 980 PRO 2TB PCIe NVMe Gen4 SSD M.2, Intel® Eth Ctler I225-V, Logitech K520 / M510
Reply
#2
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.
Reply
#3
(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!
OSes: Debian Buster, Ventoy Multi Boot USB with Persistence with Linux Lite, Manjaro, MX Linux, Ubuntu Studio, Zorin and others
HW: ASUS TUF X570-Pro, AMD Ryzen 9 5900X 12-Core, 4200 Mhz, 128 GB RAM, SAMSUNG 980 PRO 2TB PCIe NVMe Gen4 SSD M.2, Intel® Eth Ctler I225-V, Logitech K520 / M510
Reply
#4
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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)