[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Installing five identical systems...



> 
> cp isn't always a good way to do it, especially from a currently mounted
> filesystem. The best I've found is:
> 
> Create your system, setup how you want all of them to look
> Put that disk into a machine, along with your blank, and boot from a
> third. 
> 
> So the machine has 3 disks, the original, the blank, and the disk you're
> running from.
> 
> then you can do a dd, example
> 
> dd if=/dev/sda of=/dev/sdb
> 
> now this will work perfectly if the disks are the same size, if they are
> different sizes then things get a little tricky! You can also do this to a
> file, then dd the file out to disks again. The other things with the file
> is that you can mount it via the loop driver and delete things like /proc
> that you don't want copied!
> 
> It's not good just to copy or dd from the disk the system is running on,
> remember that as you copy, files are going to change on the disk (logs
> etc....) not good! 

This is the correct way to duplicate disks.  Using cp or other
file-system-level tools requires you to:

   first partition the target disk exactly like the source disk

   then create filesystems on each partition

   then initialize the swap partitions

   then mount each partition

   then copy the contents of each partition

dd just makes an exact block-wise copy of the source onto the target in a
single step.  Do not do this with live filesystems on the source disk.
Using fsk to check the validity of the target isn't a reliable check
because the copy is done below the filesystem level.

If you create a minimal system which allows you to boot from a diskette
and connect to a network, you can perform this type of disk duplication
over your LAN (dd if=/dev/sda | rsh somehost 'dd of=/dev/sda').

 - C




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []