On Fri, 30 Dec 2005 14:40:53 -0500
Russ Cox <[EMAIL PROTECTED]> wrote:
> > I can't run fmtisect or fmtarenas directly on partition without this
> > error:
> >
> > ; sudo /usr/local/plan9/bin/venti/fmtarenas -b 8192
> > arenas0. /dev/ad2:0-10G
> > err 0: can't determine size of
> > partition /dev/ad2 /usr/local/plan9/bin/venti/fmtarenas: can't open
> > partition /dev/ad2:0-10G: can't determine size of partition /dev/ad2
> > [status 1] ;
>
> ls -l /dev/ad2 and look at the major device number.
> There is a list in src/lib9/_p9dir.c and maybe it is missing.
It seems that the major device number have change from FreeBSD 4.X to
5.X and from 5.X to 6.X . read devfs(5) and mknod(8) in the FreeBSD man.
I tried it on FreeBSD 5.4 with this modification:
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#if (__FreeBSD_version < 500000) || defined(__OpenBSD__)
static int diskdev[] = {
151, /* aacd */
116, /* ad */
157, /* ar */
118, /* afd */
133, /* amrd */
13, /* da */
102, /* fla */
109, /* idad */
95, /* md */
131, /* mlxd */
168, /* pst */
147, /* twed */
43, /* vn */
3, /* wd */
87, /* wfd */
};
#endif
#if (__FreeBSD_version >= 500000) && (__FreeBSD_version < 600000)
static int diskdev[] = {
151, /* aacd */
4, /* ad */
157, /* ar */
118, /* afd */
133, /* amrd */
13, /* da */
102, /* fla */
109, /* idad */
95, /* md */
131, /* mlxd */
168, /* pst */
147, /* twed */
43, /* vn */
3, /* wd */
87, /* wfd */
};
#endif
#if (__FreeBSD_version >= 600000)
static int diskdev[] = {
151, /* aacd */
0, /* ad */
157, /* ar */
118, /* afd */
133, /* amrd */
13, /* da */
102, /* fla */
109, /* idad */
95, /* md */
131, /* mlxd */
168, /* pst */
147, /* twed */
43, /* vn */
3, /* wd */
87, /* wfd */
};
#endif
I also made a little modification of isdisk(struct stat *st) just to
see what happened:
; -
sudo /usr/local/plan9/bin/venti/fmtarenas -b 8192 arenas0. /dev/ad2:0-10
diskdev[0] = 151
dev = 4
No Match: diskdev[0] != dev
diskdev[1] = 4
dev = 4
Match: diskdev[1] == dev
Return 1
err 0: can't determine size of partition /dev/ad2
/usr/local/plan9/bin/venti/fmtarenas: can't open
partition /dev/ad2:0-10: can't determine size of partition /dev/ad2
[status 1]
;
I have just change the value of "ad" for FreeBSD 5 and 6 because i
don't know where i should find these value for the other device.
--
GAGNON serge <[EMAIL PROTECTED]>
PGP KEY-ID: 0xBBC1478F
PGP Fingerprint: B48B 4633 28F5 28F6 7A62 5650 69C8 E293 BBC1 478F
PPG Key: http://quenix2.dyndns.org:7777 | telnet quenix2.dyndns.org 7777