-
Notifications
You must be signed in to change notification settings - Fork 16
/
README
92 lines (62 loc) · 2.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
VHDtool
==========
A tool to examine and manipulate VHD images. Initially
meant as a way to test dynamic VHD support in my
Linux kernel loop VHD parser support. Images mount
in Win7.
Why would you use this instead of qemu-img? VHDtool
lets you tweak more parameters and create funky
VHDs (and will support differencing disks soon too!).
One more reason is that qemu-img actually produces
corrupt images that don't fit the VHD spec. Unsure
if they event mount on Win7.
Stay tuned.
Building
========
Builds on recent Linux (i.e. not RHEL5, *sigh*), and
needs libuuid (you probably have it, but look for
libuuid-devel or some similar package).
To build:
$ make
Examples
========
$ ./vhdtool
./vhdtool [-s size] [-b block_size] [-c] [-t type] create|convert ...
$ ./vhdtool create
./vhdtool -s size [-b block_size] [-c] [-t type] create vhd-file-name
command 'create' failed
$ ./vhdtool convert
./vhdtool [-b block_size] [-c] [-t type] convert source-file-name dest-file-name
command 'convert' failed
Generate a 512-byte fixed VHD:
$ vhdtool -s 512 create test.vhd
Generate a 50 sector fixed VHD:
$ vhdtool -s 512s create test.vhd
Generate a 12mb dynamic VHD:
$ vhdtool -s 12m -t dyn create test.vhd
Generate a 12mb dynamic VHD with non-default (2mb) block size:
$ vhdtool -s 12m -b 4m create test.vhd
Convert a raw image to a VHD
$ vhdtool convert test.raw test.vhd
Valid size modifiers are:
b/B/*nothing* -> bytes
k/K -> kilobytes
m/M -> megabytes
g/G -> gigabytes
t/T -> terabytes
s/S -> sectors
Special Considerations
======================
You need to pass the '-c' option if you are creating images < 127GiB
in size and the following apply to you:
1) You are converting a RAW disk imag and will be using it with the
emulated IDE controller in Hyper-V.
2) You are creating a new VHD and are expecting to use it both with
the emulated IDE controller and the virtual SCSI adapter in
Hyper-V.
The '-c' option, will ensure that the disk size implied by C/H/S
calculations will never be less than the desired image size, with
the side effect of making the image a little larger.
Contact Info
============