From owner-freebsd-hackers Sun Feb 23 21:48:18 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA29542 for hackers-outgoing; Sun, 23 Feb 1997 21:48:18 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA29537 for ; Sun, 23 Feb 1997 21:48:14 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id QAA24231; Mon, 24 Feb 1997 16:44:44 +1100 Date: Mon, 24 Feb 1997 16:44:44 +1100 From: Bruce Evans Message-Id: <199702240544.QAA24231@godzilla.zeta.org.au> To: hackers@FreeBSD.ORG, rhh@ct.picker.com Subject: Re: dd of=/dev/rwd1s2 -- How? Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > # dd if=img of=/dev/rwd1s2 > >gives me: > > dd: /dev/rwd1s2: Read-only file system > 2+0 records in > 1+0 records out > 512 bytes transferred in 0.063062 secs (8119 bytes/sec) > > >How do I write a saved slice image directly on top of a slice? Is there a >way get a writable raw slice device? Remove the BSD label from the slice. This isn't easy. IIRC, the easiest way is to corrupt the label by writing to it via /dev/rwd1. This exploits a bug in the write protection. It should be possible to use disklabel -N to disable the write protection, but this has been broken for a long time. First, the write protection bit is forgotten when all devices on the disk are closed. Second, there is effectively another layer of write protection that isn't controlled by disklabel -N (writes to the label are trapped and ones that would corrupt the label are rejected. Ones that invalidate the magic number probably should be allowed if the label isn't write protected). Bruce