Subject: Re: Wrong "fake" disklabel for USB-dev with MSDOS partition on NBSD4
To: David Laight <david@l8s.co.uk>
From: Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen <lhp@toft-hp.dk>
List: netbsd-help
Date: 01/15/2007 00:41:19
David Laight wrote:

>> How can I get the NetBSD 3 behaviour back?
>
>You can't it was completely wrong!

Well, from my POV, it used to work and now it doesn't, so I am
inclined to think of the old behaviour as right, and not easily
persuaded to think otherwise. :-)

>In any case 'd' would have been the entire disk, the filesystem part would
>always have been something different.

Sorry. I remembered incorrectly (having rebooted back into NetBSD4.)
It is indeed coming up under NetBSD 3.1 as partition e, of type MSDOS:

umass1 at uhub1 port 1 configuration 2 interface 0
umass1: Sony Ericsson Memory Stick, rev 2.00/0.00, addr 2
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 1 lun per target
sd1 at scsibus1 target 0 lun 0: <Sony Eri, Memory Stick, 0000> disk removable
sd1: drive offline
sd1: fabricating a geometry

$ sudo disklabel sd1 2>&1 |tail -8
5 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 d:    121821         0     unused      0     0        # (Cyl.      0 -     59*)
 e:    121821        35      MSDOS                     # (Cyl.      0*-     59+)
disklabel: boot block size 0
disklabel: super block size 0
disklabel: partition e: partition extends past end of unit

>I actually suspect that the mbr partition containing the msdos/fat
>filesystem now appears as 'e', whereas it used to appear in a lot of the
>entries.

That's the problem: for some reason it *does not* come up as e, and also
it has the wrong type! (and possibly a wrong offset?)

Here's NetBSD4:
umass1 at uhub1 port 1 configuration 2 interface 0
umass1: Sony Ericsson Memory Stick, rev 2.00/0.00, addr 2
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 1 lun per target
sd1 at scsibus1 target 0 lun 0: <Sony Eri, Memory Stick, 0000> disk removable
sd1: drive offline
sd1: fabricating a geometry
sd1: mbr partition exceeds disk size
able:~ $ sudo disklabel sd1 2>&1 |tail -10
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    121821         0     4.2BSD      0     0     0  # (Cyl.      0 -     59*)
 d:    121821         0     unused      0     0        # (Cyl.      0 -     59*)
disklabel: boot block size 0
disklabel: super block size 0

>The partition type doesn't matter that much either.

I don't know whether it's because the offset (shown as 35 for NetBSD 3.1
above) is now zero, but in any case, I can't mount the partition, even
when I put in an explicit -t msdos in the mount command. If it's not the
offset, then I suppose it could be the type?

I'd very much appreciate some workable solution other than rebooting into
3.1 every time I want to copy pictures from my phone or camera to my machine!

-Lasse