From owner-freebsd-hackers Mon Jan 5 11:06:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA00997 for hackers-outgoing; Mon, 5 Jan 1998 11:06:31 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA00915 for ; Mon, 5 Jan 1998 11:05:58 -0800 (PST) (envelope-from tlambert@usr08.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id MAA06978; Mon, 5 Jan 1998 12:05:18 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp04.primenet.com, id smtpd006927; Mon Jan 5 12:05:08 1998 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id MAA26601; Mon, 5 Jan 1998 12:04:58 -0700 (MST) From: Terry Lambert Message-Id: <199801051904.MAA26601@usr08.primenet.com> Subject: Re: mounting a FreeBSD partition on NetBSD or SunOS To: bsdean@gte.net Date: Mon, 5 Jan 1998 19:04:58 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <199801010219.VAA04068@corona.unx.sas.com> from "Brian Dean" at Dec 31, 97 09:19:44 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > I have a few questions about filesystems created by one Unix variant > and being mounting by another. Generally not possible because of byte-order and other issues. The code Julian has done for partitioning schema recognition can address this, to some extent, but obviously it (1) only runs on FreeBSD so far, and (2) you would need to write recognition and layers for non FreeBSD recognized types (ie: the code is not yet exhaustive). Even after resolving this, after which you would have a proper device with nothingbut a foreign FS on it, there are byte order issues to resolve. > I'm running NetBSD 1.2.1 on SPARC at home and FreeBSD 3.0 (late > november snap) on x86 at work. I have an Iomega Jaz drive (removable > media) and would like to be able to create a Unix filesystem that is > mountable by both systems that I can transport between machines. I believe the NetBSD/SPARC port uses SunOS UFS layout. This means that it uses the correct byte order, not the Intel byte order, to lay out non-character values on disk. There are, in addition, issues of structure packing (effectively, you need to use "#pragma pack(1)" on structure declarations to ensure portability between machines, and padding needs to be explicit). It is not as difficult as it would first seem to resolve byte order issues -- just abstract non-character field references via macro, and make the macro conditional on a new mount flag -- but this is not likely to make it in as a default, given that it adds an extra compare/branch/jump and a possible dtohl/dtohs/htodl/htodl per reference/set. That's a lot of slowdown. > First off, is there a way to tell NetBSD/Sparc to honor the PC boot > block and partition table and use it to find the mountable FreeBSD UFS > partition? Port the DEVFS code and SLICE stack stuff to NetBSD. > Thirdly, even if one could do one of the above, would the file system > be mountable? Is the byte-ordering between processor architectures > (big/little endian) an issue here, or are the file system structures > as they reside on the disk, portable across architectures? No, and No. > And Fourth, if creating a such filesystem is not an option, what other > options do I have? As a (final) last resort can I do something like: > FreeBSD> tar cf - . | dd of=/dev/sd4c # jaz drive > NetBSD> dd if=/dev/sd4c | tar xf - The closest you could get would be to use a FATFS, which has a defined byte order. The CD9660 would work as well, but it is badly structured for read/write, and read/write is not supported in the implementations on either OS. I have more than a little interest in this type of thing myself. I'd be willing to give advice and probably some code towards at least making FreeBSD recognize NetBSD FS's from different architectures. Let me know if you get serious about putting in some hours on the problem. It would be best for me if the work was carried out on JAZ cartridges (that's where most of my NetBSD installations live). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.