对 Windows 分区进行映像的最有效的本地方式是什么?
- 为什么原生方法通常是大多数用户的最佳方法?
- 本机方法与传统克隆有何不同?
- 原生工具与第三方工具的优缺点是什么?
如何在新驱动器上配置系统分区以应用映像?
- 由于@harrymc 的一个事实上不准确的答案仍在获得支持,这在很大程度上是由于他的网站资历,请参阅这个答案,该答案检查了他的每一个说法。
- 接受,事实准确,回答
- 注解:
- 许多人对“图像”命名法提出了质疑,其中“图像” [per Microsoft] 是正确的术语
- 更改开发人员的命名法不是由个人决定的,如果我要任意和单独更改命名法,在引用 Microsoft Docs [Windows 手册页] 时只会造成更多混乱
- 虽然我不能明确指出任何特定的 Windows 白皮书,但 Windows 的“图像”命名法可能来自从服务的角度来看 Windows 是如何被称为“图像”的,这就是为什么
DISM
有/Online
和/Image
参数:- 在线图像服务处理一段
%SystemDrive%
时间启动到它 - 脱机映像服务处理非引导到
%SystemDrive%
- 图像管理处理这个问题的主题
- 在线图像服务处理一段
- 许多人对“图像”命名法提出了质疑,其中“图像” [per Microsoft] 是正确的术语
对于大多数用户而言,通过(Win XP ≤ 7: )捕获 Windows 分区的图像通常是最好和最有效的方法,同时也不会导致第三方工具太常见的配置问题。
DISM
ImageX
/Compress:Recovery
(算法效率比 33% 左右/Compress:Max
)8.1:只能将可引导的 Windows 安装捕获为 ESD
DISM
包含在其中(Win XP ≤ 7:ImageX
):SHIFTF10
的额外WinPE 可选组件)
注解:
DISM
有/Online
和/Image
参数:%SystemDrive%
时间启动到它%SystemDrive%
成像:
(Powershell cmdlet 映射)
通过创建
WimScript.ini
配置文件来指定排除或例外,/ScratchDir
在 WinPE 中是必需的,因为它默认只有 32MB 的暂存 [temp] 空间:/Compress:Max
改为/Compress:Fast
.swm
文件/Split-Image
/Delete-Image
或导出到自己的图像通过/Export-Image
访问 WIM 或 ESD 中的数据:
只读:
/ReadOnly
).wim
/.esd
/discard
对图像 [index] 进行更改或添加数据:
/Commit
)DISM
, 将更改保存为新的附加图像,请添加/Append
/CheckIntegrity
(ImageX
:)/Check
/Verify
并且始终使用.wim
/.esd
并不是所有成像 [克隆] 用例的最佳解决方案,但适用于大多数情况:.wim
/.esd
需要一个存储介质来容纳捕获的映像(未映像的分区、USB 驱动器、网络共享等),服务于作为实际备份基础映像的双重目的.wim
;.esd
新添加的图像利用先前图像中已包含的未更改文件的相同副本(哈希验证),允许图像相对于附加图像示例中的数据保持较小:(
注意
Base.wim
与每个图像相比的大小包含索引和其中所有数据的总和):绝大多数 Windows 用户不需要分区级或磁盘级映像:
DISM
/ImageX
creates a filesystem image, not a partition partition-level or disk-level image:(Win ≥ XP uses NTFS as the default filesystem)
C:\
],DISM
/ImageX
captures an image of all data on that partition, but not the structure of the partition/drive itself (offset, alignment, block size, etc.), bypassing the inconvenience a conventional partition/drive image creates, as only filesystem data is contained within a.wim
/.esd
, allowing it to be applied to any partition, regardless of size difference or whether there is existing data on the partition.Third-party tools will almost always fall into one of two categories, Linux-based or Windows-based via
DISM
/ImageX
/Powershell
, with many resulting in configuration issues, and the latter sometimes encompassing developers who use proprietary image file formats and custom boot environments (many of which are Linux-based).DISM
(Win XP ≤ 7:ImageX
), however thousands of questions, answers, and comments exist for issues arising from third-party imaging tools:Windows cloning problem (3,838 results)
DISM
:Dism /Capture-Image
issue (60 results)Windows
Dism /Capture-Image
problem (44 results)Dism /Append-Image
issue (20 results)Windows
Dism /Append-Image
problem (12 results)Dism /Apply-Image
issue (85 results)Windows
Dism /Apply-Image
problem (93 results)ImageX
:ImageX /Capture
issue (19 results)Windows
ImageX /Capture
problem (20 results)ImageX /Append
issue (10 results)Windows
ImageX /Append
problem (5 results)ImageX /Apply
issue (15 results)Windows
ImageX /Apply
problem (12 results)Ever come across advice telling a BSD or Linux user to boot to Windows or use Wine to back up their data? For example,
ntfsclone
(part ofntfs-3g
) is a popular Linux utility, with the following from it's man page:WIMs/ESDs don't have these issues since they only contain filesystem information (files and directories), not partition/drive level data, allowing them to be applied to any partition, regardless of size difference or whether there is existing data.
Native Pros:
/CheckIntegrity
(ImageX
:/Check
) &/Verify
are always usedNative Cons:
/Compress:Max
or/Compress:Recovery
, it's more efficient to use/Compress:Fast
, exporting the image later usingMax
orRecovery
/CheckIntegrity
(ImageX
:/Check
) andVerify
do extend the image processing time, they should always be usedDiskPart
: (select the OS drive the image is being applied to)Assumes no data on drive is being preserved, as
clean
wipes the drive's partition table UEFI:WinRE.wim
is ~300MB in size)C:
can't be assigned: change 4 & 5 to another letter)BIOS: UEFI:
If storing User Data directories on a partition other than
C:\
(recommended), max size required is ~300GB (multiply size wanted by 1024:200*1024=204800
)BIOS: UEFI:
BIOS: UEFI:
UEFI:
What is the most efficient, native way to image a Windows partition?
There isn't one any more since Windows Backup is being phased out (probably because this was a bad product to start with).
Only DISM is left, but it only does file backup, not partition image backup. Its new Full Flash Update (FFU) images takes a sector-by-sector image of the entire disk, which unfortunately also includes unused sectors, so not at all efficient.
Why is the native method generally the best method for most users?
It isn't for Windows, as above. Microsoft has left the field in favor of third-party products.
How does the native method differ from conventional cloning?
DISM does not do cloning at all.
What are the pros and cons of native versus third-party tools?
The pros of third-party tools is that they work well and efficiently. Most are also free to use.
Example products are AOMEI Backupper, Clonezilla, Macrium Reflect, EaseUS ToDo BackUp. YMMV.
Historical note: DISM was conceived by Microsoft decades ago in an ancient version of Windows (Vista), using the Windows Imaging Format (WIM), which is a file-based disk image format, used mostly for software distribution. For backup, Microsoft has created Windows Backup, of which a limited version is still available in Windows 10 as "Back up and Restore (Windows 7)", but without its problematic image backup feature. The use of DISM as a backup utility is very strongly not recommended.
Windows Backup and Restore is nothing more than a different, albeit inefficient, way than
ImageX
/DISM
to image a partition in Windows:(storage inefficient - VHD is created and data copied to it)
(data within VHDs are subject to corruption, unlike data in WIMs/ESDs)
(
ImageX
/DISM
would need to be used)RoboCopy
to copy all data, maintaining ACLs, to the VHD from the source partition; if a user then chooses to perform differential backups, it operates in a similar fashion as the smart compression feature of WIMs/ESDs through hash verification [/Append-Image
], and while similar in this specific aspect, Backup and Restore uses little, if any, compression, making it storage inefficient and reliant upon external fileswbadmin
and VSS,robocopy
, or Powershell since ACLs must be maintained)Windows Backup and Restore relies upon a whole host of external files residing outside of the VHD to work correctly [below], in contrast to a self-contained WIM/ESD image that relies upon no external files
Note VHD size (8.46GB) versus WIM (2.83GB) / ESD (1.93GB) images of the same OS
The
DISM
man page on Microsoft Docs must just be nonsensical gibberish then...DISM
/ImageX
CAN do file/directory backups, however it's MAIN USE is to image Windows partitions; the-image
portion of theDISM
commands does imply this after all:DISM
/ImageX
is used daily by all laptop and PC OEMs via either MDT (Microsoft Deployment Toolkit) or SCCM (Service Center Configuration Manager).It's likely most folks have heard of neither, but each is for the deployment of Windows via master WIMs/ESDs to anywhere from tens to thousands of machines and is why businesses pay thousands of dollars for SCCM licenses
WinPE.wim
is booted, the install of the OS, drivers, and third-party applications is completely automated through the seven Windows install phasesMDT or SCCM Task Sequence example:
WIMs/ESDs have been the only way to natively image Windows since Windows XP, via
ImageX
in Windows XP, Vista, & 7, andDISM
in Windows 8, 8.1, & 10.ImageX
cannot be used to image in Windows ≥8 andDISM
cannot be used to image in Windows ≤7, as Microsoft changedDISM
in Windows 8, adding in the imaging featuresImageX
was previously used for(Attempting to use either to capture an image in the other will result in an error)
\\<winre-partition>\Recovery\WindowsRE\WinRE.wim
\\<install-media>\sources\boot.wim
DISM
/ImageX
from:\\<install-media>\sources\(install.esd
||install.wim)
FFUs are only intended for OEMs and businesses deploying the same partition images to tens to thousands of machines, simplifying MDT and SCCM deployments, not users looking to image their Windows partition(s):
"Deploy Windows faster on the factory floor by using the Full Flash Update (FFU) image format. "
If, as the author states:
The
DISM
man page on Microsoft Docs must just be nonsensical gibberish then for some unknown BSD or Linux distro...It appears Microsoft, OEMs, businesses, universities, governmental institutions, and everyday users never received that message... As listed above, combined with the fact Microsoft regularly updates
DISM
:install.wim
/install.esd
WinRE.wim
install.wim
/install.esd
(Windows Update as of ~v1809 uses the Component Store [
%WinDir%\WinSxS
])The
DISM
man page on Microsoft Docs must just be nonsensical gibberish then...Perhaps this has been the author's personal experience, however a simple search on StackExchange demonstrates this perspective isn't based in reality:
Windows cloning problem (3,838 results)
DISM
:Dism /Capture-Image
issue (60 results)Windows
Dism /Capture-Image
problem (44 results)Dism /Append-Image
issue (20 results)Windows
Dism /Append-Image
problem (12 results)Dism /Apply-Image
issue (85 results)Windows
Dism /Apply-Image
problem (93 results)ImageX
:ImageX /Capture
issue (19 results)Windows
ImageX /Capture
problem (20 results)ImageX /Append
issue (10 results)Windows
ImageX /Append
problem (5 results)ImageX /Apply
issue (15 results)Windows
ImageX /Apply
problem (12 results)All of which are non-native solutions, making them inefficient since they're not able to be natively used in WinPE/WinRE, many of which introduce configuration issues:
/CheckIntegrity
(ImageX
:/Check
) and/Verify
It appears few, if any, actual historical sources were referenced:
DISM
in Vista is not the same asDISM
in Windows 8, 8.1, or any version of 10 (see 2nd quote above)Max
andRecovery
, have a manner within the image itself for data parity, and only use tools natively contained within aWinPE.wim
(I'm not aware of any, perhaps others are?)
Perhaps by the author, but certainly not by Microsoft and others...
If
DISM
was as problematic and not recommended as the author contends, Microsoft wouldn't continue to have it be the backbone of Windows, from imaging to image servicing [Component Store], and it certainly wouldn't be the backbone of MDT and SCCM.Please don't take my word for any of this, fact check it via the linked material throughout and source links below:
Sources: