|
@@ -2,100 +2,44 @@
|
2
|
2
|
|
3
|
3
|
-----
|
4
|
4
|
|
5
|
|
-**RU:** Скрипт снятия образа данных через утилиту **[ntfsclone](https://linux.die.net/man/8/ntfsclone)** или **[dd](https://linux.die.net/man/1/dd)** с носителей XEN\KVM <br>
|
|
5
|
+**RU:** Скрипт снятия образа данных через утилиту **[dd](https://linux.die.net/man/1/dd)** с носителей XEN\KVM <br>
|
6
|
6
|
- с максимальным сжатием данных<br>
|
7
|
|
-**(для HVM OS Windows)**<br>
|
|
7
|
+**(для любых систем HVM)**<br>
|
8
|
8
|
Параметры использования скрипта задаются в секции **manual_parameters**<br>
|
9
|
|
-для скрипта необходим пакет **dialog**.
|
|
9
|
+для скрипта необходимы пакеты: **dialog**, **dd**, **pigz**, **gunzip** .
|
10
|
10
|
|
11
|
|
-для получения необходимых параметров скрипта - пример:
|
12
|
|
-```
|
13
|
|
-losetup /dev/loop1 /kvm/win7x64/disk_c.img
|
14
|
|
-losetup -a
|
15
|
|
-dev/loop0: [2055]:2103175 (/kvm/win7x64/disk_c.img)
|
16
|
|
-```
|
17
|
|
-
|
18
|
|
-`fdisk -l /dev/loop0`
|
19
|
|
-
|
20
|
|
-```
|
21
|
|
-Disk /dev/loop0: 80 GiB, 85899345920 bytes, 167772160 sectors
|
22
|
|
-Units: sectors of 1 * 512 = 512 bytes
|
23
|
|
-Sector size (logical/physical): 512 bytes / 512 bytes
|
24
|
|
-I/O size (minimum/optimal): 512 bytes / 512 bytes
|
25
|
|
-Disklabel type: dos
|
26
|
|
-Disk identifier: 0x677d5646
|
27
|
|
-```
|
28
|
|
-
|
29
|
|
-```
|
30
|
|
-Device Boot Start End Sectors Size Id Type
|
31
|
|
-/dev/loop0p1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
|
32
|
|
-/dev/loop0p2 206848 167770111 167563264 79,9G 7 HPFS/NTFS/exFAT
|
33
|
|
-```
|
34
|
|
-
|
35
|
|
-у нас на образе 2 раздела.<br>
|
36
|
|
-каждый раздел это: **sda1** и **sda2**<br>
|
37
|
|
-смещение для каждого раздела получаем вычислением:<br>
|
38
|
|
-
|
39
|
|
-**sda1 offset:( 512 х 2048 = 1048576 )**<br>
|
40
|
|
-**sda2 offset:( 512 x 206848 = 105906176 )**<br>
|
41
|
|
-
|
42
|
|
-результат вносим в раздел скрипта **manual_parameters**<br>
|
|
11
|
+настройки вносим в раздел скрипта **manual_parameters**<br>
|
43
|
12
|
теперь скрипт сможет сам как сохранять так и восстанавливать данные с образа виртуальной машины.<br>
|
44
|
13
|
|
45
|
14
|
Пожалуйста обратите внимание, параметры скрипта это массивы, вносите изменения так же как в исходном коде,<br>
|
46
|
15
|
скрипт всегда опрашивает значения как массив, независимо одно значение или более.<br>
|
47
|
16
|
|
48
|
17
|
**Внимание!!**<br>
|
49
|
|
-**До начала использования скрипта рекомендую предварительно сделать копию файла образа (пример : /kvm/win7x64/disk_c.img)**<br>
|
|
18
|
+**До начала использования скрипта рекомендую предварительно сделать копию файла образа (пример : /kvm/vm1/sda.img)**<br>
|
50
|
19
|
и только если все прошло успешно, копию можно удалить.<br>
|
51
|
20
|
Диалог скрипта поддерживает 2 языка: RU и EN<br>
|
52
|
21
|
|
|
22
|
+**Если возникает ошибка: "Peer's Certificate issuer is not recognized"**<br>
|
|
23
|
+используейте параметр: git -c http.sslVerify=false clone ...
|
|
24
|
+
|
|
25
|
+
|
53
|
26
|
<hr>
|
54
|
|
-**EN:** A script to extract a data image via the **[ntfsclone](https://linux.die.net/man/8/ntfsclone)** or **[dd](https://linux.die.net/man/1/dd)** utility from XEN \ KVM <br>
|
|
27
|
+**EN:** A script to extract a data image via the **[dd](https://linux.die.net/man/1/dd)** utility from XEN \ KVM <br>
|
55
|
28
|
- with maximum data compression<br>
|
56
|
|
-**(for HVM OS Windows)**<br>
|
|
29
|
+**(for HVM all OS)**<br>
|
57
|
30
|
Parameters for using the script are specified in section **manual_parameters**<br>
|
58
|
|
-for the script you need the package **dialog**.
|
|
31
|
+for the script you need the packages: **dialog**, **dd**, **pigz**, **gunzip** .
|
59
|
32
|
|
60
|
|
-to get the necessary parameters of the script - an example:<br>
|
61
|
|
-```
|
62
|
|
-losetup /dev/loop1 /kvm/win7x64/disk_c.img
|
63
|
|
-losetup -a
|
64
|
|
-dev/loop0: [2055]:2103175 (/kvm/win7x64/disk_c.img)
|
65
|
|
-```
|
66
|
|
-
|
67
|
|
-`fdisk -l /dev/loop0`
|
68
|
|
-
|
69
|
|
-```
|
70
|
|
-Disk /dev/loop0: 80 GiB, 85899345920 bytes, 167772160 sectors
|
71
|
|
-Units: sectors of 1 * 512 = 512 bytes
|
72
|
|
-Sector size (logical/physical): 512 bytes / 512 bytes
|
73
|
|
-I/O size (minimum/optimal): 512 bytes / 512 bytes
|
74
|
|
-Disklabel type: dos
|
75
|
|
-Disk identifier: 0x677d5646
|
76
|
|
-```
|
77
|
|
-
|
78
|
|
-```
|
79
|
|
-Device Boot Start End Sectors Size Id Type
|
80
|
|
-/dev/loop0p1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
|
81
|
|
-/dev/loop0p2 206848 167770111 167563264 79,9G 7 HPFS/NTFS/exFAT
|
82
|
|
-```
|
83
|
|
-
|
84
|
|
-
|
85
|
|
-at us on an image of 2 sections.<br>
|
86
|
|
-each partition is: **sda1** and **sda2**<br>
|
87
|
|
-the offset for each section is obtained by computing:<br>
|
88
|
|
-
|
89
|
|
-**sda1 offset :( 512 x 2048 = 1048576)**<br>
|
90
|
|
-**sda2 offset :( 512 x 206848 = 105906176)**<br>
|
91
|
|
-
|
92
|
|
-the result is added to the section of the script **manual_parameters**<br>
|
|
33
|
+the start parameters is added to the section of the script **manual_parameters**<br>
|
93
|
34
|
Now the script itself can both save and restore data from the virtual machine image.<br>
|
94
|
35
|
|
95
|
36
|
Please note, the script settings are arrays, make the changes as well as in the source code, <br>
|
96
|
37
|
The script always interrogates values as an array, independently one value or more.<br>
|
97
|
38
|
|
98
|
39
|
**Attention!!**<br>
|
99
|
|
-**Before using the script, I recommend that you first make a copy of the image file (example: /kvm/win7x64/disk_c.img)**<br>
|
|
40
|
+**Before using the script, I recommend that you first make a copy of the image file (example: /kvm/vm1/sda.img)**<br>
|
100
|
41
|
and only if everything went well, a copy can be deleted.<br>
|
101
|
|
-The script dialog supports 2 languages: RU and EN<br>
|
|
42
|
+The script dialog supports 2 languages: RU and EN<br>
|
|
43
|
+
|
|
44
|
+**If an error occurs: "Peer's Certificate issuer is not recognized"**<br>
|
|
45
|
+use example: git -c http.sslVerify=false clone ...
|