Q: how to dd my root filesystem (mounted read-only)

From: Jay Sekora <jay_at_ccs.neu.edu>
Date: Fri, 11 Oct 1996 12:34:10 -0400

OK, following my failure to find a way to boot via FDDI (so I could use
RIS), I'm trying to simply copy entire filesystems from one disk to
another. I physically install the new disk in the case with the old
disk (making sure they have different SCSI IDs, of course), partition
the new disk to match the old disk exactly, boot single-user with /
mounted read-only, and use dd.

My theory was I'd copy each partition, and then I could reboot another
machine with the new disk, change it's name and IP address, and I'd
be all set.

I made sure / was read-only because obviously there would be problems
if the partition was changing while it was being copied; I thought that
would successfully allow me to copy the root partition. However, it
didn't work, running
    dd if=/dev/rz3a of=/dev/rz2a
(where the old, already installed disk is rz3 and the new empty one
is rz2), gave the error
    /dev/rz3a: Device busy
Well, I _know_ it's busy; it's mounted, but it's mounted read-only
("mount" tells me so), so I wouldn't expect this to be a problem.

Just for grins, I tried using the raw devices rather than the block
devices, but "dd if=/dev/rrz3a of=/dev/rrz2a" gave "dd write error:
Read-only file system". Since neither of the devices I specified
should be considered as any kind of file system, my best guess is that
when dd copies between non-block devices, it needs to write a temp file
or someting.

So my first question is, is there a way I can get around this, while
still booting from the disk I'm trying to copy from? (I could boot
from CD-ROM, but that would defeat much of the purpose, which is trying
to speed up large numbers of installs.) Is there a way I can get dd to
successfully read from /dev/rz3a while rz3a is mounted (read-only)? Or
is there another way I can copy the filesystem in such a way that it'll
actually boot? (I could use dump and restore, but I'm guessing that
since the monitor needs to boot from the partition, that absolute block
numbers are important.)

My other question is, if I succeed in this will it actually work? Is
an exact copy of the contents of all the OS-visible partitions enough
to make a bootable disk, or is there some additional magic that needs
to happen to the disk outside those partitions? And is there a device
name I can use that refers to the _entire_ disk, including the
partition table and all partitions, so I could do one dd (or whatever)
for the entire disk rather than one for each partition?

Thanks, summary will follow.

Sincerely,

Jay Sekora
<jay_at_ccs.neu.edu>
Received on Fri Oct 11 1996 - 19:46:42 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:47 NZDT