From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076340321574.tru64-unix-managers.marc@archive.invalid> From: Jay Sekora Date: Tue, 15 Oct 1996 15:50:33 +0000 To: tru64-unix-managers Subject: [SUMMARY] using dd to copy disks X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076340321574 Hi. My original question was how to use dd to copy the boot disk on an DEC 3000/300 to a second disk mounted internally. (I hadn't been successful in just booting single-user and dd'ing partitions.) First off, I wasn't able to do it the way I'd been trying to because the system doesn't let you overwrite the disklabel blocks by default. (Somebody told me that "disklabel -W /dev/rrzXa" should work, and it looked like it ought to from the man page, but it didn't seem to. "disklabel -z /dev/rrzXc" did the trick though. It may be that the problem was that I was using partition a rather than c.) Secondly, I'd been partitioning the new disk and trying to copy each partition individually. That works, but all I really had to do was copy partition c (the entire disk). The thing I was confused about is that the partition information is actually stored _within_ a partition near the beginning of the disk. So by default, partitions a and c actually _contain_ the partition table. (That's the part you can't overwrite without special effort, and that's why I wasn't able to just dd partition a without using the disklabel command.) So copying partition c makes an exact copy of the disk, including partition information. So, assuming the old disk that I want to copy is SCSI ID 3, and the new one is SCSI ID 2, the full procedure would be: * boot single-user (e.g. with >>> BOOT -FL S * use disklabel to zero-out the old partition table: # disklabel -z /dev/rrz2c * copy the partition # dd if=/dev/rz3c of=/dev/rz2c bs=512 (Somebody suggested using the raw device instead, with a block size of 8K or a multiple of it, for a speed improvement. I haven't tried that yet.) * check/clean the new partitions with fsck. This is most important for the boot partition; the others will probably already be clean: # fsck -y /dev/rz2a (and repeat as needed/desired for other partitions) Then you can swap the disk into another machine, make sure the PROM settings are correct, and boot from it. (Of course, at that point the two machines think they have the same hostname and IP address.) Several people pointed me at using "vdump/vrestore" instead of "dd" to save time since dd copies all blocks, whether allocated or not. I didn't have "vdump" and "vrestore" on the disk (are they only installed if you're using AdvFS?), but I tried using "dump" and "restore" unsuccessfully before finding the right "disklabel" command; my guess is that it would have worked, but then it would have required me to do each partition individually. A couple of people also suggested booting from the installation CD ROM and mounting the two disks; that would have been fine, but would have been more time consuming and would have only allowed me to do one machine at a time. Many thanks to: alan@nabeth.cxo.dec.com John Kohl Gyula Szokoly Larry Church Tim Llewellyn Richard Tame And especially the nice folks who wrote the OSF/1 (old manual :-) Systems Administration manual, which is where I found the "disklabel -z" command. Sincerely, Jay Sekora