Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 1998 19:04:58 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        bsdean@gte.net
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: mounting a FreeBSD partition on NetBSD or SunOS
Message-ID:  <199801051904.MAA26601@usr08.primenet.com>
In-Reply-To: <199801010219.VAA04068@corona.unx.sas.com> from "Brian Dean" at Dec 31, 97 09:19:44 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



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