From owner-freebsd-stable Wed Sep 26 19: 3:24 2001 Delivered-To: freebsd-stable@freebsd.org Received: from hollowman.mweb.co.za (hollowman.mweb.co.za [196.2.46.15]) by hub.freebsd.org (Postfix) with ESMTP id 30D3737B405 for ; Wed, 26 Sep 2001 19:03:09 -0700 (PDT) Received: from siberiyan.dyndns.org ([196.30.182.165]) by hollowman.mweb.co.za (iPlanet Messaging Server 5.1 (built May 7 2001)) with SMTP id <0GKA00K5HTP3AH@hollowman.mweb.co.za> for freebsd-stable@freebsd.org; Thu, 27 Sep 2001 04:03:05 +0200 (SAST) Received: by siberiyan.dyndns.org (sSMTP sendmail emulation); Thu, 27 Sep 2001 04:03:33 +0200 Date: Thu, 27 Sep 2001 04:03:33 +0200 From: Piet Delport Subject: "fixlabel: invalid magic" while dd'ing to /dev/ad4s1 To: freebsd-stable@freebsd.org Mail-Followup-To: freebsd-stable@freebsd.org Message-id: <20010927040332.C96979@athalon.homenet> MIME-version: 1.0 Content-type: multipart/signed; boundary=liOOAslEiF7prFVr; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-disposition: inline User-Agent: Mutt/1.3.22.1i X-Operating-System: FreeBSD 4.4-STABLE X-Editor: VIM - Vi IMproved 6.0ax BETA (http://www.vim.org/) X-Crypto: gpg (GnuPG) 1.0.6 (http://www.gnupg.org/) X-GPG-Key-ID: 0x6B191427 X-GPG-Fingerprint: C7FF A540 2199 F7BF 1933 5640 CD15 0FF3 6B19 1427 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi stable people, Some verbose background (hurried folks can skip to "end background"): A while back, while i was installing FreeBSD onto a free slice on this box, i accidentally overwrote the start of my first slice (which contains a Winders 98 installation) with the FreeBSD boot loader, instead of installing it in the MBR. The result is that said Win98 slice is now unbootable (FreeBSD gets booted instead when i try) and unmountable (both from FreeBSD and a DOS boot floppy). Not too big a deal, as my most important data is elsewhere, and the Windows installation is expendable, but there's still one or two non-backed-up files on the Win98 slice that i'd like to recover. Which is what i set out to do, in the name of Knowledge, Prosperity, and Copious Free Time. Initial investigation revealed that only the first 8K of /dev/ad4s1 (the Windows boot slice) differed from a normal FAT32 filesystem header, a convenient example of which exists in the form of /dev/ad4s5, my other FAT32 slice. So, by restoring the first 8K of ad4s1 from ad4s5, i am hoping to make ad4s1 usable again, at least enough so that i can recover my files. [end background] I tried the following: # dd if=3D/dev/ad4s5 of=3D/dev/ad4s1 bs=3D512 count=3D16 but dd replied with: | dd: /dev/ad4s1: Read-only file system | 2+0 records in | 1+0 records out | 512 bytes transferred in 0.022429 secs (22828 bytes/sec) Note that the first 512 bytes were indeed written to ad4s1, but nothing more was. Additionally, the kernel reported: | dscheck(#ad/0x20022): fixlabel: invalid magic | fixlabel: invalid magic For what it's worth, 0x20022 seems to be the minor device number of /dev/ad4s1: $ ls -l /dev | grep 20022 crw-r----- 2 root operator 116, 0x00020022 Sep 27 01:47 ad4s1 crw-r----- 2 root operator 116, 0x00020022 Sep 27 01:47 rad4s1 $ Searching various manpages didn't shed any light on the error messages, so i grepped the FreeBSD source tree for "fixlabel: invalid magic" and found (the only) match in sys/kern/subr_diskslice.c: | /* These errors "can't happen" so don't bother reporting details. */ | if (lp->d_magic !=3D DISKMAGIC || lp->d_magic2 !=3D DISKMAGIC) | return ("fixlabel: invalid magic"); | if (dkcksum(lp) !=3D 0) | return ("fixlabel: invalid checksum"); Unfortunately, my non-existent kernel-fu precluded me from gleaning anything meaningful from the code, other than that this probably shouldn't happen. I should also mention that i tried: # disklabel -W ad4s1 after reading about it in disklabel(8), but i still got the same error message. I also tried dd'ing to/from /dev/rad4s? instead of /dev/ad4s?, with no success. Am i doing something wrong here, is this a bug, or what? Thanks in advance for any replies, --=20 Piet Delport Today's subliminal thought is: --liOOAslEiF7prFVr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) iD8DBQE7soj0zRUP82sZFCcRAhuWAJ9glNo8v95D4dYGoh9AMc34dB4dZgCdFNe4 0liUS5RV4TrcT8UX2gN5m1M= =RxVP -----END PGP SIGNATURE----- --liOOAslEiF7prFVr-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message