umass device disklabel not detected properly in macppc

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

umass device disklabel not detected properly in macppc

rgcinjp
dear all,

to transfer files between an amd64 Linux, amd64 OpenBSD-current, and macppc
OpenBSD-current i have a USB drive. last night was the first time i tried to
use the drive on the macpcc.

Dec 19 06:09:06 apbg4 /bsd: umass0 at uhub0 port 2 configuration 1 interface 0 "BUFFALO SSD-PEU3" rev 2.10/1.10 addr 2
Dec 19 06:09:06 apbg4 /bsd: umass0: using SCSI over Bulk-Only
Dec 19 06:09:06 apbg4 /bsd: scsibus4 at umass0: 2 targets, initiator 0
Dec 19 06:09:06 apbg4 /bsd: sd0 at scsibus4 targ 1 lun 0: <BUFFALO, SSD-PEU3, PMAP> serial.04110210357B1BD7B099
Dec 19 06:09:06 apbg4 /bsd: sd0: 241216MB, 512 bytes/sector, 494010368 sectors

the disklabel was not detected properly. this is the disklabel on macppc
OpenBSD-current (#638: Mon Dec 16):

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: SSD-PEU3
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30750
total sectors: 494010368
boundstart: 0
boundend: 494010368
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:        494010368                0  unused

i tried both USB ports of the Powerbook5,8. same results.

this is the **correct** disklabel on amd64 OpenBSD-current (#637: Sun Dec 15):

# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: SSD-PEU3
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30750
total sectors: 494010368
boundstart: 0
boundend: 494010368
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:        494010368                0  unused
  i:        494006272             2048  ext2fs


partition can be mounted properly on amd64 Linux and OpenBSD.


IIRC the drive was initialized / created on Linux.


i have other USB drives (whole disk, msdos format) that work properly across all
3 machines.


what am i missing here? looking forward to some pointers.


yorosiku ~

Reply | Threaded
Open this post in threaded view
|

Re: umass device disklabel not detected properly in macppc

Theo de Raadt-2
The disklabel sector is a not a machine-independent format, and it
moves between different sectors on some machines.

You'll find we make no promises about this type of disk-portability.
MBR or GPT label?  Yes.

Our own disklabels, unfortunately not.

[hidden email] wrote:

> dear all,
>
> to transfer files between an amd64 Linux, amd64 OpenBSD-current, and macppc
> OpenBSD-current i have a USB drive. last night was the first time i tried to
> use the drive on the macpcc.
>
> Dec 19 06:09:06 apbg4 /bsd: umass0 at uhub0 port 2 configuration 1 interface 0 "BUFFALO SSD-PEU3" rev 2.10/1.10 addr 2
> Dec 19 06:09:06 apbg4 /bsd: umass0: using SCSI over Bulk-Only
> Dec 19 06:09:06 apbg4 /bsd: scsibus4 at umass0: 2 targets, initiator 0
> Dec 19 06:09:06 apbg4 /bsd: sd0 at scsibus4 targ 1 lun 0: <BUFFALO, SSD-PEU3, PMAP> serial.04110210357B1BD7B099
> Dec 19 06:09:06 apbg4 /bsd: sd0: 241216MB, 512 bytes/sector, 494010368 sectors
>
> the disklabel was not detected properly. this is the disklabel on macppc
> OpenBSD-current (#638: Mon Dec 16):
>
> # /dev/rsd0c:
> type: SCSI
> disk: SCSI disk
> label: SSD-PEU3
> duid: 0000000000000000
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 30750
> total sectors: 494010368
> boundstart: 0
> boundend: 494010368
> drivedata: 0
>
> 16 partitions:
> #                size           offset  fstype [fsize bsize   cpg]
>   c:        494010368                0  unused
>
> i tried both USB ports of the Powerbook5,8. same results.
>
> this is the **correct** disklabel on amd64 OpenBSD-current (#637: Sun Dec 15):
>
> # /dev/rsd1c:
> type: SCSI
> disk: SCSI disk
> label: SSD-PEU3
> duid: 0000000000000000
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 30750
> total sectors: 494010368
> boundstart: 0
> boundend: 494010368
> drivedata: 0
>
> 16 partitions:
> #                size           offset  fstype [fsize bsize   cpg]
>   c:        494010368                0  unused
>   i:        494006272             2048  ext2fs
>
>
> partition can be mounted properly on amd64 Linux and OpenBSD.
>
>
> IIRC the drive was initialized / created on Linux.
>
>
> i have other USB drives (whole disk, msdos format) that work properly across all
> 3 machines.
>
>
> what am i missing here? looking forward to some pointers.
>
>
> yorosiku ~
>

Reply | Threaded
Open this post in threaded view
|

Re: umass device disklabel not detected properly in macppc

Wolfgang Pfeiffer
In reply to this post by rgcinjp

Short version:
     Looks like something's wrong either with your hardware or
software: I have the same computer, with OBSD 6.5 installed, and no
problems mounting thumbs - maybe try another thumb, or recreate the
ext2 partition, or use a stable OBSD, instead of current ...

Here on macppc:
hw.product=PowerBook5,8

with a regular 6.5 it seems:
---------
kern.version=OpenBSD 6.5 (GENERIC) #496: Sat Apr 13 11:54:02 MDT 2019
    [hidden email]:/usr/src/sys/arch/macppc/compile/GENERIC
--------

and I can easily move sticks/data on it around between a Fedora amd64
machine and the macppc Powerbook

For the sake of a demo here:

  + + + + On Linux + + +

Zero-ing a whole usb thumb on Fedora Linux
("dcfldd if=/dev/zero of=/dev ... etc.)

Via "gnome-disks" formatted the thumb ("compatible with all systems
and devices (MBR / DOS"), created a partition choosing "No
filesystem", because ext2 wasn't offered as an option, IIRC ...
then from the command line someth. like:
mkfs.ext2 /dev/sdf1

      + + + + On OBSD macppc + + +

then plugged the drive into the Powerbook:

after
doas disklabel sd0 I get this:

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Transcend 32GB
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 3805
total sectors: 61132800
boundstart: 0
boundend: 61132800
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:         61132800                0  unused
  i:         61130752             2048  ext2fs

-----------

then someth. like:
mount_ext2fs /dev/sd0i /mnt/ntfs

Then on macppc copied parts of this email text over to the thumb on
/mnt/ntfs, unmounted it and took the thumb back to

                  ++++ Fedora Linux ++++

and mounted the thumb on the Linux machine, copying parts of it into
this email, that I write and send from this Fedora system ....

Because of the very first paragraphs on this page:
https://www.openbsd.org/faq/current.html
try stable 6.5, maybe?

Wolfgang


On Wed, Dec 18, 2019 at 10:40:36PM +0000, [hidden email] wrote:

>dear all,
>
>to transfer files between an amd64 Linux, amd64 OpenBSD-current, and macppc
>OpenBSD-current i have a USB drive. last night was the first time i tried to
>use the drive on the macpcc.
>
>Dec 19 06:09:06 apbg4 /bsd: umass0 at uhub0 port 2 configuration 1 interface 0 "BUFFALO SSD-PEU3" rev 2.10/1.10 addr 2
>Dec 19 06:09:06 apbg4 /bsd: umass0: using SCSI over Bulk-Only
>Dec 19 06:09:06 apbg4 /bsd: scsibus4 at umass0: 2 targets, initiator 0
>Dec 19 06:09:06 apbg4 /bsd: sd0 at scsibus4 targ 1 lun 0: <BUFFALO, SSD-PEU3, PMAP> serial.04110210357B1BD7B099
>Dec 19 06:09:06 apbg4 /bsd: sd0: 241216MB, 512 bytes/sector, 494010368 sectors
>
>the disklabel was not detected properly. this is the disklabel on macppc
>OpenBSD-current (#638: Mon Dec 16):
>
># /dev/rsd0c:
>type: SCSI
>disk: SCSI disk
>label: SSD-PEU3
>duid: 0000000000000000
>flags:
>bytes/sector: 512
>sectors/track: 63
>tracks/cylinder: 255
>sectors/cylinder: 16065
>cylinders: 30750
>total sectors: 494010368
>boundstart: 0
>boundend: 494010368
>drivedata: 0
>
>16 partitions:
>#                size           offset  fstype [fsize bsize   cpg]
>  c:        494010368                0  unused
>
>i tried both USB ports of the Powerbook5,8. same results.
>
>this is the **correct** disklabel on amd64 OpenBSD-current (#637: Sun Dec 15):
>
># /dev/rsd1c:
>type: SCSI
>disk: SCSI disk
>label: SSD-PEU3
>duid: 0000000000000000
>flags:
>bytes/sector: 512
>sectors/track: 63
>tracks/cylinder: 255
>sectors/cylinder: 16065
>cylinders: 30750
>total sectors: 494010368
>boundstart: 0
>boundend: 494010368
>drivedata: 0
>
>16 partitions:
>#                size           offset  fstype [fsize bsize   cpg]
>  c:        494010368                0  unused
>  i:        494006272             2048  ext2fs
>
>
>partition can be mounted properly on amd64 Linux and OpenBSD.
>
>
>IIRC the drive was initialized / created on Linux.
>
>
>i have other USB drives (whole disk, msdos format) that work properly across all
>3 machines.
>
>
>what am i missing here? looking forward to some pointers.
>
>
>yorosiku ~

--
"Altars are burnin' with flames far and wide
 The foe has crossed over from the other side
 They tip their caps from the top of the hill
 You can feel them come, more brave blood to spill"

Bob Dylan: "'Cross The Green Mountain"

Reply | Threaded
Open this post in threaded view
|

Re: umass device disklabel not detected properly in macppc

Theo de Raadt-2
No, it has to do with disklabel placement.

It will work if the ext2fs filesystem is listed as a MBR partition,
but not if it is only listed as a disklabel entry.

But after that, you potentially have other issues... we do not make
promises about filesystem compatibility between architectures.

Wolfgang Pfeiffer <[hidden email]> wrote:

>
>
> Short version:
>     Looks like something's wrong either with your hardware or
> software: I have the same computer, with OBSD 6.5 installed, and no
> problems mounting thumbs - maybe try another thumb, or recreate the
> ext2 partition, or use a stable OBSD, instead of current ...
>
> Here on macppc:
> hw.product=PowerBook5,8
>
> with a regular 6.5 it seems:
> ---------
> kern.version=OpenBSD 6.5 (GENERIC) #496: Sat Apr 13 11:54:02 MDT 2019
>    [hidden email]:/usr/src/sys/arch/macppc/compile/GENERIC
> --------
>
> and I can easily move sticks/data on it around between a Fedora amd64
> machine and the macppc Powerbook
>
> For the sake of a demo here:
>
>  + + + + On Linux + + +
>
> Zero-ing a whole usb thumb on Fedora Linux
> ("dcfldd if=/dev/zero of=/dev ... etc.)
>
> Via "gnome-disks" formatted the thumb ("compatible with all systems
> and devices (MBR / DOS"), created a partition choosing "No
> filesystem", because ext2 wasn't offered as an option, IIRC ...
> then from the command line someth. like:
> mkfs.ext2 /dev/sdf1
>
>      + + + + On OBSD macppc + + +
>
> then plugged the drive into the Powerbook:
>
> after
> doas disklabel sd0 I get this:
>
> # /dev/rsd0c:
> type: SCSI
> disk: SCSI disk
> label: Transcend 32GB
> duid: 0000000000000000
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 3805
> total sectors: 61132800
> boundstart: 0
> boundend: 61132800
> drivedata: 0
>
> 16 partitions:
> #                size           offset  fstype [fsize bsize   cpg]
>  c:         61132800                0  unused
>  i:         61130752             2048  ext2fs
>
> -----------
>
> then someth. like:
> mount_ext2fs /dev/sd0i /mnt/ntfs
>
> Then on macppc copied parts of this email text over to the thumb on
> /mnt/ntfs, unmounted it and took the thumb back to
>
>                  ++++ Fedora Linux ++++
>
> and mounted the thumb on the Linux machine, copying parts of it into
> this email, that I write and send from this Fedora system ....
>
> Because of the very first paragraphs on this page:
> https://www.openbsd.org/faq/current.html
> try stable 6.5, maybe?
>
> Wolfgang
>
>
> On Wed, Dec 18, 2019 at 10:40:36PM +0000, [hidden email] wrote:
> >dear all,
> >
> >to transfer files between an amd64 Linux, amd64 OpenBSD-current, and macppc
> >OpenBSD-current i have a USB drive. last night was the first time i tried to
> >use the drive on the macpcc.
> >
> >Dec 19 06:09:06 apbg4 /bsd: umass0 at uhub0 port 2 configuration 1 interface 0 "BUFFALO SSD-PEU3" rev 2.10/1.10 addr 2
> >Dec 19 06:09:06 apbg4 /bsd: umass0: using SCSI over Bulk-Only
> >Dec 19 06:09:06 apbg4 /bsd: scsibus4 at umass0: 2 targets, initiator 0
> >Dec 19 06:09:06 apbg4 /bsd: sd0 at scsibus4 targ 1 lun 0: <BUFFALO, SSD-PEU3, PMAP> serial.04110210357B1BD7B099
> >Dec 19 06:09:06 apbg4 /bsd: sd0: 241216MB, 512 bytes/sector, 494010368 sectors
> >
> >the disklabel was not detected properly. this is the disklabel on macppc
> >OpenBSD-current (#638: Mon Dec 16):
> >
> ># /dev/rsd0c:
> >type: SCSI
> >disk: SCSI disk
> >label: SSD-PEU3
> >duid: 0000000000000000
> >flags:
> >bytes/sector: 512
> >sectors/track: 63
> >tracks/cylinder: 255
> >sectors/cylinder: 16065
> >cylinders: 30750
> >total sectors: 494010368
> >boundstart: 0
> >boundend: 494010368
> >drivedata: 0
> >
> >16 partitions:
> >#                size           offset  fstype [fsize bsize   cpg]
> >  c:        494010368                0  unused
> >
> >i tried both USB ports of the Powerbook5,8. same results.
> >
> >this is the **correct** disklabel on amd64 OpenBSD-current (#637: Sun Dec 15):
> >
> ># /dev/rsd1c:
> >type: SCSI
> >disk: SCSI disk
> >label: SSD-PEU3
> >duid: 0000000000000000
> >flags:
> >bytes/sector: 512
> >sectors/track: 63
> >tracks/cylinder: 255
> >sectors/cylinder: 16065
> >cylinders: 30750
> >total sectors: 494010368
> >boundstart: 0
> >boundend: 494010368
> >drivedata: 0
> >
> >16 partitions:
> >#                size           offset  fstype [fsize bsize   cpg]
> >  c:        494010368                0  unused
> >  i:        494006272             2048  ext2fs
> >
> >
> >partition can be mounted properly on amd64 Linux and OpenBSD.
> >
> >
> >IIRC the drive was initialized / created on Linux.
> >
> >
> >i have other USB drives (whole disk, msdos format) that work properly across all
> >3 machines.
> >
> >
> >what am i missing here? looking forward to some pointers.
> >
> >
> >yorosiku ~
>
> --
> "Altars are burnin' with flames far and wide
> The foe has crossed over from the other side
> They tip their caps from the top of the hill
> You can feel them come, more brave blood to spill"
>
> Bob Dylan: "'Cross The Green Mountain"
>

Reply | Threaded
Open this post in threaded view
|

Re: umass device disklabel not detected properly in macppc

rgcinjp
In reply to this post by Theo de Raadt-2
thanks for the reply and clarifications. much appreciated.



after reading the reply i went back and checked the disk.

on amd64 Linux and OpenBSD fdisk shows the GPT properly.

(output of Linux fdisk)
Disk /dev/sdc: 235.58 GiB, 252933308416 bytes, 494010368 sectors
Disk model: SSD-PEU3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 15420EC6-BC4C-4DAB-BA8E-D4BAAD59640A

Device     Start       End   Sectors   Size Type
/dev/sdc1   2048 494008319 494006272 235.6G Linux filesystem


(output of amd64 OpenBSD fdisk)
sd2: 1> Disk: sd2       Usable LBA: 34 to 494010334 [494010368 Sectors]
GUID: 15420ec6-bc4c-4dab-ba8e-d4baad59640a
   #: type                                 [       start:         size ]
      guid                                 name
------------------------------------------------------------------------
   0: Linux files*                         [        2048:    494006272 ]
      1c5211a4-927b-4836-b2cf-92660b3d7988


2 on macppc OpenBSD fdisk replies "Not Found" ... BUT "fdisk -e" shows:

(output of macppc OpenBSD fdisk)
Enter 'help' for information
sd0: 1> Disk: sd0       geometry: 30750/255/63 [494010368 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: EE      0   0   2 -  30750 184  26 [           1:   494010367 ] EFI GPT
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused

i have very limited knowledge of GPT/MBR/disklabels but that start seems odd.
maybe it was created by the original SW used when the device was manufactured?


3 tested MBR on a separate USB drive, and the device got properly detected by macppc


> MBR or GPT label? Yes.

based on the simple test with the MBR on USB drive and that in mind i nuked the problem
disk's GPT. created an MBR partition matching the size of the original partition. fsck
on a Linux machine didn't return any errors. so ~

(output of Linux fdisk)
Disk /dev/sdc: 235.58 GiB, 252933308416 bytes, 494010368 sectors
Disk model: SSD-PEU3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc4  *     2048 494008319 494006272 235.6G 83 Linux


(output of macppc OpenBSD fdisk)
Disk: sd0       geometry: 30750/255/63 [494010368 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
*3: 83      0  32  33 -  30750 151  57 [        2048:   494006272 ] Linux files*


checking on macppc, disklabel has been kept intact !! now were rolling ~

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: SSD-PEU3
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30750
total sectors: 494010368
boundstart: 0
boundend: 494010368
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:        494010368                0  unused
  i:        494006272             2048  ext2fs


checking on macppc, mount was OK:

/dev/sd0i on /mnt/sd0 type ext2fs (local)


mounted without problems on amd64 Linux and OpenBSD too

maybe i just got lucky



lesson for the day ... stay old skool MBR


yorosiku ~


December 19, 2019 9:17 AM, "Theo de Raadt" <[hidden email]> wrote:

> The disklabel sector is a not a machine-independent format, and it
> moves between different sectors on some machines.
>
> You'll find we make no promises about this type of disk-portability.
> MBR or GPT label? Yes.
>
> Our own disklabels, unfortunately not.
>
> [hidden email] wrote:
>
>> dear all,
>>
>> to transfer files between an amd64 Linux, amd64 OpenBSD-current, and macppc
>> OpenBSD-current i have a USB drive. last night was the first time i tried to
>> use the drive on the macpcc.
>>
>> Dec 19 06:09:06 apbg4 /bsd: umass0 at uhub0 port 2 configuration 1 interface 0 "BUFFALO SSD-PEU3"
>> rev 2.10/1.10 addr 2
>> Dec 19 06:09:06 apbg4 /bsd: umass0: using SCSI over Bulk-Only
>> Dec 19 06:09:06 apbg4 /bsd: scsibus4 at umass0: 2 targets, initiator 0
>> Dec 19 06:09:06 apbg4 /bsd: sd0 at scsibus4 targ 1 lun 0: <BUFFALO, SSD-PEU3, PMAP>
>> serial.04110210357B1BD7B099
>> Dec 19 06:09:06 apbg4 /bsd: sd0: 241216MB, 512 bytes/sector, 494010368 sectors
>>
>> the disklabel was not detected properly. this is the disklabel on macppc
>> OpenBSD-current (#638: Mon Dec 16):
>>
>> # /dev/rsd0c:
>> type: SCSI
>> disk: SCSI disk
>> label: SSD-PEU3
>> duid: 0000000000000000
>> flags:
>> bytes/sector: 512
>> sectors/track: 63
>> tracks/cylinder: 255
>> sectors/cylinder: 16065
>> cylinders: 30750
>> total sectors: 494010368
>> boundstart: 0
>> boundend: 494010368
>> drivedata: 0
>>
>> 16 partitions:
>> # size offset fstype [fsize bsize cpg]
>> c: 494010368 0 unused
>>
>> i tried both USB ports of the Powerbook5,8. same results.
>>
>> this is the **correct** disklabel on amd64 OpenBSD-current (#637: Sun Dec 15):
>>
>> # /dev/rsd1c:
>> type: SCSI
>> disk: SCSI disk
>> label: SSD-PEU3
>> duid: 0000000000000000
>> flags:
>> bytes/sector: 512
>> sectors/track: 63
>> tracks/cylinder: 255
>> sectors/cylinder: 16065
>> cylinders: 30750
>> total sectors: 494010368
>> boundstart: 0
>> boundend: 494010368
>> drivedata: 0
>>
>> 16 partitions:
>> # size offset fstype [fsize bsize cpg]
>> c: 494010368 0 unused
>> i: 494006272 2048 ext2fs
>>
>> partition can be mounted properly on amd64 Linux and OpenBSD.
>>
>> IIRC the drive was initialized / created on Linux.
>>
>> i have other USB drives (whole disk, msdos format) that work properly across all
>> 3 machines.
>>
>> what am i missing here? looking forward to some pointers.
>>
>> yorosiku ~