From owner-freebsd-geom@FreeBSD.ORG Sat Mar 8 02:49:56 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5D1C1065670 for ; Sat, 8 Mar 2008 02:49:56 +0000 (UTC) (envelope-from dwiest@vailsys.com) Received: from dprobd02.vailsys.com (dprobd02.vailsys.com [63.149.73.146]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA968FC23 for ; Sat, 8 Mar 2008 02:49:56 +0000 (UTC) (envelope-from dwiest@vailsys.com) Received: from dpfuser01.vail (dpfuser01.vail [192.168.129.103]) by dprobd02.vailsys.com (Postfix) with ESMTP id CD9CA8A5D91 for ; Fri, 7 Mar 2008 20:49:54 -0600 (CST) Received: from dfwdamian.vail (dfwdamian.vail [192.168.129.233]) by dpfuser01.vail (Postfix) with ESMTP id A57805C5C for ; Fri, 7 Mar 2008 20:49:54 -0600 (CST) Received: (from dwiest@localhost) by dfwdamian.vail (8.13.8/8.13.8/Submit) id m282nsPQ016904 for freebsd-geom@freebsd.org; Fri, 7 Mar 2008 20:49:54 -0600 (CST) (envelope-from dwiest@vailsys.com) X-Authentication-Warning: dfwdamian.vail: dwiest set sender to dwiest@vailsys.com using -f Date: Fri, 7 Mar 2008 20:49:54 -0600 From: Damian Wiest To: freebsd-geom@freebsd.org Message-ID: <20080308024954.GF15859@dfwdamian.vail> References: <20080307230058.GA8902@keira.kiwi-computer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080307230058.GA8902@keira.kiwi-computer.com> User-Agent: Mutt/1.4.2.3i Subject: Re: geom_vinum platform-independent brokenness X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2008 02:49:56 -0000 On Fri, Mar 07, 2008 at 05:00:58PM -0600, Rick C. Petty wrote: > Since no one seems to be working on fixing gvinum, I've decided to > investigate and address some problems I have encountered recently. > > *** > > There is an incompatibility in geom_vinum with respect to i386/amd64. > In particular, the following structure (in geom_vinum_var.h) is stored > as-is on each disk (or provider): > > struct gv_hdr { > uint64_t magic; > #define GV_MAGIC 22322600044678729LL > #define GV_NOMAGIC 22322600044678990LL > > int config_length; > struct gv_label label; > }; > > The problem is the "struct gv_label" is not aligned properly against the > int. On i386 and amd64 system, this corresponds to these offsets: > > i386 amd64 field > ---- ----- ----- > 0 0 magic > 8 8 config_length > - - from struct gv_label : > 12 16 sysname > 44 48 name (of drive) > 76 80 date_of_birth > 84 96 last_update > 92 112 drive_size > = = > 100 120 = total header size > > Because of this, someone who has volumes created with i386 gvinum cannot > put those volumes onto an amd64 system, and vice-versa! So you're saying that you should be able to remove a disk (or set of disks) from an x86 system, install it in a system running the amd64 release and have things just work? I would imagine that most people would simply use dump/restore, but I agree that it would be nice if one didn't have to do this. How is this scenario handled for basic disks? Can an amd64 system handle a disk that was labeled on an x86 system? I haven't ever tried this, but the manpage for bsdlabel suggests that it won't work unless you originally wrote an amd64 label by using the -m option. Aren't you going to run into issues with your filesystems when moving from one architecture to another that uses a different bus width? -Damian