Advertisement
Tritonio

Chunked/split VMDK file with pieces less/smaller than 2GB each

Sep 20th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. I had a similar problem with the same solution as this one. I use sync tools (rsync, unison) for file synchronization between my work computers, and large HDD image files are a problem for those. I coult not find any ready solution for this online, but reading the previous posts allowed me te create one of my own.
  2.  
  3. As mentioned by mpack VMDK extents may be smaller than 2GB, but there are no tools for creating them in such a way. I got it working by doing the following:
  4.  
  5. 1 - Creating a flat/fixed hard disck as big as a single fragment (128MB, for example).
  6.  
  7. VBoxManage createhd --filename disk.vmdk --format VMDK --variant FIXED --size 128MB
  8.  
  9. 2 - Replicating the slice as many times as needed (8 times for 1GB)
  10.  
  11. for i in $(seq -w 0001 8); do
  12. cp disk-flat.vmdk disk-s$i.vmdk
  13. done
  14. rm disk-flat.vmdk
  15.  
  16. 3 - Edit disk.vmdk to use the slices instead of the flat image:
  17. 3a - change createtype to "twoGbMaxExtentSparse"
  18. 3b - repeat RW line for each slice file.
  19. 3c - remove all ddb.geometry lines.
  20.  
  21. In order to make the process easier i wrote a script (linux, bash, requires gawk).
  22. pastebin dot com/8G4BSgt7
  23.  
  24. To create a 1GB disk named disk.vmdk made of 128MB fragments use:
  25. ./create_split_vmdk.sh --filename disk --fragment 128 --size 1024
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement