Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dat file size change possible?
#1
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!
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
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.
Reply
#3
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.
Reply
#4
Hello
gparted is unable to check the file
[Image: e-60aacd138dfd80.59754008.jpg]
Reply
#5
https://www.ventoy.net/en/plugin_persist...istet_file
Reply
#6
Thanks and sorry for asking something that is already documented
Reply
#7
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 =========
Reply
#8
Try

sudo sh ExtendPersistentImg.sh /media/demo/Ventoy/persistence_ext4_512MB_MX-Persist.dat 1024
Reply
#9
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"
Reply
#10
I have updated the document.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)