[1376] in netbsd-help mailing list archive

home help back first fref pref prev next nref lref last post

Re: mounting linux partition under netbsd

daemon@ATHENA.MIT.EDU (Nathan J. Williams)
Tue Dec 8 01:40:52 1998

To: Richard S Tibbetts <tibbetts@MIT.EDU>
Cc: netbsd-help@MIT.EDU
From: "Nathan J. Williams" <nathanw@MIT.EDU>
In-Reply-To: Your message of "Tue, 08 Dec 1998 00:26:03 EST."
             <199812080526.AAA00954@ten-cent-crack-whore.mit.edu> 
Date: Tue, 08 Dec 1998 01:40:43 EST

> I a hoping to mount linux (redhat 5.1) formatted partitions under NetBSD
> Athena. I have been told that this involves messing with the disklabel
> under NetBSD. 

> linux fdisk says my disk looks like this (retyped, not copied)
> 
> Partition	begin	start	end	blocks		type	comment
> hda1		1	1	261	2096451		a5	NetBSD
> hda2		262	262	524	2112547+	5	dos extended
> 
> hda5		262	262	338	618471		83	/
> hda6		339	339	355	136521		82	swap
> hda7		356	356	524	1357461		83	/usr

	I'm guessing you're interested in what the Linux side thinks
of as /usr, not /.

> Currently my disklabel looks like this:
 [deleted]
> 6 partitions:
> #        size   offset    fstype   [fsize bsize   cpg]
> a:   204800       63      4.2BSD     1024  8192    16   # (Cyl.    0*- 203*)
> b:   131072   204863        swap                        # (Cyl.  203*- 333*)
> c:  4192902       63      unused        0     0         # (Cyl.    0*- 4159*)
> d:  8421840        0      unused        0     0         # (Cyl.    0 - 8354)
> e:   131072   335935      4.2BSD     1024  8192    16   # (Cyl.  333*- 463*)
> f:  3725312   467007      4.2BSD     1024  8192    16   # (Cyl.  463*- 4159*)

> so, my problem is, what do i do about the extended partion?
> generally, i dont know where to begin. if someone could
> point me to a faq, that would be great.

There's a NetBSD/i386 FAQ at
http://www.netbsd.org/Ports/i386/faq.html, which discusses adding a
MS-DOS partition. The details are different, but the basic concept is
the same. You need to add to the NetBSD disklabel an entry with the
size and offset of the Linux partition in question. The size and
offset need to be in units of sectors (512 bytes), but the Linux side
is reporting in cylinder numbers using some translation schem (since
it is using 524 as the largest cylinder, while NetBSD is using 8355 as
the largest cylinder. It's not totally clear what the translation
scheme is from the linux information in your message. 

	Making some wild assumptions about how the numbers add up
(assumming that the start of the Linux /usr partition is the start of
BSD partition f + size of f + size of Linux / + size of Linux swap),
the line to add would look like:
g: 1357461 4947311	ext2fs

and you'll have to change the number of partitions from 6 to 7. 

In short, you need to enough poking around on the Linux side to
figure out exactly where, in sectors, the partition you care about
lies, and then put those numbers into an entry in the disklabel with
disklabel -e. Then you can add a line to /etc/fstab to mount it;
something like:

/dev/wd0g	/linux	ext2fs	rw

should do the trick.

	- Nathan

home help back first fref pref prev next nref lref last post