new hfstools command : hdisk?

Nick STEPHEN hfs-interest@ccs.neu.edu
Wed, 31 Jul 96 15:56:15 +0200


> > Yes, it should show up as this. But only, if the Kernel (Or mk) can
> > understand the way how partitions are written to disk. (Partition Tabke
> > Format). I came in contact with this stuff, when I tried to use a
> > RDB-Harddisk from an Amiga 68k in my P100 System. Linux recognized
> > /dev/hdc but not /dev/hdc1,hdc2,hdc3.
> 
> Granted, but that doesn't have anything to do with the *names*.  My point
> was that although ~100% of Linux machines follow the
> /dev/{s,d}d[a-h][1-16] scheme for hard drives, this isn't mandatory.  I
> could name them anything I want, and as long as the device works in the
> first place, it will continue to work with the new name.

I made two stupid factual errors in the email that started this thread
with respect to the naming conventions used by linux and mklinux, but
all the same if fdisk knows how to name partitions, and hfsutils (or
whatever) wants to have similar functionality to fdisk, I presume that
it should have *some* knowledge of partitions (not necessarily of
devices).

Then again, for many systems that run the hfstools, using native
partition numbering is meaningless on a HFS disk since the O/S
can't use the disk's partition table.

Assuming that we *want* to do this, there are ways around the
problem. linux (and mklinux) generally calls a raw devices something
like /dev/sdb (my previous email was incorrect wrt. this), and this
raw device has major device number 8 and minor device number 16.

If you were to run 'hdisk /dev/sdb' then hdisk could do one of two
things:

1) assume that the partition numbers can be found by adding a digit
to the end of the name, "because it's linux".

2) assume that successive partition numbers can be found by looking
for a device special file with the same major number and an incremented
minor device number, and go look up the appropriate name.

This second approach would solve the naming problem but a problem
still remains if different operating systems "hide" HFS partitions (I
believe that MacBSD transparently ignores non-unix partitions because
of a hard limit to the number of partitions, correct me if I'm wrong).


All in all I think I'm just confusing things, because hfstools are
very useful as they are :) Maybe just a simple mechanism for
displaying hfs partitions in an hfstools specific manner and hmounting
a specific partition (rather than always the first partition) in an
hfstools specific manner would be more appropriate.

                [ Nick ]
__
Nick Stephen		     MkLinux:  http://www.mklinux.apple.com
OSF Research Institute	     Homepage: http://www.gr.osf.org/~stephen
2, Avenue de Vignate	     Email:    stephen@gr.osf.org
38610 Gieres - France	     Phone:    +33 76 63 48 72   Fax: +33 76 51 05 32