From owner-freebsd-hackers Sat Dec 23 23:55:39 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id XAA11457 for hackers-outgoing; Sat, 23 Dec 1995 23:55:39 -0800 (PST) Received: from cls.net (freeside.cls.de [192.129.50.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id XAA11451 for ; Sat, 23 Dec 1995 23:55:33 -0800 (PST) Received: by mail.cls.net (Smail3.1.29.1) from allegro.lemis.de (192.109.197.134) with smtp id ; Sun, 24 Dec 95 07:55 GMT From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Reply-To: grog@lemis.de (Greg Lehey) Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id IAA13974; Sun, 24 Dec 1995 08:52:21 +0100 Message-Id: <199512240752.IAA13974@allegro.lemis.de> Subject: Re: disk to disk copy To: bde@zeta.org.au (Bruce Evans) Date: Sun, 24 Dec 1995 08:52:21 +0100 (MET) Cc: hackers@freebsd.org (FreeBSD Hackers) In-Reply-To: <199512231309.AAA23907@godzilla.zeta.org.au> from "Bruce Evans" at Dec 24, 95 00:09:49 am X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-hackers@freebsd.org Precedence: bulk Bruce Evans writes: > >>> is it to do a disk to disk copy including the partition table and label > >> It depends on the device node you're using. You can copy all, includ- >> ing even the master boot record (which _can_ be the start of the BSD >> disklabel as well, but isn't for most disks). > > Actually, overwriting valid MBR's, SecondaryBR's (inside extended > partitions and disk labels should fail. It succeeds in some cases > because of bugs: > - write protection isn't implemented for MBR's and SBR's > - write protection of labels is implemented but can be defeated by > copying to the whole disk device (e.g. /dev/rsd0 instead of > /dev/rsd0c, even when these devices contain the same sectors). > > The MBR can never be the start of a FreeBSD disk label, since FreeBSD > labels are always in sector LABELSECTOR = 1. BSD labels for other > BSD's may start be in sector 0. FreeBSD would not be able to find > these. That's a matter of definition. If you're talking to a character device, anything should be allowed. I have a number of disk drives which I use for various systems at various times. To change systems, I copy the whole disk to tape and then a tape copy to disk. Under FreeBSD, this always fails if there is no valid BSD label on the disk. BSD/OS doesn't have this problem, so I do it with BSD/OS. Presumably the problem is that the disk driver relies on the disk label to know the size of the disk, although it could get the geometry from the BIOS, or, better, the disk itself. I think there's a basic philosophical flaw in trying to interpret the contents of a character device. Greg