Re: USB Mass Storage not working on Solaris 10

From: Paolo Di Francesco (paipai_at_remove-this-dot-tin-dot.it)
Date: 07/29/05


Date: Fri, 29 Jul 2005 21:07:28 GMT


> It didn't show up with "format -e" even after killing
> volume management?
>
>
> What errors are logged in /var/adm/messages?
>
> Casper

Hi Casper and all the guys on the group,

sorry for my delay but it was a busy period... So, the problem is that
after stopping vold the device "loses" all the settings. If I try to
query with iostat the device has the right settings (i.e. at least it
shows the 203GB) while if I stop the vold I have a 0.0MB device :(

I noticed the same happens with the lexar, but I was lucky enough to
format it and to mount it. (maybe I was particularly lucky that day!) So
I guess it's something related to the USB controller (maybe?). Anyway
the controller is a NEC based PCI card.

No error shows up in the /var/adm/messages :(

(Just it shows the plug/unplug messages of the device if I unplug it)

Now, this beat has also a FireWire port, so I connected it to the system
  (my sparc workstation). I noticed the beast is correctly seen by the
system:

iostat -Ei

[...]
sd33 Soft Errors: 95 Hard Errors: 0 Transport Errors: 0
Vendor: Maxtor 6 Product: Y200P0 Revision: YAR4 Device Id:
Size: 203.92GB <203921141760 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 95 Predictive Failure Analysis: 0
[...]

curiosly the "old" USB is still floating there:

iostat -Ei

[...]
sd16 Soft Errors: 0 Hard Errors: 21 Transport Errors: 92
Vendor: USB 2.0 Product: Storage Device Revision: 0100 Device Id:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

I think this is because I simply powered off the device, then unplugged
it from the USB port, then connected to firewire, then turned it on.

Anyway here what happens:

1) vold is running
2) I run rmformat:
  rmformat -l
Looking for devices...
      1. Volmgt Node: /vol/dev/aliases/rmdisk0
         Logical Node: /dev/rdsk/c5t0d0s2
         Physical Node: /pci@8,700000/usb@1,2/storage@2/disk@0,0
         Connected Device: LEXAR JUMPDRIVE PRO 0
         Device Type: Removable
      2. Volmgt Node: /vol/dev/aliases/rmdisk1
         Logical Node: /dev/rdsk/c6t0d0s2
         Physical Node:
/pci@8,700000/firewire@5,2/unit@0030e001e000085c/disk@0,0
         Connected Device: Maxtor 6 Y200P0 YAR4
         Device Type: Removable
This is nice, it sees both.

Labelling both devices works:

~# rmformat -b lexar /vol/dev/aliases/rmdisk0
~# rmformat -b usbdrive /vol/dev/aliases/rmdisk1
~#

but... trying to format them is unsucessfull:

~# rmformat -F quick /vol/dev/aliases/rmdisk1
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
Format failed : Operation not supported

the funny thing is that I tried to newfs the hard disk and it works:

~# /etc/init.d/volmgt stop
(or it will not let me newfs the device)

then run the 1st time

~# newfs -v /dev/rdsk/c6t0d0s2
newfs: /dev/rdsk/c6t0d0s2 last mounted as /rmdisk/usbdrive
newfs: construct a new file system /dev/rdsk/c6t0d0s2: (y/n)? y
mkfs -F ufs /dev/rdsk/c6t0d0s2 398283480 63 255 8192 1024 264 1 3 8192 t
0 -1 8 16 n
With 16065 sectors per cylinder, minimum cylinders per group is 16
This requires the fragment size to be changed from 1024 to 4096
Please re-run mkfs with corrected parameters

so I follow the advice and I get:

~# newfs -f 4096 -v /dev/rdsk/c6t0d0s2
newfs: construct a new file system /dev/rdsk/c6t0d0s2: (y/n)? y
mkfs -F ufs /dev/rdsk/c6t0d0s2 398283480 63 255 8192 4096 264 1 3 8192 t
0 -1 8 16 n
Warning: cylinder groups must have a multiple of 16 cylinders with the given
          parameters
Rounded cgsize up to 272
Warning: insufficient space in super block for
rotational layout tables with nsect 63, ntrack 255, and nrpos 8.
Omitting tables - file system performance may be impaired.
/dev/rdsk/c6t0d0s2: 398283480 sectors in 24792 cylinders of 255
tracks, 63 sectors
         194474.4MB in 1550 cyl groups (16 c/g, 125.51MB/g, 15744 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
  32, 257136, 514240, 771344, 1028448, 1285552, 1542656, 1799760, 2056864,
  2313968,
Initializing cylinder groups:
..............................
super-block backups for last 10 cylinder groups at:
  395841888, 396098992, 396356096, 396613200, 396870304, 397127408,
397384512,
  397641616, 397898720, 398155824,

which looks like "working"! and then:

~# mount /dev/dsk/c6t0d0s2 /mnt/usb-c/
~# ls /mnt/usb-c/
lost+found/
~# df -h
Filesystem size used avail capacity Mounted on
[...]
/dev/dsk/c6t0d0s2 187G 64M 185G 1% /mnt/usb-c

I also tried transferring some stuff on the disk and it looks like
working. Now, this procedure slitly differs from what I have read on the
docs.sun.com (the admin guide) so now the questions are:

1) why does not rmformat work? what I am missing there? I followed the
steps on the sun docs and it did not work
2) why does this procedure work!?!? I mean, I have what I wanted, i.e.
some new fresh free bytes, but is it correct?
3) I guess what I did is not correct. So what do I have now on my hd?
should I expect surprises?
4) hum... do you think logging should be working on this disk or I will
loose all my precius data after the first time it fails?
5) why still so many errors (soft errors) ? Is that normal? Notice that
soft errors == Illegal Request.
6) should I consider this storage as high risk? (i.e. better to avoid
important data on it)
7) should I upgrade to Solaris Express, so maybe I will find some fixes
for usb and firewire?

Thank you!

P.S. I will try this weekend to investigate on usb as suggested by Juergen.


Loading