Plan 9 from Bell Labs’s /usr/web/sources/contrib/miller/usb/storage/README

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Usage: usb/usbsfs [-dD] [-m mountpoint] [ctrno id]

Usbsfs serves a directory named mountpoint (default /n/ums) containing
files ctl, data and raw which are analogous to other storage devices:
 - data gives r/w access to blocks of the device
 - ctl accepts one command ("reset"), and gives device geometry when read
 - raw is a raw scsi-like interface (talk to it with scuzz)

It searches for a device with class=8, subclass=5 or 6, protocol=0x50, or
uses /dev/usb<ctrno>/<id> if specified.

You can format the storage any way you like, but the devices seem to come
pre-formatted with one FAT partition, which you can use like this:

term% usb/usbd
term% usb/usbsfs
term% disk/fdisk -p /n/ums/data
part dos 7 31559
term% dossrv -f /n/ums/data:7 usbstorage
dossrv: serving #s/usbstorage
term% mount /srv/usbstorage /n/d:
term% ls -l /n/d:
alrw-rw-rw- M 39 bill trog 180364 Oct  5 18:14 /n/d:/9LOAD
d-rwxrwxrwx M 39 bill trog      0 Nov 13 14:30 /n/d:/benedict

If there are several partitions, you can use fs(3) to manage them - it
seemed redundant to add partition handling to the usbfs driver itself.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.