9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Root file system from usb-hdd on raspberry pi
@ 2013-03-26 12:51 Friedrich Psiorz
  2013-03-26 13:07 ` erik quanstrom
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-26 12:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I'm currently trying to set up a usb-hdd as my root filesystem; I found
out, that I have to use partfs to actually see the partitions I create,
however they don't show up after the next reboot; i have to use fdisk's
and prep's w command (without actualy modifying the partition table), to
see the partitions I created in the file system. Is that normal?
Also, I don't yet quite understand how to boot from such a partition.
Somehow I need to get partfs into the kernel; but I don't know how, and
after that, how to use it for booting form the external hdd.

I also tried connecting the hdd to a pc running 9front, and it
flawlessly detected all of the partitions without any intervention. Is
it possible to just use 9front's usb driver or the whole 9front kernel
source and then compile it for the raspberry pi? Would that break any
compatibilities with the labs' plan 9?

For short: what do you think would be the easiest way to get my pi's
root filesystem from my external hdd.

Sorry for so many questions at once, I'm relatively new to plan 9.



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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 12:51 [9fans] Root file system from usb-hdd on raspberry pi Friedrich Psiorz
@ 2013-03-26 13:07 ` erik quanstrom
  2013-03-26 13:47   ` Friedrich Psiorz
  0 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2013-03-26 13:07 UTC (permalink / raw)
  To: 9fans

On Tue Mar 26 08:52:50 EDT 2013, f.psiorz@gmx.de wrote:
> I'm currently trying to set up a usb-hdd as my root filesystem; I found
> out, that I have to use partfs to actually see the partitions I create,
> however they don't show up after the next reboot; i have to use fdisk's
> and prep's w command (without actualy modifying the partition table), to
> see the partitions I created in the file system. Is that normal?

that is normal.  but, there is no need to fdisk your disk unless you're
booting from dos.  you can use prep directly.  for fdisk+prep the
normal way to do this would be
	disk/fdisk /dev/sdXX/data>/dev/sdXX/ctl
	test -f /dev/sdXX/plan9 && disk/prep /dev/sdXX/plan9>/dev/sdXX/ctl
if you have prep only, only this would be needed
	disk/prep /dev/sdXX/plan9>/dev/sdXX/ctl
this is prepackaged in /rc/bin/diskparts, and the kernel will do
this for you on boot.

> Also, I don't yet quite understand how to boot from such a partition.
> Somehow I need to get partfs into the kernel; but I don't know how, and
> after that, how to use it for booting form the external hdd.

you need to build partfs into your kernel.  add
	/arm/bin/disk/partfs
to the bootdir section of your kernel configuration file and rebuild.
in the rpi's case, i believe the kernel config is named /sys/src/9/bcm/pi
or picpu.

- erik



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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 13:07 ` erik quanstrom
@ 2013-03-26 13:47   ` Friedrich Psiorz
  2013-03-26 13:56     ` erik quanstrom
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-26 13:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I recompiled the kernel as you said, and noticed that it doesn't
complain about missing partfs during boot anymore; however there is no
additional sd*, still only sdM0 and sdU0.0, which still doesn't show me
any partitions.

Am 26.03.2013 14:07, schrieb erik quanstrom:
> On Tue Mar 26 08:52:50 EDT 2013, f.psiorz@gmx.de wrote:
>> I'm currently trying to set up a usb-hdd as my root filesystem; I found
>> out, that I have to use partfs to actually see the partitions I create,
>> however they don't show up after the next reboot; i have to use fdisk's
>> and prep's w command (without actualy modifying the partition table), to
>> see the partitions I created in the file system. Is that normal?
>
> that is normal.  but, there is no need to fdisk your disk unless you're
> booting from dos.  you can use prep directly.  for fdisk+prep the
> normal way to do this would be
> 	disk/fdisk /dev/sdXX/data>/dev/sdXX/ctl
> 	test -f /dev/sdXX/plan9 && disk/prep /dev/sdXX/plan9>/dev/sdXX/ctl
> if you have prep only, only this would be needed
> 	disk/prep /dev/sdXX/plan9>/dev/sdXX/ctl
> this is prepackaged in /rc/bin/diskparts, and the kernel will do
> this for you on boot.
>
>> Also, I don't yet quite understand how to boot from such a partition.
>> Somehow I need to get partfs into the kernel; but I don't know how, and
>> after that, how to use it for booting form the external hdd.
>
> you need to build partfs into your kernel.  add
> 	/arm/bin/disk/partfs
> to the bootdir section of your kernel configuration file and rebuild.
> in the rpi's case, i believe the kernel config is named /sys/src/9/bcm/pi
> or picpu.
>
> - erik
>




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 13:47   ` Friedrich Psiorz
@ 2013-03-26 13:56     ` erik quanstrom
  2013-03-26 14:25       ` Friedrich Psiorz
  0 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2013-03-26 13:56 UTC (permalink / raw)
  To: 9fans

On Tue Mar 26 09:48:30 EDT 2013, f.psiorz@gmx.de wrote:
> I recompiled the kernel as you said, and noticed that it doesn't
> complain about missing partfs during boot anymore; however there is no
> additional sd*, still only sdM0 and sdU0.0, which still doesn't show me
> any partitions.

i'm sorry.  the distribution assumes you are booting a pc.  i think
you can hack around this without changing the source by
putting the partition table information in an environment variable.
the format is
	sdB0parts=a 127 128/b 129 130
you'll need to replace a and b and the made up sector numbers with
real values in your configuration.

- erik



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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 13:56     ` erik quanstrom
@ 2013-03-26 14:25       ` Friedrich Psiorz
  2013-03-26 14:35         ` erik quanstrom
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-26 14:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hmm, ok, I'm more confused now than before.
do I have to put all partitions there? Or just the 'plan9' partition
that fdisk created?
Where do I set the environment variable? I tried adding
sdB0parts='p1 0 38913'
to cmdline.txt, but nothing happens.

Am 26.03.2013 14:56, schrieb erik quanstrom:
> On Tue Mar 26 09:48:30 EDT 2013, f.psiorz@gmx.de wrote:
>> I recompiled the kernel as you said, and noticed that it doesn't
>> complain about missing partfs during boot anymore; however there is no
>> additional sd*, still only sdM0 and sdU0.0, which still doesn't show me
>> any partitions.
>
> i'm sorry.  the distribution assumes you are booting a pc.  i think
> you can hack around this without changing the source by
> putting the partition table information in an environment variable.
> the format is
> 	sdB0parts=a 127 128/b 129 130
> you'll need to replace a and b and the made up sector numbers with
> real values in your configuration.
>
> - erik
>




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 14:25       ` Friedrich Psiorz
@ 2013-03-26 14:35         ` erik quanstrom
  2013-03-26 15:53           ` Friedrich Psiorz
  0 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2013-03-26 14:35 UTC (permalink / raw)
  To: 9fans

On Tue Mar 26 10:27:02 EDT 2013, f.psiorz@gmx.de wrote:
> Hmm, ok, I'm more confused now than before.

sorry.  evidently i'm not good at explaining this.

> do I have to put all partitions there? Or just the 'plan9' partition
> that fdisk created?

put all the partitions in.  (but remember, there is no reason to use fdisk
partitions at all.)

> Where do I set the environment variable? I tried adding
> sdB0parts='p1 0 38913'
> to cmdline.txt, but nothing happens.

i misspelled it.  it should be "sdB0part".  no "s".  my bad.

- erik



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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 14:35         ` erik quanstrom
@ 2013-03-26 15:53           ` Friedrich Psiorz
  2013-03-26 22:53             ` Friedrich Psiorz
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-26 15:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

No I get these errors when booting:

can't update /dev/sdXX/data's devsd partition table for nvram: partition
name already in use: "part nvram 63 64"
can't update /dev/sdXX/data's devsd partition table for fossil:
partition name already in use: "part fossil 64 99518702"
can't update /dev/sdXX/data's devsd partition table for arenas:
partition name already in use: "part arenas 99518702 597111894"
can't update /dev/sdXX/data's devsd partition table for isect: partition
name already in use: "part isect 597111894 621991554"
can't update /dev/sdXX/data's devsd partition table for swap: partition
name already in use: "part swap 621991554 623040130"
can't update /dev/sdXX/data's devsd partition table for cache: partition
name already in use: "part cache 623040130 625137282"

the numbers are what's in the partition table +63
they are the same, no matter if I set sdB0part to these numbers or the
ones from the partition table

Am 26.03.2013 15:35, schrieb erik quanstrom:
> On Tue Mar 26 10:27:02 EDT 2013, f.psiorz@gmx.de wrote:
>> Hmm, ok, I'm more confused now than before.
>
> sorry.  evidently i'm not good at explaining this.
>
>> do I have to put all partitions there? Or just the 'plan9' partition
>> that fdisk created?
>
> put all the partitions in.  (but remember, there is no reason to use fdisk
> partitions at all.)
>
>> Where do I set the environment variable? I tried adding
>> sdB0parts='p1 0 38913'
>> to cmdline.txt, but nothing happens.
>
> i misspelled it.  it should be "sdB0part".  no "s".  my bad.
>
> - erik
>




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 15:53           ` Friedrich Psiorz
@ 2013-03-26 22:53             ` Friedrich Psiorz
  2013-03-27  7:59               ` David du Colombier
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-26 22:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Also, the disk still doesn't show up as sdB0 or sdXX or something like
that in /dev; still only sdU0.0
Do I have to do something to make sdB0/sdXX appear?

Am 26.03.2013 16:53, schrieb Friedrich Psiorz:
> No I get these errors when booting:
>
> can't update /dev/sdXX/data's devsd partition table for nvram: partition
> name already in use: "part nvram 63 64"
> can't update /dev/sdXX/data's devsd partition table for fossil:
> partition name already in use: "part fossil 64 99518702"
> can't update /dev/sdXX/data's devsd partition table for arenas:
> partition name already in use: "part arenas 99518702 597111894"
> can't update /dev/sdXX/data's devsd partition table for isect: partition
> name already in use: "part isect 597111894 621991554"
> can't update /dev/sdXX/data's devsd partition table for swap: partition
> name already in use: "part swap 621991554 623040130"
> can't update /dev/sdXX/data's devsd partition table for cache: partition
> name already in use: "part cache 623040130 625137282"
>
> the numbers are what's in the partition table +63
> they are the same, no matter if I set sdB0part to these numbers or the
> ones from the partition table
>
> Am 26.03.2013 15:35, schrieb erik quanstrom:
>> On Tue Mar 26 10:27:02 EDT 2013, f.psiorz@gmx.de wrote:
>>> Hmm, ok, I'm more confused now than before.
>>
>> sorry.  evidently i'm not good at explaining this.
>>
>>> do I have to put all partitions there? Or just the 'plan9' partition
>>> that fdisk created?
>>
>> put all the partitions in.  (but remember, there is no reason to use fdisk
>> partitions at all.)
>>
>>> Where do I set the environment variable? I tried adding
>>> sdB0parts='p1 0 38913'
>>> to cmdline.txt, but nothing happens.
>>
>> i misspelled it.  it should be "sdB0part".  no "s".  my bad.
>>
>> - erik
>>
>
>




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-26 22:53             ` Friedrich Psiorz
@ 2013-03-27  7:59               ` David du Colombier
  2013-03-27  9:18                 ` Friedrich Psiorz
  0 siblings, 1 reply; 12+ messages in thread
From: David du Colombier @ 2013-03-27  7:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

> Also, the disk still doesn't show up as sdB0 or sdXX or something like
> that in /dev; still only sdU0.0
> Do I have to do something to make sdB0/sdXX appear?

disk/partfs /dev/sdU0.0/data

[-- Attachment #2: Type: text/html, Size: 249 bytes --]

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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-27  7:59               ` David du Colombier
@ 2013-03-27  9:18                 ` Friedrich Psiorz
  2013-03-27 14:43                   ` Richard Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Friedrich Psiorz @ 2013-03-27  9:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I think that's already partly being done, I found /srv/partfs.sdXX, I
just need to mount that. Can I do something in the kernel command line
to mount it automatically, so I can get my root fileystem from there?
Sorry, I'm still very confused by the whole boot process.

Am 27.03.2013 08:59, schrieb David du Colombier:
>> Also, the disk still doesn't show up as sdB0 or sdXX or something like
>> that in /dev; still only sdU0.0
>> Do I have to do something to make sdB0/sdXX appear?
>
> disk/partfs /dev/sdU0.0/data
>




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-27  9:18                 ` Friedrich Psiorz
@ 2013-03-27 14:43                   ` Richard Miller
  2013-03-27 17:37                     ` Richard Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Miller @ 2013-03-27 14:43 UTC (permalink / raw)
  To: 9fans

> Can I do something in the kernel command line
> to mount it automatically, so I can get my root fileystem from there?

If the command line contains 'readparts= bootargs=local!/dev/sdXX/fossil'
and the kernel is built with partfs and fossil in the bootdir section,
this should work automatically (with no need for sdB0part=).

However I've just tried this and it doesn't work for me either.  I will
investigate further...




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

* Re: [9fans] Root file system from usb-hdd on raspberry pi
  2013-03-27 14:43                   ` Richard Miller
@ 2013-03-27 17:37                     ` Richard Miller
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Miller @ 2013-03-27 17:37 UTC (permalink / raw)
  To: 9fans

> I will
> investigate further...

It turns out that usb boot is more complicated than it needs to be.  With
readparts= the partitions are set up automatically, but then they are thrown
away again, I think because partfs is being started more than once.  I will
leave it to the original authors to look at, but a workaround is to use sdB0part
as Erik suggested.  I find this cmdline.txt works for me:

sdB0part='fossil 204864 1804192' bootargs=local!/dev/sdXX/fossil ipconfig=

where the sdB0part numbers are found from 'grep fossil /dev/sdXX/ctl'




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

end of thread, other threads:[~2013-03-27 17:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 12:51 [9fans] Root file system from usb-hdd on raspberry pi Friedrich Psiorz
2013-03-26 13:07 ` erik quanstrom
2013-03-26 13:47   ` Friedrich Psiorz
2013-03-26 13:56     ` erik quanstrom
2013-03-26 14:25       ` Friedrich Psiorz
2013-03-26 14:35         ` erik quanstrom
2013-03-26 15:53           ` Friedrich Psiorz
2013-03-26 22:53             ` Friedrich Psiorz
2013-03-27  7:59               ` David du Colombier
2013-03-27  9:18                 ` Friedrich Psiorz
2013-03-27 14:43                   ` Richard Miller
2013-03-27 17:37                     ` Richard Miller

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).