Ventoy Forums
Dat file size change possible? - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: Dat file size change possible? (/showthread.php?tid=1589)



Dat file size change possible? - Plurix - 02-21-2021

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!


RE: Dat file size change possible? - Premiere - 02-24-2021

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.


RE: Dat file size change possible? - Premiere - 02-24-2021

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.


RE: Dat file size change possible? - jls1 - 05-23-2021

Hello
gparted is unable to check the file
[Image: e-60aacd138dfd80.59754008.jpg]


RE: Dat file size change possible? - longpanda - 05-24-2021

https://www.ventoy.net/en/plugin_persistence.html#extend_persistet_file


RE: Dat file size change possible? - jls1 - 05-24-2021

Thanks and sorry for asking something that is already documented


RE: Dat file size change possible? - jls1 - 05-24-2021

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 =========



RE: Dat file size change possible? - longpanda - 05-24-2021

Try

sudo sh ExtendPersistentImg.sh /media/demo/Ventoy/persistence_ext4_512MB_MX-Persist.dat 1024


RE: Dat file size change possible? - jls1 - 05-24-2021

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"


RE: Dat file size change possible? - longpanda - 05-24-2021

I have updated the document.