From owner-freebsd-bugs Sat Feb 26 2:30: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id BD12937BF7F for ; Sat, 26 Feb 2000 02:30:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA78984; Sat, 26 Feb 2000 02:30:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Sat, 26 Feb 2000 02:30:02 -0800 (PST) Message-Id: <200002261030.CAA78984@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: kern/17003: dscheck() overzealously protects labels on non-BSD partitions Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/17003; it has been noted by GNATS. From: Bruce Evans To: eps@sirius.com Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/17003: dscheck() overzealously protects labels on non-BSD partitions Date: Sat, 26 Feb 2000 21:24:01 +1100 (EST) On Sat, 26 Feb 2000 eps@sirius.com wrote: > On a drive using DOS partitioning, dscheck() prevents overwriting the > first 1K of a partition that formerly held a UFS filesystem, even if It actually prevents overwriting the second sector. This prevents overwriting the first nK if the write is for nK at offset 0 and the sector size is < nK. > the partition type is changed to something other than DOSPTYP_386BSD. This is a feature. All types of partitions can have BSD labels. This part of the feature is intentional. If you don't want your otherOS partitions labeled, then don't put a label on them, and don't forget to remove unwanted labels if you change partition types. Also, be careful when moving partitions. An old label will wake up if there is a valid one in the second sector of a new partition. Labels can be difficult to remove, because of bugs in the label write (un)protection ioctl. The only reliable method that I know of is: 1) Open the whole disk device for the drive, and write suitable garbage (normally 0's) over the label sector. If you use dd, then you will need an up to date dd that supports seeking to offsets >= 2GB if the label sector offset is >= 2GB. 2) Make sure that all subdevices on the drive are closed. An in-core copy of the old label will be used until the next open after they are all closed. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message