启动应该成为 Windows 8.1 操作系统的虚拟机时,如何访问/启动/通过特定分区(在本例中为联想恢复分区)?
原始磁盘布局
ThinkPad X1 Carbon 2nd Gen. 在其原始磁盘布局中有一个恢复分区。例如,在型号 20A7005RGE 中,磁盘布局结构如下:
- sda1: ntfs,WINRE_DRV,~1GB
- sda2: fat32, SYSTEM_DRV, 约 260MB
- sda3:未知,Microsoft 保留分区,~128MB
- sda4:ntfs,Windows8_OS,~217GB
- sda5:ntfs,Lenovo_Recovery,约 14GB
- sda6:未知,基本数据分区,~7GB [/list]
另请参阅http://users.wfu.edu/yipcw/lenovo/2014/X1C2/: 读磁盘布局在部分OEM软件。
重要分区的克隆
我使用 dd 保留了每个重要分区的克隆。例如,对于 sda1,我指示:
dd if=/dev/sda1 of=/mnt/usb/WINRE_DRV.dd
对其余部分(sda3 和 sda4 除外)也执行了类似操作。
创建虚拟磁盘
主要用于硬件测试目的(即移动宽带调制解调器)以及某些软件,我尝试从 VirtualBox 中的恢复分区安装 Windows (8.1)。为此,我在虚拟磁盘中重新创建了原始磁盘布局。请注意,分区大小是从原始磁盘布局中提取的(如上所述),并注意选择正确的分区类型(NTFS、Windows 恢复环境、EFI 等)。
# create sparse image
dd if=/dev/zero of=ThinkPad_Recovery.img bs=1 count=0 seek=256G
# re-create partitioning scheme as root
fdisk ThinkPad_Recovery.img
# OR
gdisk ThinkPad_Recovery.img
# access partitions contained in image via /dev/loop*?
partx -a ThinkPad_Recovery.img
确认虚拟磁盘的布局
# check...
fdisk -lu ThinkPad_Recovery.img
Disk ThinkPad_Recovery.img: 256 GiB, 274877906944 bytes, 536870912 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
Disklabel type: gpt
Disk identifier: 3E289338-246A-44DE-B7F6-80250FDFD417
Device Start End Size Type
ThinkPad_Recovery.img1 2048 2050047 1000M Windows recovery environment
ThinkPad_Recovery.img2 2050048 2582527 260M EFI System
ThinkPad_Recovery.img3 2582528 2844671 128M Microsoft reserved
ThinkPad_Recovery.img4 2844672 457926655 217G Microsoft basic data
ThinkPad_Recovery.img5 457926656 491481087 16G Windows recovery environment
ThinkPad_Recovery.img6 491481088 506161151 7G Microsoft basic data
克隆虚拟磁盘内的原始分区
# copy content of dd-ed partitions into corresponding partitions inside the virtual disk
dd if=WINRE_DRV.dd of=/dev/loop1p1
dd if=SYSTEM_DRV.dd of=/dev/loop1p2
dd if=Lenovo_Recovery.dd of=/dev/loop1p5
dd if=Basic_data_partition.dd of=/dev/loop1p6
# device mappings removed after rebooting!
只是要确定...
# reporting
tpx1c2g original_partitions # fdisk -l ThinkPad_Recovery.img
Disk ThinkPad_Recovery.img: 256 GiB, 274877906944 bytes, 536870912 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
Disklabel type: gpt
Disk identifier: 3E289338-246A-44DE-B7F6-80250FDFD417
Device Start End Size Type
ThinkPad_Recovery.img1 2048 2050047 1000M Windows recovery environment
ThinkPad_Recovery.img2 2050048 2582527 260M EFI System
ThinkPad_Recovery.img3 2582528 2844671 128M Microsoft reserved
ThinkPad_Recovery.img4 2844672 457926655 217G Microsoft basic data
ThinkPad_Recovery.img5 457926656 491481087 16G Windows recovery environment
ThinkPad_Recovery.img6 491481088 506161151 7G Microsoft basic data
gdisk -l ThinkPad_Recovery.img
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk ThinkPad_Recovery.img: 536870912 sectors, 256.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 3E289338-246A-44DE-B7F6-80250FDFD417
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 536870878
Partitions will be aligned on 2048-sector boundaries
Total free space is 30711741 sectors (14.6 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 2050047 1000.0 MiB 2700 WINRE_DRV
2 2050048 2582527 260.0 MiB EF00 SYSTEM_DRV
3 2582528 2844671 128.0 MiB 0C01 Microsoft Reserved ...
4 2844672 457926655 217.0 GiB 0700 Windows8_OS
5 457926656 491481087 16.0 GiB 2700 Lenovo_Recovery
6 491481088 506161151 7.0 GiB 0700 Unlabeled
到目前为止一切顺利。正在转换。图片进入 。虚拟专用网络通过VBoxManage convertfromraw ThinkPad_Recovery.img ThinkPad_Recovery.vdi --format VDI
并使用这个新的虚拟机,似乎可以工作。
但是,启动机器后屏幕显示为:。
似乎无法访问实际的恢复分区(以“Lenovo_Recovery”命名)。我该怎么做?