Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 2003 19:03:49 -0500
From:      Jake Burkholder <jake@locore.ca>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        current@FreeBSD.ORG, gordon@FreeBSD.ORG
Subject:   Re: Superblock layout hosed on LP64 systems [was: Re: HEADS UP: VFS changes breaks GPT]
Message-ID:  <20030109190349.E4032@locore.ca>
In-Reply-To: <20030109232943.GA1189@athlon.pn.xcllnt.net>; from marcel@xcllnt.net on Thu, Jan 09, 2003 at 03:29:43PM -0800
References:  <20030109091230.GA4320@dhcp01.pn.xcllnt.net> <20030109232943.GA1189@athlon.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Apparently, On Thu, Jan 09, 2003 at 03:29:43PM -0800,
	Marcel Moolenaar said words to the effect of;

> On Thu, Jan 09, 2003 at 01:12:30AM -0800, Marcel Moolenaar wrote:
> > 
> > GPT based systems are unable to mount the root file system. I
> > haven't had the time to dig into this, but we must be making
> > assumptions we previously didn't make. In any case ia64 is
> > hosed. More to come...
> 
> Ok, after digging a bit I noticed that the super block layout
> has changed in a way that makes it incompatible with previous
> super blocks. It appears to be the alignment of fs_uuid on
> revision 1.36 of sys/ufs/ffs/fs.h.
> 
> Previously:
> Sizeof superblock=1376
> Offset of magic=1372
> 
> Now:
> Sizeof superblock=1384
> Offset of magic=1380

It might be worth putting in some CTASSERTs to verify that the size of
the superblock and/or offsets of important fields don't change.  This
would give 64 bit people a heads up before they try to boot a broken
kernel, and would make compiling a kernel on one of the reference boxes
more useful for people who don't have a 64 bit machine for runtime
testing.

Jake

> 
> This typically results in not being able to fsck the file system
> with a post-change fsck on a pre-change kernel and not being able
> to mount the file system with a post-change kernel.
> 
> The following patch fixes the problem (and fixes the misuse of
> uuid for something that is not universally unique):
> 
> Index: fs.h
> ===================================================================
> RCS file: /home/ncvs/src/sys/ufs/ffs/fs.h,v
> retrieving revision 1.36
> diff -u -r1.36 fs.h
> --- fs.h	8 Jan 2003 22:53:54 -0000	1.36
> +++ fs.h	9 Jan 2003 23:23:28 -0000
> @@ -117,7 +117,7 @@
>   * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in
>   * the super block for this name.
>   */
> -#define MAXMNTLEN	472
> +#define MAXMNTLEN	468
>  
>  /*
>   * The volume name for this filesystem is maintained in fs_volname.
> @@ -311,7 +311,8 @@
>  	int8_t   fs_old_flags;		/* old FS_ flags */
>  	u_char	 fs_fsmnt[MAXMNTLEN];	/* name mounted on */
>  	u_char	 fs_volname[MAXVOLLEN];	/* volume name */
> -	u_int64_t fs_uuid;		/* system-wide unique uid */
> +	u_int64_t fs_swuid;		/* system-wide unique id */
> +	int32_t	 fs_pad;
>  /* these fields retain the current block allocation info */
>  	int32_t	 fs_cgrotor;		/* last cg searched */
>  	void 	*fs_ocsp[NOCSPTRS];	/* padding; was list of fs_cs buffers */
> 
> -- 
>  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030109190349.E4032>