Ventoy Forums

Full Version: Dat file size change possible?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have a 128 GB USb Ventoy with some Linux flavors, and would like to increase the dat file size on some of them, without losing its content.

Is it feasible?

How to accomplish that?

Thanks!
What do you mean by dat file, the persistence file?
All that is... is a ext formated image file that can be rebuilt and you can copy over all previous data over, there also a required format setting for the (ext3 I think) image that I don't remember right off hand.
Also remember not to ever do a dist-upgrade.
What better is just to rebuild the squash file system.
Thats what I do , I setup custom built iso with a script I altered from remastersys. Works perfect, I also have full control over the compression.
This is what I would do in the terminal
The easiest way... I think
make a copy of your dat file
cp datfile /home/
get the size exact size
ls -l --block-size=M yourdatfile
Take Note
Then simply
dd bs=1M seek=your-numbers-Above-no-letters if=/dev/zero of=yourdatfile count=numberOfAdditionalMegaBytes
Then simple open in gparted
sudo gparted yourdatfile
right click your virtualdrive file and select check, and then hit the check mark button (apply all operations button) it will automatically resize the ext file system.
That's the easiest way I can think of.

Hope this helps.
Hello
gparted is unable to check the file
[Image: e-60aacd138dfd80.59754008.jpg]
Thanks and sorry for asking something that is already documented
Hello
I got the following errors, but the file has been resized
Code:
$ sh ExtendPersistentImg.sh /media/demo/Ventoy/persistence_ext4_512MB_MX-Persist.dat 1024
Extend dat file... (current is 512MB, append 1024MB, total 1536MB)
losetup: /dev/loop1: failed to set up loop device: Permesso negato
Extend ext filesystem by resize2fs ...
resize2fs /dev/loop1 1536M
e2fsck 1.44.5 (15-Dec-2018)
e2fsck: Permesso negato while trying to open /dev/loop1
You must have r/w access to the filesystem or be root
resize2fs 1.44.5 (15-Dec-2018)
open: Permesso negato while opening /dev/loop1
losetup: /dev/loop1: detach failed: Permesso negato

======= FAILED =========
Try

sudo sh ExtendPersistentImg.sh /media/demo/Ventoy/persistence_ext4_512MB_MX-Persist.dat 1024
The file was already enlarged but using it it is still seen as 512 MB by the system.
I used the command with the sudo in front and now the system reports the correct size.
thanks again

PS. I think you should modify the documentation adding the "sudo"
I have updated the document.