Table of contents
Download WinHex
Download link:
WinHex: Hex Editor & Disk Editor, Computer Forensics & Data Recovery Software
Install WinHex
1). After the download is complete, the winhex.zip file will appear. Unzip the file and place it in a suitable location. The picture shows the contents of winhex.zip.
2). After the decompression is completed, open the winhex.exe file directly as an administrator.
View ready-made disk files
Disk files can be created by kvm, vmware, virtualbox and other software, but self-disk files in vmdk, qcow2 and other formats need to be converted to raw format.
[root@zyq images]# /home/zyq/qemu-img convert -p -O raw generic.qcow2 generic.raw
(100.00/100%)
[root@zyq images]#
[root@zyq images]# ll generic.* -h
-rw------- 1 root root 21G Apr 6 08:54 generic.qcow2
-rw-r--r-- 1 root root 20G Apr 6 17:49 generic.raw
[root@zyq images]# ll generic.*
-rw------- 1 root root 21478375424 Apr 6 08:54 generic.qcow2
-rw-r--r-- 1 root root 21474836480 Apr 6 17:49 generic.raw
View converted disk files
Manually create disk files
-
create disk file
[root@zyq tmp]# dd if=/dev/zero of=/tmp/test.img bs=512 count=100000 100000+0 records in 100000+0 records out 51200000 bytes (51 MB) copied, 0.0909236 s, 563 MB/s [root@zyq tmp]# ll test.img -rw-r--r-- 1 root root 51200000 Apr 7 09:00 test.img [root@zyq tmp]# ll test.img -h -rw-r--r-- 1 root root 49M Apr 7 09:00 test.img
-
create partition
[root@zyq tmp]# fdisk test.img Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xfd823fb1. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): First sector (2048-99999, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-99999, default 99999): Using default value 99999 Partition 1 of type Linux and of size 47.8 MiB is set Command (m for help): w The partition table has been altered! Syncing disks. [root@zyq tmp]# partprobe test.img [root@zyq tmp]# fdisk test.img -l Disk test.img: 51 MB, 51200000 bytes, 100000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0xfd823fb1 Device Boot Start End Blocks Id System test.img1 2048 99999 48976 83 Linux
-
Install the bootloader
[root@zyq tmp]# grub2-install test.img Installing for x86_64-efi platform. Installation finished. No error reported.
-
view disk
The space occupied by core.img
2048*512/1024-0.5=1023.5Kbytes