Date: Fri, 20 Feb 2004 22:18:19 +1100 (EST) From: Tim Robbins <tim@robbins.dropbear.id.au> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/63117: fsck_ext2fs does not work on 5.x Message-ID: <20040220111819.B04AF4157@robbins.dropbear.id.au> Resent-Message-ID: <200402201120.i1KBK6Ax094573@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 63117 >Category: ports >Synopsis: fsck_ext2fs does not work on 5.x >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 20 03:20:06 PST 2004 >Closed-Date: >Last-Modified: >Originator: Tim Robbins >Release: FreeBSD 5.2-tjr i386 >Organization: The FreeBSD Project >Environment: System: FreeBSD cat.robbins.dropbear.id.au 5.2-tjr FreeBSD 5.2-tjr #1: Fri Jan 23 02:11:08 EST 2004 tim@cat.robbins.dropbear.id.au:/usr/obj/home/tim/p4/src/sys/CAT i386 >Description: sysutils/fsck_ext2fs does not work on 5.x; it always reports that the superblock's magic number is wrong. >How-To-Repeat: # fsck_ext2fs /dev/ad1s1 ** /dev/ad1s1 BAD SUPER BLOCK: MAGIC NUMBER WRONG ioctl (GCINFO): Inappropriate ioctl for device /dev/ad1s1: can't read disk label Note that the "Inappropriate ioctl for device" error is not directly related to the magic number error; fsck_ext2fs is looking for alternate superblocks. >Fix: BBSIZE (the size of the boot block) was moved into sys/disklabel.h in 5.x. fsck_ext2fs #includes disklabel.h after ext2fs.h, so its local definition in ext2fs.h gets overridden by the incorrect one in disklabel.h. The fix is to #include disklabel.h first, then #undef BBSIZE, then include the ext2fs-specific headers. There is another bug that stops fsck_ext2fs working on 5.x, too: it uses daddr_t on-disk, but daddr_t is 64 bits wide on 5.x instead of the 32 bits wide that this code expects. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040220111819.B04AF4157>