製作linux系統的“副本” (Make a "copy" of linux system)


問題描述

製作linux系統的“副本” (Make a "copy" of linux system)

假設我有一個硬盤,上面有一些 linux 發行版。我的任務是在另一個硬盤驅動器上設置類似的系統(具有類似的發行版、內核版本、軟件版本等)。如果:

案例a:我可以使用任何我想要的軟件(包括Virtualbox之類的軟件來製作系統的完整映像)

案例b:除了標準的 linux 實用程序,我不能使用任何東西來檢索我需要的所有特性,然後手動在其他硬盤上安裝“新”系統。

感謝閱讀。我很難表達我的意思,希望你能理解。


參考解法

方法 1:

One word: CloneZilla

It can clone the partitions, disks, copies the boot record. You can boot it up from CD or USB drive or even via network (PXE).

You could go with dd but it's slow because it copies everything, even the empty space on disk, and if your partitions are not the same size you can have various problems, so I do not recommend dd.

You could also boot the system from some live CD like Knoppix, mount the partitios and copy everything using cp ‑a. And run something like watch df in a second terminal to monitor the progress. But even then you need to mess with the bootloader after copy is done.

I used to use various manual ways to clone Linux systems in the past, until I discovered CloneZilla. Life is much easier since then.

方法 2:

Easiest way is to use dd from the command prompt.

dd if=/dev/sda of=/dev/sdb ‑‑bsize=8096

dd (the disk duplicator) is used for exactly this purpose. I would check the man page to ensure my blocksize argument is correct though. The other two arguments are if (in file) and of (out file). The of= hard drive should be the same size or larger than the if= hard drive.

方法 3:

You can create an exact copy of the system on the first disk with dd or cpio and a live cd.

(by ScorpilMilan BabuškovJim Nanneyantik)

參考文件

  1. Make a "copy" of linux system (CC BY‑SA 3.0/4.0)

#virtualization #linux #bash






相關問題

需要一個好的 Internet Explorer 6、7、8 獨立版 (Need a good Internet Explorer 6, 7, 8 standalone)

英特爾虛擬化問題 (Android Studio) (Intel Virtualization Problems (Android Studio))

VirtualMachine 的第一條指令是如何獲取的(在 KVM-QEMU 中) (How is the first instruction of VirtualMachine is fetched (in KVM-QEMU))

如何使用 SharePoint、K2 和域控制器複製虛擬 PC (How to duplicate a virtual PC with SharePoint, K2 and domain controller)

WPF數據虛擬化ListView (WPF Data virtualizing ListView)

製作linux系統的“副本” (Make a "copy" of linux system)

在虛擬機中模擬 Windows 筆記本電腦? (Simulating windows laptop in virtual machine?)

為“假 Mac OS X”虛擬化構建 Windows XP 或 7 (Skeletoning Windows XP or 7 for "fake Mac OS X" virtualization)

在虛擬機中開發 Java 有什麼好處嗎? (Are there any benefits to developing Java in a virtual machine?)

Xen ABI 是真正的 ABI 嗎? (is the Xen ABI a true ABI?)

在使用 qemu kvm 安裝 VM 之前更改 VM 的磁盤大小 (Changing Disk Size of VM before VM installation using qemu kvm)

Qemu 在 Windows 上運行時無法加載 bios-256k.bin (Qemu can't load bios-256k.bin when running on Windows)







留言討論