Short answer: yes, that will work. Longer: showing example from my system.
# dd if=/dev/sda of=sda-blocks bs=1024 count=4 4+0 records in 4+0 records out 4096 bytes (4.1 kB) copied, 0.0101397 seconds, 404 kB/s # ls -l total 4 -rw-r--r-- 1 root root 4096 2006-12-21 08:33 sda-blocks # file sd*sda-blocks: x86 boot sector; partition 1: ID=0xfd, starthead 1, startsector 63, 585922617 sectors, extended partition table (last)\011, code offset 0x48
I copied the first 4K from my boot disk to a file using dd, and then used 'file' to show that it has the: 1. x86 boot sector; 2. partition information, including some data about the extended partition table.
You should probably use the 'bs=' option to 'dd', to speed it up. In cases where I've done this sort of thing, I've used block sizes that are even multiples of the 'native' size. You do need to be sure not to use up all of your available RAM with a size that's too big ;)
I've found that 'bs=10k' seems to work well, though if you have plenty of RAM you might want to try something bigger.
Bob Alejandro wrote:
Hi all, I have a Debian Etch machine with a SCSI HD as a master disk. I want to make a clon to another similar SCSI HD (same model and size), in order to use it if the production disk fails. People talk about "dd" command, telling it's possible to get a exact mirror from one disk to another just running this: dd if=/dev/sda of=/dev/sdb Is this just the solution ??? No matter with the MBR or something else ??? Really thanks, alejandro.-
smime.p7s
Description: S/MIME Cryptographic Signature