Subject: Re: disklabeling a 5 TB partition!?
To: Markus W Kilbinger <mk@kilbi.de>
From: Jonathan A. Kollasch <jakllsch@kollasch.net>
List: current-users
Date: 08/04/2006 19:58:45
--Qbvjkv9qwOGw/5Fx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Aug 04, 2006 at 01:22:51PM +0200, Markus W Kilbinger wrote:
> 'man wedge' does not seem to exist on -current systems, nor does 'man
> dk'. Searching the inet does not reveal real further information about
> using wedges with netbsd for me. Does anybody know how to use wedges
> in a netbsd system?

Yes, with some somewhat trivial local modifications:

umass0 at uhub3 port 1 configuration 1 interface 0
umass0: SanDisk Corporation U3 Cruzer Micro, rev 2.00/0.10, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 2 luns per target
sd0 at scsibus0 target 0 lun 0: <SanDisk, U3 Cruzer Micro, 2.15> disk removable
sd0: 483 MB, 983 cyl, 16 head, 63 sec, 512 bytes/sect x 990865 sectors
sd0(umass0:0:0:0): no door lock
sd0: GPT GUID: 35aeb010-16af-4dd7-a003-d0ac3018abc0
dk0 at sd0: Apple_UFS_Untitled_1
dk0: 990792 blocks at 40, type: ffs
dk1 at sd0: dc39f42e-2281-11db-aab8-00c09f9852a4
dk1: 6 blocks at 34, type: unrecognized
cd1 at scsibus0 target 0 lun 1: <SanDisk, U3 Cruzer Micro, 2.15> cdrom removable

This is a GPT-partitioned "disk" with a Apple UFS partition, created
on OS X 10.4.6/i686. With FFS_EI and APPLE_UFS this can be read
on NetBSD/i386. dk1 was added afterwards with tools described below
to encompass space ignored by Disk Utility.app. (BTW, the two U3
Cruzer Micros I have often trigger some bad errors in ehci(4) (both
Intel and VIA controllers)), more so when they are are part of a
RAID array on the same USB bus with each other.)

It should be noted that while the code associated with
options DKWEDGE_METHOD_GPT works, it is incomplete.
The other option I'm using is DKWEDGE_AUTODISCOVER.

I also have a struct disklabel-dependent port of (FreeBSD|OS X)'s
gpt(8), and a utility to print out the GPT structures.  This thread
made me realize that using the DIOCGDINFO ioctl to obtain the size
of the disk is horribly deficient.

Perhaps we could have something similar to FreeBSD's DIOCGSECTORSIZE
and DIOCGMEDIASIZE (both return the number of bytes, I believe the
latter should be number of sectors instead).  Or, maybe something
like Solaris's struct dk_geom and related ioctls.  However, I'm not
the one who should be making this choice.

I also have a simplistic man page for dk(4).  Perhaps I should submit
this someday.  A dk(9) page may also be useful, but I don't think I
understand the API well enough to document it.

	Jonathan Kollasch

--Qbvjkv9qwOGw/5Fx
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFE0+1FOjx1ye3hmokRAsigAJ9FgvkPnWvjW1u7fn13h4DMGrgf3wCeJurT
bER7hsEyG6WDG/ayM+dDZ3I=
=8lfQ
-----END PGP SIGNATURE-----

--Qbvjkv9qwOGw/5Fx--