标签:#OS

Posts

· 2018-10-12 · * OS *

From https://unix.stackexchange.com/questions/275772/what-is-the-proper-way-to-create-a-bootable-image-of-my-system

The machine doesn't even always need to be the same, since Linux creates the /dev, /proc and /sys filesystems on the fly as the kernel boots which gives you a lot of freedom to make some pretty drastic hardware changes.

Let's say your OS is installed on disk /dev/sda. You can make an ISO of /dev/sda and all of its partitions, whatever they may be, with the following command:

dd if=/dev/sda of=/path/to/image.iso

The downside to this is that the image will be the full size of the disk you specified as if (input file), even if that disk is not full.

If you'd like to clone the disk directly from /dev/sda, simply insert another disk and use something like:

dd if=/dev/sda of=/dev/sdb