[9fans] p9p venti w/ raw partitions
Is anyone running venti with raw disk partitions on Unix? I've got a
nice large disk to dedicate to it, and would like to do it without
needlessly imposing another fs, if possible, but am running into
problems. The blocker now is fmtarenas is complaining that it
"can't determine size of partition" for raw disk partitions.
Anthony
Re: [9fans] p9p venti w/ raw partitions
> Is anyone running venti with raw disk partitions on Unix? I've got a[color=blue]
> nice large disk to dedicate to it, and would like to do it without
> needlessly imposing another fs, if possible, but am running into
> problems. The blocker now is fmtarenas is complaining that it
> "can't determine size of partition" for raw disk partitions.[/color]
I've used raw disk partitions on FreeBSD recently,
and raw disk partitions on Linux a while back.
What OS are you running, and what does
9 ls -l /dev/your-disk
print? Assuming it prints a size of 0, you need to figure
out how to get the real disk size out of the kernel.
See /usr/local/plan9/src/lib9/_p9dir.c.
Russ
Re: [9fans] p9p venti w/ raw partitions
OS X. And yes, 9's ls reports size zero (as opposed to
OSX's ls "size" of "14, 12"). I'll spend a little time on
it this morning and see what i get. OS X's stat(1) can
get the info, so the hardest part might just be
figuring out which "project" Apple put the source for
stat in.
Anthony
Re: [9fans] p9p venti w/ raw partitions
On Jun 24, 2008, at 8:16 AM, [email]a@9srv.net[/email] wrote:
[color=blue]
> OS X. And yes, 9's ls reports size zero (as opposed to
> OSX's ls "size" of "14, 12"). I'll spend a little time on[/color]
These "sizes" are the major and minor device numbers.
[color=blue]
>
> it this morning and see what i get. OS X's stat(1) can
> get the info, so the hardest part might just be
> figuring out which "project" Apple put the source for
> stat in.
> Anthony
>
>[/color]
$ stat /dev/disk0
46138868 46908804 brw-r----- 1 root operator 234881024 0 "Jun 21
19:55:38 2008" "Jun 21 19:55:38 2008" "Jun 21 19:55:38 2008" "Jun 21
19:55:38 2008" 2048 0 0 /dev/disk0
$ stat -l /dev/disk0
brw-r----- 1 root operator 14,0 Jun 21 19:55:38 2008 /dev/disk0
$ stat -f '%z' /dev/disk0
0
So oh well.
Using Apple's diskutil seems to work:
$ diskutil info /dev/disk0
#...
Total Size: 232.9 Gi (250059350016 B) (488397168 512-
byte blocks)
Free Space: 0.0 B (0 B) (0 512-byte blocks)
# ...
Re: [9fans] p9p venti w/ raw partitions
I wasn't able to get this working today, but I believe I made good
progress. Unfortunately, I'm traveling all day tomorrow and will
have questionable network access while away for about a week.
I've attached my version of _p9dir.c with the OS X code in it. The
addition is pretty simple, and I tested a dummy program with
nearly the same code and it prints the real size in bytes, but
something isn't right. I rebuilt and installed lib9 and ls, but ls
still doesn't show anything useful. It may just be that I have to
rebuild something more than I have. Forwarded in the hope that
someone who's looked at p9p's guts more than I can tell me
what that might be.
Anthony
Re: [9fans] p9p venti w/ raw partitions
> something isn't right. I rebuilt and installed lib9 and ls, but ls[color=blue]
> still doesn't show anything useful. It may just be that I have to[/color]
My first guess would be that when you "installed" ls again,
there was already an o.ls in plan9/src/cmd, so it didn't
get relinked. It should suffice to do
cd $PLAN9/src/lib9
mk _p9dir
cd ../cmd
rm o.ls
mk o.ls
o.ls -l /your/dev
to test.
Russ