9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] installing on a usb disk
@ 2010-07-19  2:30 Jeff Sickel
  2010-07-19  8:33 ` Francisco J Ballesteros
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Sickel @ 2010-07-19  2:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Something has changed in a recent VMware update that now prevents me from just using dd to clone my Plan 9 VMware instance onto a CF device (the MBR is no longer set correctly after using dd).  Now I'm looking for a way to get Plan 9 to mount and clone a file system over to a SanDisk CF device, does anyone have any pointers on getting this to work?

I can see the device in /n/usb/sdU0.0, the geometry 'looks' correct.  But I can't cleanly mount the device and have it show up consistently in /dev/ for all the disk tools to have at it.

If I do:

	usb/disk

I get "no device found".  But if instead the command is:

	usb/usbfat:

I get /dev/sdU0.0 and /dev/sdU0.1 with plausible trees (ctl data raw).  The sdU0.0 corresponds to a usb/probe that returns:

	ep3.0 storage csp 0x500608 vid 0x0781 did 0xa1a2 'SanDisk ' 'Extreme III USB2.0 Reader/Writer' ehci


So far I've found that the following process gets me most of the way there:

cpu% mount /srv/usb /n/usb
cpu% disk/partfs /n/usb/sdU0.0/data
cpu% disk/mbr -m /386/mbr /dev/sdXX/data
cpu% disk/fdisk -baw /dev/sdXX/data
cpu% disk/prep /dev/sdXX/plan9
  9fat                  0 204800     (204800 sectors, 100.00 MB)
  nvram            204800 204801     (1 sectors, 512 B )
  fossil           204801 3211674    (3006873 sectors, 1.43 GB)
  swap            3211674 3963393    (751719 sectors, 367.05 MB)
  empty           3963393 3999618    (36225 sectors, 17.68 MB)


A little tweak corrects for the empty space.  After getting this far, how safe is doing:

   dd -if=/dev/sdC0/fossil -of=/dev/sdXX/fossil

I get my Soekris box booting off of this, but it is not optimal.  USB dd transfers are SLOW, as in it took over an hour and a half for dd to complete the above command.

-jas




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] installing on a usb disk
  2010-07-19  2:30 [9fans] installing on a usb disk Jeff Sickel
@ 2010-07-19  8:33 ` Francisco J Ballesteros
  2010-07-19 13:48   ` Jeff Sickel
  0 siblings, 1 reply; 4+ messages in thread
From: Francisco J Ballesteros @ 2010-07-19  8:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>
> If I do:
>
>        usb/disk
>
> I get "no device found".  But if instead the command is:
>
>        usb/usbfat:
>
> I get /dev/sdU0.0 and /dev/sdU0.1 with plausible trees (ctl data raw).  The sdU0.0 corresponds to a usb/probe that returns:
>

Are you running usbd with embedded disks? In that case the disks are owned by
the usb/disk linked into usbd, and the one you start by hand should
see no disks, as it happens.
I'd like to confirm this, just to know if it's a bug.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] installing on a usb disk
  2010-07-19  8:33 ` Francisco J Ballesteros
@ 2010-07-19 13:48   ` Jeff Sickel
  2010-07-19 13:52     ` Francisco J Ballesteros
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Sickel @ 2010-07-19 13:48 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


On Jul 19, 2010, at 3:33 AM, Francisco J Ballesteros wrote:

>> 
>> If I do:
>> 
>>        usb/disk
>> 
>> I get "no device found".  But if instead the command is:
>> 
>>        usb/usbfat:
>> 
>> I get /dev/sdU0.0 and /dev/sdU0.1 with plausible trees (ctl data raw).  The sdU0.0 corresponds to a usb/probe that returns:
>> 
> 
> Are you running usbd with embedded disks? In that case the disks are owned by
> the usb/disk linked into usbd, and the one you start by hand should
> see no disks, as it happens.
> I'd like to confirm this, just to know if it's a bug.

That question made me go back to the man page and dig through the sources again.  It's the default/most recent configuration from yesterday's live CD.

	cpu% cat usbdb
	# only kb,  disk, and ether  are prepared for embedding.
	# others are not yet converted to sit in the usbd device driver library
	embed
		kb	csp=0x010103 csp=0x020103	args=
		disk	class=storage			args=
		ether	class=255 csp=0x00ffff		args=
		serial	class=255 csp=0xffffff vid=0x9e88 did=0x9e8f	args=
	#	wifi	class=0 csp=0 vid=0x0bda did=0x8192	args=
	#	wifi	class=0 csp=0 vid=0x148f did=0x2870	args=


Another side note: I had to explicitly do the following for anything to show up:

	cat% mount /srv/usb /n/usb





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] installing on a usb disk
  2010-07-19 13:48   ` Jeff Sickel
@ 2010-07-19 13:52     ` Francisco J Ballesteros
  0 siblings, 0 replies; 4+ messages in thread
From: Francisco J Ballesteros @ 2010-07-19 13:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Ok. Then it's as expected.
In this usbdb, usb/disk is built into usbd.
That means that usbd will spawn a driver for disk as soon as it sees
a disk plugged in. If you run usb/disk on your own, there will be no unhandled
disks left for it and it should say that there are no disks and exit.

Regarding the mount, yes, the fs from usbd is to be mounted also at /dev
for usbfat and others to use. You might add an entry to your namespace file
if it's not mounted by default.

On Mon, Jul 19, 2010 at 3:48 PM, Jeff Sickel <jas@corpus-callosum.com> wrote:
>
> On Jul 19, 2010, at 3:33 AM, Francisco J Ballesteros wrote:
>
>>>
>>> If I do:
>>>
>>>        usb/disk
>>>
>>> I get "no device found".  But if instead the command is:
>>>
>>>        usb/usbfat:
>>>
>>> I get /dev/sdU0.0 and /dev/sdU0.1 with plausible trees (ctl data raw).  The sdU0.0 corresponds to a usb/probe that returns:
>>>
>>
>> Are you running usbd with embedded disks? In that case the disks are owned by
>> the usb/disk linked into usbd, and the one you start by hand should
>> see no disks, as it happens.
>> I'd like to confirm this, just to know if it's a bug.
>
> That question made me go back to the man page and dig through the sources again.  It's the default/most recent configuration from yesterday's live CD.
>
>        cpu% cat usbdb
>        # only kb,  disk, and ether  are prepared for embedding.
>        # others are not yet converted to sit in the usbd device driver library
>        embed
>                kb      csp=0x010103 csp=0x020103       args=
>                disk    class=storage                   args=
>                ether   class=255 csp=0x00ffff          args=
>                serial  class=255 csp=0xffffff vid=0x9e88 did=0x9e8f    args=
>        #       wifi    class=0 csp=0 vid=0x0bda did=0x8192     args=
>        #       wifi    class=0 csp=0 vid=0x148f did=0x2870     args=
>
>
> Another side note: I had to explicitly do the following for anything to show up:
>
>        cat% mount /srv/usb /n/usb
>
>
>
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-19 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19  2:30 [9fans] installing on a usb disk Jeff Sickel
2010-07-19  8:33 ` Francisco J Ballesteros
2010-07-19 13:48   ` Jeff Sickel
2010-07-19 13:52     ` Francisco J Ballesteros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).