[comp.sys.sun] What is the best/safest way to fix a bad ND partition

dupuy@columbia.edu (Alexander Dupuy) (01/21/89)

If the ND filesystems are the same size and are on the same disk, the best
way is to use dd(1) - something like "dd if=/dev/rndl1 of=/dev/rndl2
bs=126b" works well, and quickly - don't worry about the I/O error when it
hits the end of the first ND partition.  Otherwise you should do an rm -rf
or a mkfs on the second ND partition, and then use a dump | restore
pipeline.

@alex

bet@bent.mc.duke.edu (Bennett Todd) (01/24/89)

The definitions for the partitions in /etc/nd.local can specify (in the
last column of the "user" lines) a "local ND" partition number for an ND
partition. Assuming you have assigned such numbers to your nd partitions,
you should be able to fsck the hosed partitions, and if that doesn't work
use one as a source and the other as a destination for a dd(1) command to
copy the partition. For the dd(1) approach I'd make sure I specified a
length (count=NN) for the copy operation; it may be that the nd(4) driver
correctly implements end-of-file -- but I don't know for sure, and would
tend not to trust it (how often would that particular feature be tested?).
Anyway, for a partition specified with "N" in the last column of the
"user" command in /etc/nd.local, that partition can be referred to as
/dev/ndlN (block device, for mounting and suchlike) or as /dev/rndlN (raw
character device, for fsck(8) and dd(1)).

-Bennett