开发者

Make a "copy" of linux system [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 12 years ago.

Improve this question

Let's assume I have a hard drive with some linux distribution on it. My task is to set up similar system (with similar distro, kernel version, software versions etc.) on the other hard drive. How can i do that if:

Case a: I'm allowed to use any software i want (include software like Virtualbox to make full image of the system)

Case b: I'm not allowed to use anything but standard linux utilities to retrieve all characteristics i need, and then install "fresh" system on other hard drive manually.

Thanks for reading. It's very hard to me to express what i mean, i ho开发者_Go百科pe you understood it.


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜