przemoc / vidma Goto Github PK
View Code? Open in Web Editor NEWUtility for manipulating virtual disk images: VDI.
Home Page: http://tinyurl.com/vbox-vidma
License: GNU General Public License v2.0
Utility for manipulating virtual disk images: VDI.
Home Page: http://tinyurl.com/vbox-vidma
License: GNU General Public License v2.0
Operations:
info
- default onecheck
cat
resize
import
export
mount
internal
- format specific actions and modificationsVDI specific actions and modifications:
--compact
--linearize
--format=FORMAT
--blk-count=BLK_COUNT
--bam-alignment=ALIGNMENT
--bam-offset=OFFSET
--data-alignment=ALIGNMENT
--data-offset=OFFSET
--do-not-move-bam
--do-not-move-data
It's advisable to implement operations for particular formats on top of format specific actions and modifications. Format specific actions/modifications may be useful for power users.
This issue will be splitted in future.
vidma [OPTION]... FILE [OPERATION [PARAMETER]...]... [\; FILE [OPERATION [PARAMETER]...]...]...
Support for defining many operations in one vidma
invocation should be useful. Support for working on many files in one invocation doesn't look that important, but could be useful too. It may require also automatic stdin/stdout folding to make possible and meaningful below command:
vidma test.vdi export \; test.vmdk import
which could be substituted by (possibly less efficient):
vidma test.vdi export | vidma test.vmdk import
It must be checked whether above options model is achievable using one of following mechanisms:
Hi,
Thanks for the tool it is useful !
I noticed however that the minimum block count was wrong in my case, it wouldn't allow me to shrink a virtual disk size.
I commented out that check and everything worked out OK. See description below :
-- tests on Jul 28,2012 :
romain@host:[/opt/vboxes]$ vidma test.vdi 8448
Recognized file format:
Virtual Disk Image (vdi)
Requested disk resize
from 130047 block(s)
to 8448 block(s)
(each block has 1048576 bytes)
But minimal possible block count equals
4294967295 block(s)
Resize aborted.
comment out that check in vdi.c :
diff --git a/vdi.c b/vdi.c
index 5cfc600..652c795 100644
--- a/vdi.c
+++ b/vdi.c
@@ -322,12 +322,12 @@ static int resize_confirmation(vdi_start_t *vdi, int fin, int fout,
if (vdi->header.type == VDI_DYNAMIC) {
find_last_blocks(vdi, fin, &last_blk_no, &last_blk_pos);
min_blk_count = max_u32(last_blk_no, last_blk_pos) + 1;
- if (new_blk_count < min_blk_count) {
- ui->log("But minimal possible block count equals\n"
- " %21u block(s)\n",
- min_blk_count);
- return FAILURE;
- }
+// if (new_blk_count < min_blk_count) {
+// ui->log("But minimal possible block count equals\n"
+// " %21u block(s)\n",
+// min_blk_count);
+// return FAILURE;
+// }
}
ui->log("\nDisk size will change\n"
works out OK :
Recognized file format:
Virtual Disk Image (vdi)
Requested disk resize
from 130047 block(s)
to 8448 block(s)
(each block has 1048576 bytes)
Disk size will change
from 136364163072 bytes ( 130047 MB)
to 8858370048 bytes ( 8448 MB)
Image size will change
from 1453850624 bytes ( 1386 MB)
to 1453850624 bytes ( 1386 MB)
Resize operation in fact will create resized copy of the image.
NOTE UUID of the new image will be the same as old one.
NOTE Input file is safe and won't be modified.
Are you sure you want to continue? (y/N) y
Operation: Resize
[1/4] Copying blocks: 1386/1386 Done
[1/4] Syncing
[1/4] Data copied (1386 blocks in 4734 ms = ~306 B/us)
[2/4] Updating block allocation map: Done
[2/4] Syncing
[3/4] Updating file size: Done
[3/4] Syncing
[4/4] Updating header: Done
[4/4] Syncing
Operation finished
header.offset.data = 00080000 524288
header.disk.size = 0000000210000000 8858370048
header.disk.blk_count = 00002100 8448
header.disk.blk_count_alloc = 0000056a 1386
header.lchs.cylinders = 00000000 0
header.lchs.heads = 00000000 0
header.lchs.sectors = 00000000 0
The VM worked fine afterwards.
I had prior to the resize defragmented and shrunk the vm partition of the windows guest down with gparted live CD, to the size that i then requested with vidma.
Something must be wrong in find_last_blocks, but i have not investigated further.
Let me know what you think,
Regards,
Romain.
VBox 3.1.2.56127
host system: ArchLinux
guest system: winxp professional
a error message is displayed when start guest system:
A disk read error occurred press Ctrl+Alt+Delete to restart
common.h has some platform-dependent code that must be extracted from it before any further development.
There are some assumptions in the code that can be relaxed.
If there will be any GUI, it will be written in Qt.
It's not that important for me, so it has very low priority, sorry. :)
Most common ones beside VDI:
Less known:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.