使用从ESD创建的Windows安装光盘镜像安装Windows 10到USB外置硬盘 |
您所在的位置:网站首页 › 安装windows到usb › 使用从ESD创建的Windows安装光盘镜像安装Windows 10到USB外置硬盘 |
我用MediaCreationTool创建了一个Windows 10 1709(Fall Creators Update)的ISO镜像文件。这样下载的镜像文件和直接从MSDN下载的略有不同——最大的不同大概是系统镜像存放在名为 install.esd 而非 install.wim 的文件中。因为特殊需求,我需要把它安装到一块USB外置硬盘上,在我的MacBook Pro 13’(2013年末款)上使用它;又因为从朋友那借来了Akitio Node外置显卡盒子,无法使用Windows To Go安装(Windows To Go无法安装显卡驱动),因此只能非常蛋疼地手工安装系统了。 在开始之前,请准备一台Windows 10设备,并打开一个具有管理员权限的PowerShell或命令提示符,所有操作将在其上完成。 本文遵循以下假设: D: 是一个空闲的可用磁盘 ISO安装镜像已挂载到 J: T: 至 X: 未被占用 提取WIM(如果你手上的ISO文件是MSDN版本,则不需要进行本步骤操作。一路使用你ISO镜像内的 \sources\install.wim 继续即可,不过要注意 dism 的 /index:N 参数。) 首先挂载ISO文件,找到 \sources\install.esd 文件,确定需要安装的系统版本的 Index (也可以在用ISO启动进入安装程序的系统版本选择步骤时看到,注意是从1开始数的): PowerShell 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 PS C:\> dism /get-wiminfo /wimfile:J:\sources\install.esd Deployment Image Servicing and Management toolVersion: 10.0.16299.15 Details for image : j:\sources\install.esd Index : 1Name : Windows 10 SDescription : Windows 10 SSize : 15,748,508,043 bytes Index : 2Name : Windows 10 S NDescription : Windows 10 S NSize : 14,682,635,068 bytes Index : 3Name : Windows 10 HomeDescription : Windows 10 HomeSize : 15,567,580,753 bytes Index : 4Name : Windows 10 Home NDescription : Windows 10 Home NSize : 14,496,690,559 bytes Index : 5Name : Windows 10 Home Single LanguageDescription : Windows 10 Home Single LanguageSize : 15,569,063,438 bytes Index : 6Name : Windows 10 EducationDescription : Windows 10 EducationSize : 15,746,024,004 bytes Index : 7Name : Windows 10 Education NDescription : Windows 10 Education NSize : 14,680,122,009 bytes Index : 8Name : Windows 10 ProDescription : Windows 10 ProSize : 15,746,775,851 bytes Index : 9Name : Windows 10 Pro NDescription : Windows 10 Pro NSize : 14,680,828,085 bytes The operation completed successfully.然后把特定 Index 的系统文件单独提取到一个 wim 镜像中: PowerShell 12345678 PS C:\> dism /export-image /sourceimagefile:j:\sources\install.esd /sourceindex:8 /destinationimagefile:D:\install.wim /compress:max /checkintegrity Deployment Image Servicing and Management toolVersion: 10.0.16299.15 Exporting image[==========================100.0%==========================]The operation completed successfully. 格式化硬盘启动一个管理员权限的命令提示符或PowerShell,打开DiskPart程序,选中目标硬盘: PowerShell 1234567891011121314151617181920 PS C:\> diskpart Microsoft DiskPart version 10.0.16299.15 Copyright (C) Microsoft Corporation.On computer: [redacted] DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 3539 GB 0 B * Disk 1 Online 465 GB 0 B * Disk 2 Online 465 GB 0 B * Disk 3 Online 953 GB 0 B * Disk 4 Online 238 GB 0 B * DISKPART> select disk 4 Disk 4 is now the selected disk.分区(以下命令均在DiskPart内部,选中目标硬盘之后执行;请务必检查选中了哪块硬盘,因为以下操作会抹去该硬盘现有的所有数据) 1234567891011121314151617181920 cleanconvert gptcreate partition primary size=512format quick fs=ntfs label="Windows RE tools"set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"assign letter="T"create partition efi size=260format quick fs=fat32 label="System"assign letter="U"create partition msr size=128create partition primary shrink minimum=15000format quick fs=ntfs label="Windows"assign letter="W"create partition primaryformat quick fs=ntfs label="Recovery image"set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"gpt attributes=0x8000000000000001assign letter="X"exit分区结束后,该硬盘将有如下分区表(以我240G的硬盘为例;如果硬盘实际大小不同,Windows系统分区大小将会自动改变,其余分区不变): 序号 类型 大小 偏移 卷标 1 保留 128MB 17KB 2 Windows RE环境 512MB 129MB T 3 EFI启动分区 260MB 641MB U 4 MSR 128MB 901MB 5 Windows系统盘 222GB 1029MB W 6 还原镜像 14GB 223GB X(在磁盘管理中,它看起来像是只有四个分区,这是正常现象。) 安装Windows PowerShell 12345678 PS D:\> dism /apply-image /imagefile=D:\install.wim /index:1 /applydir:W:\ Deployment Image Servicing and Management toolVersion: 10.0.16299.15 Applying image[==========================100.0%==========================]The operation completed successfully. 安装Windows Recovery首先把需要的文件搞出来。 PowerShell 12345678910111213141516171819 PS D:\> mkdir D:\temp_system Directory: D:\ Mode LastWriteTime Length Name---- ------------- ------ ----d----- 2017-10-20 18:15 temp_system PS D:\> dism /mount-wim /wimfile:D:\install.wim /index:1 /mountdir:D:\temp_system /readonly Deployment Image Servicing and Management toolVersion: 10.0.16299.15 Mounting image[==========================100.0%==========================]The operation completed successfully.复制恢复分区镜像和系统安装镜像。 PowerShell 123456789101112131415161718192021222324 PS D:\> mkdir T:\Recovery\WindowsRE Directory: T:\Recovery Mode LastWriteTime Length Name---- ------------- ------ ----d----- 2017-10-20 18:13 WindowsRE PS D:\> copy D:\temp_system\Windows\System32\Recovery\Winre.wim T:\Recovery\WindowsRE\Winre.wimPS C:\> mkdir X:\Recovery Directory: X:\ Mode LastWriteTime Length Name---- ------------- ------ ----d----- 2017-10-20 23:38 Recovery PS D:\> copy D:\install.wim X:\Recovery\install.wim 创建EFI引导 PowerShell 12345678910 PS C:\> bcdboot W:\Windows /s U: /f UEFIBoot files successfully created. PS C:\> reagentc /setosimage /path X:\Recovery /target W:\Windows /index 1Directory set to: \\?\GLOBALROOT\device\harddisk4\partition6\Recovery REAGENTC.EXE: Operation Successful. PS C:\> reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\WindowsREAGENTC.EXE: Windows RE is already enabled. 清理工作在弹出移动硬盘之前,请务必移除分配给各系统分区的盘符,否则这个盘符会因为Windows的一些bug永远无法被移除,始终在资源管理器中显示一个空占位符。 PowerShell 1234 PS C:\> mountvol T: /DPS C:\> mountvol U: /DPS C:\> mountvol W: /DPS C:\> mountvol X: /D卸载刚刚挂载的WIM。 PowerShell 123456789101112 PS D:\> dism /unmount-wim /mountdir:D:\temp_system /discard Deployment Image Servicing and Management toolVersion: 10.0.16299.15 Image File : D:\install.wimImage Index : 1Unmounting image[==========================100.0%==========================]The operation completed successfully. PS D:\> rm D:\temp_system给目标设备准备驱动程序。如果你和我一样准备把这个Windows用在Mac上,那么需要事先使用macOS的Boot Camp助理下载对应的驱动程序。这个过程需要一个空白的,格式化成MBR分区/FAT32的U盘。下载完后可以将文件直接复制到Windows系统分区中,就不需要再插U盘安装了。 接下来,把硬盘弹出,插到目标电脑上,选择该硬盘EFI启动,就会看到熟悉的Windows 10 OOBE向导了。 参考: Download Windows 10 Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart How to Install Windows 10 on External Hard Drive How to Extract Install.ESD to Install.WIM (Windows 10/8) Restore Windows RE in Windows 7, 8, 8.1 and 10 Samples: Applying Windows, System, and Recovery Partitions by using a Deployment Script |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |