From owner-freebsd-fs Thu Sep 17 09:40:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA08775 for freebsd-fs-outgoing; Thu, 17 Sep 1998 09:40:23 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA08708 for ; Thu, 17 Sep 1998 09:40:01 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id CAA20799; Fri, 18 Sep 1998 02:39:38 +1000 Date: Fri, 18 Sep 1998 02:39:38 +1000 From: Bruce Evans Message-Id: <199809171639.CAA20799@godzilla.zeta.org.au> To: freebsd-fs@FreeBSD.ORG, mystify@friley-186-113.res.iastate.edu Subject: Re: Alleged "read-only" partition preventing ccd Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Unfortunately, when I try to dd the existing partition to the mirroring >location (raw device to raw device) in single-user mode, dd(1) only writes >512 bytes and then claims that the destination partition is read-only. This is because the disk label at offset 512 is write protected. >However, I can write a new file system to that partition, mount it, create >files, etc. I can even dd the character devices, but it takes about half an >hour and then the CCD won't mount. If it would help, I can do that to get >the exact error message, but I do not have time right now. Correct error handling is not possible for writes to block devices. The i/o gets reblocked to a too-small block size of 2K (that's why block devices are so slow). Write errors are essentially ignored. There is a write error for the first 2K block and none of this block is copied. This probably breaks mounting later. Block devices should only be used for mounting unless you know about problems like this and either want them or don't care. >Is there something that can be done to remove the read-only restriction on >this partition? And for that matter, how did it get there in the first >place? The DIOCWLABEL ioctl controls the write protection flag. dd'ing to an unlabeled disk should work. There is no easy way to clear a label. I usually use a binary editor on the whole disk device. This exploits brokenness of label write protection on the whole disk device. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message