From pjd at FreeBSD.org Thu Sep 3 13:57:45 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Thu Sep 3 13:57:52 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090903124407.GJ1821@garage.freebsd.pl> <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <20090903135741.GK1821@garage.freebsd.pl> On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > I'd suggest doing this not as separate gmirror(8) subcommand, but as an > > extension to 'configure' subcommand, where one can provide priority by > > giving '-p' argument. > > Except I didn't see how configure was implemented. Am I correct that this is > g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? Yes, you are correct. > On a related note, perhaps the attached can be applied so that there's no > question about the priority numbering? > -- > Mel > Index: sbin/geom/class/mirror/gmirror.8 > =================================================================== > --- sbin/geom/class/mirror/gmirror.8 (revision 196776) > +++ sbin/geom/class/mirror/gmirror.8 (working copy) > @@ -115,8 +115,8 @@ > .It Cm label > Create a mirror. > The order of components is important, because a component's priority is based on its position > -(starting from 0). > -The component with the biggest priority is used by the > +(starting from 0 to 255). > +The component with the biggest priority (the lowest number) is used by the > .Cm prefer > balance algorithm > and is also used as a master component when resynchronization is needed, Looks good. -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090903/9a6a06eb/attachment.pgp From mel.flynn+fbsd.fs at mailing.thruhere.net Fri Sep 4 08:32:16 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Fri Sep 4 08:32:24 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <20090903135741.GK1821@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090903135741.GK1821@garage.freebsd.pl> Message-ID: <200909041016.34677.mel.flynn+fbsd.fs@mailing.thruhere.net> On Thursday 03 September 2009 15:57:41 Pawel Jakub Dawidek wrote: > On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > > I'd suggest doing this not as separate gmirror(8) subcommand, but as an > > > extension to 'configure' subcommand, where one can provide priority by > > > giving '-p' argument. > > > > Except I didn't see how configure was implemented. Am I correct that this > > is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > > Yes, you are correct. Ok, new patch. I gathered from configure_slice, that my assumption was about flag handling is correct. Patch is only compile tested. -- Mel -------------- next part -------------- Index: sbin/geom/class/mirror/geom_mirror.c =================================================================== --- sbin/geom/class/mirror/geom_mirror.c (revision 196803) +++ sbin/geom/class/mirror/geom_mirror.c (working copy) @@ -47,7 +47,7 @@ static char label_balance[] = "split", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; -static intmax_t insert_priority = 0; +static intmax_t insert_priority = 0, configure_priority = -1; static void mirror_main(struct gctl_req *req, unsigned flags); static void mirror_activate(struct gctl_req *req); @@ -71,10 +71,11 @@ { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name" + NULL, "[-adfFhnv] [-b balance] [-s slice] [-p prio] name [prov]" }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." Index: sbin/geom/class/mirror/gmirror.8 =================================================================== --- sbin/geom/class/mirror/gmirror.8 (revision 196803) +++ sbin/geom/class/mirror/gmirror.8 (working copy) @@ -47,7 +47,9 @@ .Op Fl adfFhnv .Op Fl b Ar balance .Op Fl s Ar slice +.Op Fl p Ar priority .Ar name +.Op Ar prov .Nm .Cm rebuild .Op Fl v @@ -115,8 +117,8 @@ .It Cm label Create a mirror. The order of components is important, because a component's priority is based on its position -(starting from 0). -The component with the biggest priority is used by the +(starting from 0 to 255). +The component with the biggest priority (the lowest number) is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, @@ -175,6 +177,9 @@ Hardcode providers' names in metadata. .It Fl n Turn off autosynchronization of stale components. +.It Fl p Ar priority +Specify priority for given +.Ar prov .It Fl s Ar slice Specifies slice size for .Cm split Index: sys/geom/mirror/g_mirror_ctl.c =================================================================== --- sys/geom/mirror/g_mirror_ctl.c (revision 196803) +++ sys/geom/mirror/g_mirror_ctl.c (working copy) @@ -93,12 +93,12 @@ { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - const char *name, *balancep; + const char *name, *balancep, *prov; intmax_t *slicep; uint32_t slice; uint8_t balance; int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; - int *nargs, do_sync = 0, dirty = 1; + int *nargs, *priority, do_sync = 0, dirty = 1, do_priority = 0; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -149,6 +149,27 @@ gctl_error(req, "No '%s' argument.", "dynamic"); return; } + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); + if (priority == NULL ) { + gctl_error(req, "No '%s' argument.", "priority"); + return; + } + if( *priority < -1 || *priority > 255 ) { + gctl_error(req, "Priority range is 0 to 255, %i given", + *priority); + return; + } + /* Since we have a priority, we also need a provider now. + * Note: be WARNS safe, by always assigning prov and only throw an + * error if *priority != -1. */ + prov = gctl_get_asciiparam(req, "arg1"); + if( *priority > -1 ) { + if( prov == NULL ) { + gctl_error(req, "Priority needs a disk name"); + return; + } + do_priority = 1; + } if (*autosync && *noautosync) { gctl_error(req, "'%s' and '%s' specified.", "autosync", "noautosync"); @@ -233,6 +254,11 @@ disk->d_flags &= ~G_MIRROR_DISK_FLAG_HARDCODED; if (!dirty) disk->d_flags &= ~G_MIRROR_DISK_FLAG_DIRTY; + if (do_priority) { + if (strcmp(disk->d_name, prov) == 0) { + disk->d_priority = *priority; + } + } g_mirror_update_metadata(disk); if (do_sync) { if (disk->d_state == G_MIRROR_DISK_STATE_STALE) { From pjd at FreeBSD.org Sat Sep 5 09:11:41 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Sat Sep 5 09:11:48 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909041016.34677.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090903135741.GK1821@garage.freebsd.pl> <200909041016.34677.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <20090905091030.GC1665@garage.freebsd.pl> On Fri, Sep 04, 2009 at 10:16:34AM +0200, Mel Flynn wrote: > On Thursday 03 September 2009 15:57:41 Pawel Jakub Dawidek wrote: > > On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > > > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > > > I'd suggest doing this not as separate gmirror(8) subcommand, but as an > > > > extension to 'configure' subcommand, where one can provide priority by > > > > giving '-p' argument. > > > > > > Except I didn't see how configure was implemented. Am I correct that this > > > is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > > > > Yes, you are correct. > > Ok, new patch. I gathered from configure_slice, that my assumption was about > flag handling is correct. Patch is only compile tested. In general the patch looks good, although I haven't tested it yet. I do have some comments though. > Index: sbin/geom/class/mirror/geom_mirror.c > =================================================================== > --- sbin/geom/class/mirror/geom_mirror.c (revision 196803) > +++ sbin/geom/class/mirror/geom_mirror.c (working copy) > @@ -47,7 +47,7 @@ > > static char label_balance[] = "split", configure_balance[] = "none"; > static intmax_t label_slice = 4096, configure_slice = -1; > -static intmax_t insert_priority = 0; > +static intmax_t insert_priority = 0, configure_priority = -1; > > static void mirror_main(struct gctl_req *req, unsigned flags); > static void mirror_activate(struct gctl_req *req); > @@ -71,10 +71,11 @@ > { 'F', "nofailsync", NULL, G_TYPE_BOOL }, > { 'h', "hardcode", NULL, G_TYPE_BOOL }, > { 'n', "noautosync", NULL, G_TYPE_BOOL }, > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > { 's', "slice", &configure_slice, G_TYPE_NUMBER }, > G_OPT_SENTINEL > }, > - NULL, "[-adfFhnv] [-b balance] [-s slice] name" > + NULL, "[-adfFhnv] [-b balance] [-s slice] [-p prio] name [prov]" Style, extra space before '[-p prio]'. I also wonder if something like this should be possible: # gmirror configure -b round-robin -p 1 gm0 da0 In you current implementation it will change balance algorithm for all the providers and in addition priority of da0 provider. This doesn't look clear for my taste (will balance algorithm be changed on da0 only or on all providers?). I'd prefer: gmirror configure [-adfFhnv] [-b balance] [-s slice] name gmirror configure -p prio name prov Although I'm not sure if the infrastructure can actually print two usage patterns. > +.It Fl p Ar priority > +Specify priority for given > +.Ar prov s/for given/for the given/ ? > Index: sys/geom/mirror/g_mirror_ctl.c > =================================================================== > --- sys/geom/mirror/g_mirror_ctl.c (revision 196803) > +++ sys/geom/mirror/g_mirror_ctl.c (working copy) > @@ -93,12 +93,12 @@ > { > struct g_mirror_softc *sc; > struct g_mirror_disk *disk; > - const char *name, *balancep; > + const char *name, *balancep, *prov; > intmax_t *slicep; > uint32_t slice; > uint8_t balance; > int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; > - int *nargs, do_sync = 0, dirty = 1; > + int *nargs, *priority, do_sync = 0, dirty = 1, do_priority = 0; > > nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); > if (nargs == NULL) { > @@ -149,6 +149,27 @@ > gctl_error(req, "No '%s' argument.", "dynamic"); > return; > } > + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); > + if (priority == NULL ) { Style, extra space after NULL. > + gctl_error(req, "No '%s' argument.", "priority"); > + return; > + } > + if( *priority < -1 || *priority > 255 ) { Style, should be: if (*priority < -1 || *priority > 255) { > + gctl_error(req, "Priority range is 0 to 255, %i given", > + *priority); > + return; > + } > + /* Since we have a priority, we also need a provider now. > + * Note: be WARNS safe, by always assigning prov and only throw an > + * error if *priority != -1. */ Style, multi-line comment should look like this: /* * Since we have a priority, we also need a provider now. * Note: be WARNS safe, by always assigning prov and only throw an * error if *priority != -1. */ > + prov = gctl_get_asciiparam(req, "arg1"); > + if( *priority > -1 ) { Style: if (*priority > -1) { > + if( prov == NULL ) { Style: if (prov == NULL) { > + gctl_error(req, "Priority needs a disk name"); > + return; > + } > + do_priority = 1; > + } > if (*autosync && *noautosync) { > gctl_error(req, "'%s' and '%s' specified.", "autosync", > "noautosync"); > @@ -233,6 +254,11 @@ > disk->d_flags &= ~G_MIRROR_DISK_FLAG_HARDCODED; > if (!dirty) > disk->d_flags &= ~G_MIRROR_DISK_FLAG_DIRTY; > + if (do_priority) { > + if (strcmp(disk->d_name, prov) == 0) { > + disk->d_priority = *priority; > + } Style, you can drop { } here: if (strcmp(disk->d_name, prov) == 0) disk->d_priority = *priority; > + } > g_mirror_update_metadata(disk); > if (do_sync) { > if (disk->d_state == G_MIRROR_DISK_STATE_STALE) { Other than those small style issues good job. Now we just have to decide about mixing per-mirror options with per-provider options. -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090905/abba6ecf/attachment.pgp From mel.flynn+fbsd.fs at mailing.thruhere.net Sat Sep 5 19:11:33 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Sat Sep 5 19:11:41 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <20090905091030.GC1665@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909041016.34677.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905091030.GC1665@garage.freebsd.pl> Message-ID: <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> Hi Pawel, I'll post-process in the future. I'm so used to if( cond ), cause it allows me to more easily spot the outer bounds of the condition, it's hard to conform to style(9) for me. :) On Saturday 05 September 2009 11:10:30 Pawel Jakub Dawidek wrote: > On Fri, Sep 04, 2009 at 10:16:34AM +0200, Mel Flynn wrote: > > On Thursday 03 September 2009 15:57:41 Pawel Jakub Dawidek wrote: > > > On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > > > > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > > > > I'd suggest doing this not as separate gmirror(8) subcommand, but > > > > > as an extension to 'configure' subcommand, where one can provide > > > > > priority by giving '-p' argument. > > > > > > > > Except I didn't see how configure was implemented. Am I correct that > > > > this is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > > > > > > Yes, you are correct. > > > > Ok, new patch. I gathered from configure_slice, that my assumption was > > about flag handling is correct. Patch is only compile tested. > > In general the patch looks good, although I haven't tested it yet. I do > have some comments though. > > > Index: sbin/geom/class/mirror/geom_mirror.c > > =================================================================== > > --- sbin/geom/class/mirror/geom_mirror.c (revision 196803) > > +++ sbin/geom/class/mirror/geom_mirror.c (working copy) > > @@ -47,7 +47,7 @@ > > > > static char label_balance[] = "split", configure_balance[] = "none"; > > static intmax_t label_slice = 4096, configure_slice = -1; > > -static intmax_t insert_priority = 0; > > +static intmax_t insert_priority = 0, configure_priority = -1; > > > > static void mirror_main(struct gctl_req *req, unsigned flags); > > static void mirror_activate(struct gctl_req *req); > > @@ -71,10 +71,11 @@ > > { 'F', "nofailsync", NULL, G_TYPE_BOOL }, > > { 'h', "hardcode", NULL, G_TYPE_BOOL }, > > { 'n', "noautosync", NULL, G_TYPE_BOOL }, > > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > > { 's', "slice", &configure_slice, G_TYPE_NUMBER }, > > G_OPT_SENTINEL > > }, > > - NULL, "[-adfFhnv] [-b balance] [-s slice] name" > > + NULL, "[-adfFhnv] [-b balance] [-s slice] [-p prio] name [prov]" > > Style, extra space before '[-p prio]'. > > I also wonder if something like this should be possible: > > # gmirror configure -b round-robin -p 1 gm0 da0 > > In you current implementation it will change balance algorithm for all > the providers and in addition priority of da0 provider. This doesn't > look clear for my taste (will balance algorithm be changed on da0 only > or on all providers?). Right, I found it convenient, but now that I think it about it, it's confusing from user perspective. > I'd prefer: > > gmirror configure [-adfFhnv] [-b balance] [-s slice] name > gmirror configure -p prio name prov > > Although I'm not sure if the infrastructure can actually print two usage > patterns. I tried two g_command structs for the same command, like so: @@ -76,6 +76,13 @@ }, NULL, "[-adfFhnv] [-b balance] [-s slice] name" }, + { "configure", G_FLAG_VERBOSE, NULL, + { + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + NULL, "-p prio name prov" + }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." }, But it errors if -p is given with illegal option, so either g_command needs to grow a second usage string, we need to do something like below, or we care less about usage and more about the man page. @@ -71,10 +71,12 @@ { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name" + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" + " gmirror configure -p priority name prov" }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." Fixing style issues now and reimplementing. -- Mel From pjd at FreeBSD.org Sat Sep 5 19:23:08 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Sat Sep 5 19:23:15 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909041016.34677.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905091030.GC1665@garage.freebsd.pl> <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <20090905192251.GJ1665@garage.freebsd.pl> On Sat, Sep 05, 2009 at 09:11:27PM +0200, Mel Flynn wrote: > Hi Pawel, > > I'll post-process in the future. I'm so used to if( cond ), cause it allows me > to more easily spot the outer bounds of the condition, it's hard to conform to > style(9) for me. :) > > On Saturday 05 September 2009 11:10:30 Pawel Jakub Dawidek wrote: > > On Fri, Sep 04, 2009 at 10:16:34AM +0200, Mel Flynn wrote: > > > On Thursday 03 September 2009 15:57:41 Pawel Jakub Dawidek wrote: > > > > On Thu, Sep 03, 2009 at 03:48:37PM +0200, Mel Flynn wrote: > > > > > On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > > > > > > I'd suggest doing this not as separate gmirror(8) subcommand, but > > > > > > as an extension to 'configure' subcommand, where one can provide > > > > > > priority by giving '-p' argument. > > > > > > > > > > Except I didn't see how configure was implemented. Am I correct that > > > > > this is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > > > > > > > > Yes, you are correct. > > > > > > Ok, new patch. I gathered from configure_slice, that my assumption was > > > about flag handling is correct. Patch is only compile tested. > > > > In general the patch looks good, although I haven't tested it yet. I do > > have some comments though. > > > > > Index: sbin/geom/class/mirror/geom_mirror.c > > > =================================================================== > > > --- sbin/geom/class/mirror/geom_mirror.c (revision 196803) > > > +++ sbin/geom/class/mirror/geom_mirror.c (working copy) > > > @@ -47,7 +47,7 @@ > > > > > > static char label_balance[] = "split", configure_balance[] = "none"; > > > static intmax_t label_slice = 4096, configure_slice = -1; > > > -static intmax_t insert_priority = 0; > > > +static intmax_t insert_priority = 0, configure_priority = -1; > > > > > > static void mirror_main(struct gctl_req *req, unsigned flags); > > > static void mirror_activate(struct gctl_req *req); > > > @@ -71,10 +71,11 @@ > > > { 'F', "nofailsync", NULL, G_TYPE_BOOL }, > > > { 'h', "hardcode", NULL, G_TYPE_BOOL }, > > > { 'n', "noautosync", NULL, G_TYPE_BOOL }, > > > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > > > { 's', "slice", &configure_slice, G_TYPE_NUMBER }, > > > G_OPT_SENTINEL > > > }, > > > - NULL, "[-adfFhnv] [-b balance] [-s slice] name" > > > + NULL, "[-adfFhnv] [-b balance] [-s slice] [-p prio] name [prov]" > > > > Style, extra space before '[-p prio]'. > > > > I also wonder if something like this should be possible: > > > > # gmirror configure -b round-robin -p 1 gm0 da0 > > > > In you current implementation it will change balance algorithm for all > > the providers and in addition priority of da0 provider. This doesn't > > look clear for my taste (will balance algorithm be changed on da0 only > > or on all providers?). > > Right, I found it convenient, but now that I think it about it, it's confusing > from user perspective. > > > I'd prefer: > > > > gmirror configure [-adfFhnv] [-b balance] [-s slice] name > > gmirror configure -p prio name prov > > > > Although I'm not sure if the infrastructure can actually print two usage > > patterns. > > I tried two g_command structs for the same command, like so: > @@ -76,6 +76,13 @@ > }, > NULL, "[-adfFhnv] [-b balance] [-s slice] name" > }, > + { "configure", G_FLAG_VERBOSE, NULL, > + { > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > + G_OPT_SENTINEL > + }, > + NULL, "-p prio name prov" > + }, > { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, > "[-v] name prov ..." > }, > > But it errors if -p is given with illegal option, so either g_command needs to > grow a second usage string, we need to do something like below, or we care > less about usage and more about the man page. > > @@ -71,10 +71,12 @@ > { 'F', "nofailsync", NULL, G_TYPE_BOOL }, > { 'h', "hardcode", NULL, G_TYPE_BOOL }, > { 'n', "noautosync", NULL, G_TYPE_BOOL }, > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > { 's', "slice", &configure_slice, G_TYPE_NUMBER }, > G_OPT_SENTINEL > }, > - NULL, "[-adfFhnv] [-b balance] [-s slice] name" > + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" > + " gmirror configure -p priority name prov" We could also do the following: NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" "-p priority name prov" And tech core geom(8) utility to split usage based on \n. usage_command() function from sbin/geom/core/geom.c would have to be modified. If you agree with this idea, would you also like to work on this? -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090905/6e2fc844/attachment.pgp From mel.flynn+fbsd.fs at mailing.thruhere.net Sat Sep 5 20:25:09 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Sat Sep 5 20:25:24 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <20090905192251.GJ1665@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905192251.GJ1665@garage.freebsd.pl> Message-ID: <200909052225.06185.mel.flynn+fbsd.fs@mailing.thruhere.net> On Saturday 05 September 2009 21:22:51 Pawel Jakub Dawidek wrote: > And tech core geom(8) utility to split usage based on \n. > usage_command() function from sbin/geom/core/geom.c would have to be > modified. If you agree with this idea, would you also like to work on > this? Yes and see attached. Since utility exists after displaying usage, I didn't take the trouble of freeing ptr, but if this is preferred then I'll add the line. % geom mirror foo geom: Unknown command: foo. usage: geom mirror activate [-v] name prov ... geom mirror clear [-v] prov ... geom mirror configure[-adfFhnv] [-b balance] [-s slice] name geom mirror configure -p priority name prov -- Mel -------------- next part -------------- Index: sbin/geom/core/geom.c =================================================================== --- sbin/geom/core/geom.c (revision 196868) +++ sbin/geom/core/geom.c (working copy) @@ -98,11 +98,23 @@ struct g_option *opt; unsigned i; - fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); if (cmd->gc_usage != NULL) { - fprintf(stderr, " %s\n", cmd->gc_usage); + char *pos, *ptr; + + ptr = strdup(cmd->gc_usage); + while ((pos = strchr(ptr, '\n')) != NULL) { + *pos = '\0'; + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); + fprintf(stderr, "%s\n", ptr); + ptr = pos + 1; + } + /* Tail or no \n at all */ + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); + fprintf(stderr, " %s\n", ptr); return; } + + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) fprintf(stderr, " [-v]"); for (i = 0; ; i++) { From pjd at FreeBSD.org Sat Sep 5 20:36:00 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Sat Sep 5 20:36:07 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909052225.06185.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905192251.GJ1665@garage.freebsd.pl> <200909052225.06185.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <20090905203551.GK1665@garage.freebsd.pl> On Sat, Sep 05, 2009 at 10:25:05PM +0200, Mel Flynn wrote: > On Saturday 05 September 2009 21:22:51 Pawel Jakub Dawidek wrote: > > > And tech core geom(8) utility to split usage based on \n. > > usage_command() function from sbin/geom/core/geom.c would have to be > > modified. If you agree with this idea, would you also like to work on > > this? > > Yes and see attached. Since utility exists after displaying usage, I didn't > take the trouble of freeing ptr, but if this is preferred then I'll add the > line. I think it would be good to free memory just to make it elegant. > % geom mirror foo > geom: Unknown command: foo. > usage: geom mirror activate [-v] name prov ... > geom mirror clear [-v] prov ... > geom mirror configure[-adfFhnv] [-b balance] [-s slice] name > geom mirror configure -p priority name prov > > -- > Mel > Index: sbin/geom/core/geom.c > =================================================================== > --- sbin/geom/core/geom.c (revision 196868) > +++ sbin/geom/core/geom.c (working copy) > @@ -98,11 +98,23 @@ > struct g_option *opt; > unsigned i; > > - fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > if (cmd->gc_usage != NULL) { > - fprintf(stderr, " %s\n", cmd->gc_usage); > + char *pos, *ptr; > + > + ptr = strdup(cmd->gc_usage); > + while ((pos = strchr(ptr, '\n')) != NULL) { Wouldn't it be easier to use strsep(3)? > + *pos = '\0'; > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > + fprintf(stderr, "%s\n", ptr); Why to split this into two fprintfs? There is also space missing before %s. > + ptr = pos + 1; > + } > + /* Tail or no \n at all */ > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > + fprintf(stderr, " %s\n", ptr); > return; > } > + > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) > fprintf(stderr, " [-v]"); > for (i = 0; ; i++) { With strsep(3) it would look like this: if (cmd->gc_usage != NULL) { char *cur, *ptr, *tofree; tofree = ptr = strdup(cmd->gc_usage); while ((cur = strsep(&ptr, "\n")) != NULL) { if (*cur == '\0') continue; fprintf(stderr, "%s %s %s %s\n", prefix, comm, cmd->gc_name, cur); } free(tofree); return; } -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090905/f1631f7e/attachment.pgp From mel.flynn+fbsd.fs at mailing.thruhere.net Sun Sep 6 00:36:16 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Sun Sep 6 00:36:27 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <20090905192251.GJ1665@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905192251.GJ1665@garage.freebsd.pl> Message-ID: <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> Hi, new patch containing everything and points for elegance. Double checked for style, so I'm sure there's one or two left ;). Since it's applies nearly clean (1 hunk -6 lines offset) on 7-STABLE, I can runtime test it tomorrow (tonight is lvl 0 backup). -- Mel -------------- next part -------------- Index: sys/geom/mirror/g_mirror_ctl.c =================================================================== --- sys/geom/mirror/g_mirror_ctl.c (revision 196868) +++ sys/geom/mirror/g_mirror_ctl.c (working copy) @@ -93,12 +93,12 @@ { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - const char *name, *balancep; + const char *name, *balancep, *prov; intmax_t *slicep; uint32_t slice; uint8_t balance; int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; - int *nargs, do_sync = 0, dirty = 1; + int *nargs, *priority, do_sync = 0, dirty = 1, do_priority = 0; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -149,6 +149,29 @@ gctl_error(req, "No '%s' argument.", "dynamic"); return; } + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); + if (priority == NULL) { + gctl_error(req, "No '%s' argument.", "priority"); + return; + } + if (*priority < -1 || *priority > 255) { + gctl_error(req, "Priority range is 0 to 255, %i given", + *priority); + return; + } + /* + * Since we have a priority, we also need a provider now. + * Note: be WARNS safe, by always assigning prov and only throw an + * error if *priority != -1. + */ + prov = gctl_get_asciiparam(req, "arg1"); + if (*priority > -1) { + if (prov == NULL) { + gctl_error(req, "Priority needs a disk name"); + return; + } + do_priority = 1; + } if (*autosync && *noautosync) { gctl_error(req, "'%s' and '%s' specified.", "autosync", "noautosync"); @@ -189,6 +212,14 @@ slice = sc->sc_slice; else slice = *slicep; + /* Enforce usage() of -p not allowing any other options */ + if (do_priority && (*autosync || *noautosync || *failsync || + *nofailsync || *hardcode || *dynamic || *slicep != -1 || + (strcmp(balancep, "none")))) { + gctl_error(req, "only -p accepted when setting priority"); + sx_xunlock(&sc->sc_lock); + return; + } if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { sx_xunlock(&sc->sc_lock); gctl_error(req, "Not all disks connected. Try 'forget' command " @@ -197,7 +228,7 @@ } if (sc->sc_balance == balance && sc->sc_slice == slice && !*autosync && !*noautosync && !*failsync && !*nofailsync && !*hardcode && - !*dynamic) { + !*dynamic && !do_priority) { sx_xunlock(&sc->sc_lock); gctl_error(req, "Nothing has changed."); return; @@ -223,6 +254,19 @@ } } LIST_FOREACH(disk, &sc->sc_disks, d_next) { + /* + * Handle priority first, since we only need one disk, do one + * operation on it and then we're done. No need to check other + * flags, as usage doesn't allow it. + */ + if (do_priority) { + if (strcmp(disk->d_name, prov) == 0) { + disk->d_priority = *priority; + g_mirror_update_metadata(disk); + break; + } + continue; + } if (do_sync) { if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; Index: sbin/geom/core/geom.c =================================================================== --- sbin/geom/core/geom.c (revision 196868) +++ sbin/geom/core/geom.c (working copy) @@ -98,11 +98,25 @@ struct g_option *opt; unsigned i; - fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); if (cmd->gc_usage != NULL) { - fprintf(stderr, " %s\n", cmd->gc_usage); + char *pos, *ptr, *sptr; + + ptr = strdup(cmd->gc_usage); + sptr = ptr; + while ((pos = strchr(ptr, '\n')) != NULL) { + *pos = '\0'; + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); + fprintf(stderr, "%s\n", ptr); + ptr = pos + 1; + } + /* Tail or no \n at all */ + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); + fprintf(stderr, " %s\n", ptr); + free(sptr); return; } + + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) fprintf(stderr, " [-v]"); for (i = 0; ; i++) { Index: sbin/geom/class/mirror/geom_mirror.c =================================================================== --- sbin/geom/class/mirror/geom_mirror.c (revision 196868) +++ sbin/geom/class/mirror/geom_mirror.c (working copy) @@ -47,7 +47,7 @@ static char label_balance[] = "split", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; -static intmax_t insert_priority = 0; +static intmax_t insert_priority = 0, configure_priority = -1; static void mirror_main(struct gctl_req *req, unsigned flags); static void mirror_activate(struct gctl_req *req); @@ -71,10 +71,12 @@ { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name" + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" + "-p priority name prov" }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." Index: sbin/geom/class/mirror/gmirror.8 =================================================================== --- sbin/geom/class/mirror/gmirror.8 (revision 196868) +++ sbin/geom/class/mirror/gmirror.8 (working copy) @@ -49,6 +49,12 @@ .Op Fl s Ar slice .Ar name .Nm +.Cm configure +.Op Fl v +.Fl p Ar priority +.Ar name +.Ar prov +.Nm .Cm rebuild .Op Fl v .Ar name @@ -115,8 +121,8 @@ .It Cm label Create a mirror. The order of components is important, because a component's priority is based on its position -(starting from 0). -The component with the biggest priority is used by the +(starting from 0 to 255). +The component with the biggest priority (the lowest number) is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, @@ -175,6 +181,9 @@ Hardcode providers' names in metadata. .It Fl n Turn off autosynchronization of stale components. +.It Fl p Ar priority +Specifies priority for the given component +.Ar prov . .It Fl s Ar slice Specifies slice size for .Cm split From mel.flynn+fbsd.fs at mailing.thruhere.net Sun Sep 6 00:56:07 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Sun Sep 6 00:56:13 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905192251.GJ1665@garage.freebsd.pl> <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <200909060256.04013.mel.flynn+fbsd.fs@mailing.thruhere.net> On Sunday 06 September 2009 02:36:10 Mel Flynn wrote: > Hi, > > new patch containing everything and points for elegance. Double checked for > style, so I'm sure there's one or two left ;). > > Since it's applies nearly clean (1 hunk -6 lines offset) on 7-STABLE, I can > runtime test it tomorrow (tonight is lvl 0 backup). Ack, totally missed your strsep comments, strike this one and yes I should've used that. Will redo when it's not 3am in the morning anymore. ;) -- Mel From pjd at FreeBSD.org Sun Sep 6 06:52:25 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Sun Sep 6 06:52:37 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909052111.27667.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090905192251.GJ1665@garage.freebsd.pl> <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> Message-ID: <20090906065217.GL1665@garage.freebsd.pl> On Sun, Sep 06, 2009 at 02:36:10AM +0200, Mel Flynn wrote: > Hi, > > new patch containing everything and points for elegance. Double checked for > style, so I'm sure there's one or two left ;). Yeah:) I'll fixed what's left by myself and tested it. With few little changes it works fine, good job. Below, for the record, you can find what I changed. Patch committed. > Since it's applies nearly clean (1 hunk -6 lines offset) on 7-STABLE, I can > runtime test it tomorrow (tonight is lvl 0 backup). > Index: sys/geom/mirror/g_mirror_ctl.c > =================================================================== > --- sys/geom/mirror/g_mirror_ctl.c (revision 196868) > +++ sys/geom/mirror/g_mirror_ctl.c (working copy) > @@ -93,12 +93,12 @@ > { > struct g_mirror_softc *sc; > struct g_mirror_disk *disk; > - const char *name, *balancep; > + const char *name, *balancep, *prov; > intmax_t *slicep; > uint32_t slice; > uint8_t balance; > int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; > - int *nargs, do_sync = 0, dirty = 1; > + int *nargs, *priority, do_sync = 0, dirty = 1, do_priority = 0; priority should be 'intmax_t *' here. > nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); > if (nargs == NULL) { We need to accept 1 or 2 arguments few lines below. > @@ -149,6 +149,29 @@ > gctl_error(req, "No '%s' argument.", "dynamic"); > return; > } > + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); > + if (priority == NULL) { > + gctl_error(req, "No '%s' argument.", "priority"); > + return; > + } > + if (*priority < -1 || *priority > 255) { > + gctl_error(req, "Priority range is 0 to 255, %i given", %d instead of %i for consistency. > + *priority); > + return; > + } > + /* > + * Since we have a priority, we also need a provider now. > + * Note: be WARNS safe, by always assigning prov and only throw an > + * error if *priority != -1. > + */ > + prov = gctl_get_asciiparam(req, "arg1"); > + if (*priority > -1) { > + if (prov == NULL) { > + gctl_error(req, "Priority needs a disk name"); > + return; > + } > + do_priority = 1; > + } > if (*autosync && *noautosync) { > gctl_error(req, "'%s' and '%s' specified.", "autosync", > "noautosync"); > @@ -189,6 +212,14 @@ > slice = sc->sc_slice; > else > slice = *slicep; > + /* Enforce usage() of -p not allowing any other options */ Missing '.' at the end of the sentence. > + if (do_priority && (*autosync || *noautosync || *failsync || > + *nofailsync || *hardcode || *dynamic || *slicep != -1 || > + (strcmp(balancep, "none")))) { One tab too much. strcmp() returns int, not bool, so we have to check it against 0. Extra () around strcmp(). > + gctl_error(req, "only -p accepted when setting priority"); > + sx_xunlock(&sc->sc_lock); There's no need to hold the lock during gctl_error(). > + return; > + } > if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { > sx_xunlock(&sc->sc_lock); > gctl_error(req, "Not all disks connected. Try 'forget' command " > @@ -197,7 +228,7 @@ > } > if (sc->sc_balance == balance && sc->sc_slice == slice && !*autosync && > !*noautosync && !*failsync && !*nofailsync && !*hardcode && > - !*dynamic) { > + !*dynamic && !do_priority) { > sx_xunlock(&sc->sc_lock); > gctl_error(req, "Nothing has changed."); > return; I also added the following check: if ((!do_priority && *nargs != 1) || (do_priority && *nargs != 2)) { sx_xunlock(&sc->sc_lock); gctl_error(req, "Invalid number of arguments."); return; } > @@ -223,6 +254,19 @@ > } > } > LIST_FOREACH(disk, &sc->sc_disks, d_next) { > + /* > + * Handle priority first, since we only need one disk, do one > + * operation on it and then we're done. No need to check other > + * flags, as usage doesn't allow it. > + */ > + if (do_priority) { > + if (strcmp(disk->d_name, prov) == 0) { > + disk->d_priority = *priority; > + g_mirror_update_metadata(disk); > + break; > + } To be consistent with other option I changed it to: if (strcmp(disk->d_name, prov) == 0) { if (disk->d_priority == *priority) gctl_error(req, "Nothing has changed."); else { disk->d_priority = *priority; g_mirror_update_metadata(disk); } break; } > + continue; > + } > if (do_sync) { > if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) > disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; > Index: sbin/geom/core/geom.c > =================================================================== > --- sbin/geom/core/geom.c (revision 196868) > +++ sbin/geom/core/geom.c (working copy) > @@ -98,11 +98,25 @@ > struct g_option *opt; > unsigned i; > > - fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > if (cmd->gc_usage != NULL) { > - fprintf(stderr, " %s\n", cmd->gc_usage); > + char *pos, *ptr, *sptr; > + > + ptr = strdup(cmd->gc_usage); > + sptr = ptr; > + while ((pos = strchr(ptr, '\n')) != NULL) { > + *pos = '\0'; > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > + fprintf(stderr, "%s\n", ptr); We need a space between cmd->gc_name and ptr here. > + ptr = pos + 1; > + } > + /* Tail or no \n at all */ > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > + fprintf(stderr, " %s\n", ptr); > + free(sptr); I went with strsep(3) version I proposed, I think you missed it. > return; > } > + > + fprintf(stderr, "%s %s %s", prefix, comm, cmd->gc_name); > if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) > fprintf(stderr, " [-v]"); > for (i = 0; ; i++) { > Index: sbin/geom/class/mirror/geom_mirror.c > =================================================================== > --- sbin/geom/class/mirror/geom_mirror.c (revision 196868) > +++ sbin/geom/class/mirror/geom_mirror.c (working copy) > @@ -47,7 +47,7 @@ > > static char label_balance[] = "split", configure_balance[] = "none"; > static intmax_t label_slice = 4096, configure_slice = -1; > -static intmax_t insert_priority = 0; > +static intmax_t insert_priority = 0, configure_priority = -1; > > static void mirror_main(struct gctl_req *req, unsigned flags); > static void mirror_activate(struct gctl_req *req); > @@ -71,10 +71,12 @@ > { 'F', "nofailsync", NULL, G_TYPE_BOOL }, > { 'h', "hardcode", NULL, G_TYPE_BOOL }, > { 'n', "noautosync", NULL, G_TYPE_BOOL }, > + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, > { 's', "slice", &configure_slice, G_TYPE_NUMBER }, > G_OPT_SENTINEL > }, > - NULL, "[-adfFhnv] [-b balance] [-s slice] name" > + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" > + "-p priority name prov" I added '[-v]' here as it i a valid option. > }, > { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, > "[-v] name prov ..." > Index: sbin/geom/class/mirror/gmirror.8 > =================================================================== > --- sbin/geom/class/mirror/gmirror.8 (revision 196868) > +++ sbin/geom/class/mirror/gmirror.8 (working copy) > @@ -49,6 +49,12 @@ > .Op Fl s Ar slice > .Ar name > .Nm > +.Cm configure > +.Op Fl v > +.Fl p Ar priority > +.Ar name > +.Ar prov > +.Nm > .Cm rebuild > .Op Fl v > .Ar name > @@ -115,8 +121,8 @@ > .It Cm label > Create a mirror. > The order of components is important, because a component's priority is based on its position > -(starting from 0). > -The component with the biggest priority is used by the > +(starting from 0 to 255). > +The component with the biggest priority (the lowest number) is used by the > .Cm prefer > balance algorithm > and is also used as a master component when resynchronization is needed, > @@ -175,6 +181,9 @@ We also need: -.Bl -tag -width ".Fl b Ar balance" +.Bl -tag -width ".Fl p Ar priority" > Hardcode providers' names in metadata. > .It Fl n > Turn off autosynchronization of stale components. > +.It Fl p Ar priority > +Specifies priority for the given component > +.Ar prov . > .It Fl s Ar slice > Specifies slice size for > .Cm split -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090906/2355b9f4/attachment.pgp From mel.flynn+fbsd.fs at mailing.thruhere.net Sun Sep 6 08:17:10 2009 From: mel.flynn+fbsd.fs at mailing.thruhere.net (Mel Flynn) Date: Sun Sep 6 08:17:16 2009 Subject: Patch to allow gmirror to set priority of a disk In-Reply-To: <20090906065217.GL1665@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <200909060236.11224.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090906065217.GL1665@garage.freebsd.pl> Message-ID: <200909061017.05990.mel.flynn+fbsd.fs@mailing.thruhere.net> On Sunday 06 September 2009 08:52:17 you wrote: > On Sun, Sep 06, 2009 at 02:36:10AM +0200, Mel Flynn wrote: > > Hi, > > > > new patch containing everything and points for elegance. Double checked > > for style, so I'm sure there's one or two left ;). > > Yeah:) I'll fixed what's left by myself and tested it. With few little > changes it works fine, good job. Below, for the record, you can find > what I changed. Patch committed. Thank you very much! And now you got me thinking about allowing and enforcing two usage patterns of the same command in the core geom, so that the enforcement can be stripped out of command implementations. But I'll leave that for a time when this is not the only consumer of that logic. This has nonetheless been a welcome learning experience. -- Mel From bugmaster at FreeBSD.org Mon Sep 7 11:07:00 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 7 11:08:24 2009 Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org Message-ID: <200909071106.n87B6x9o010229@freefall.freebsd.org> Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used f kern/126902 geom [geom] geom_label: kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s f kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123630 geom [patch] [gmirror] gmirror doesnt allow the original dr o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/120021 geom [geom] [panic] net-p2p/qbittorrent crashes system when o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 52 problems total. From pjd at FreeBSD.org Mon Sep 7 19:32:26 2009 From: pjd at FreeBSD.org (pjd@FreeBSD.org) Date: Mon Sep 7 19:32:43 2009 Subject: kern/123630: [patch] [gmirror] gmirror doesnt allow the original drive to be preferred Message-ID: <200909071932.n87JWQLK037044@freefall.freebsd.org> Synopsis: [patch] [gmirror] gmirror doesnt allow the original drive to be preferred State-Changed-From-To: open->closed State-Changed-By: pjd State-Changed-When: pon 7 wrz 2009 19:31:11 UTC State-Changed-Why: It is now possible to change components priority which should fix the problem you described. You can also always stop the mirror and relabel it. Responsible-Changed-From-To: freebsd-geom->pjd Responsible-Changed-By: pjd Responsible-Changed-When: pon 7 wrz 2009 19:31:11 UTC Responsible-Changed-Why: I'll take this one. http://www.freebsd.org/cgi/query-pr.cgi?pr=123630 From ivoras at freebsd.org Sun Sep 13 00:23:53 2009 From: ivoras at freebsd.org (Ivan Voras) Date: Sun Sep 13 00:23:59 2009 Subject: g_eli ivgen Message-ID: I'm looking at doing something in GELI and I've come across the following code in g_eli.c: 381 void 382 g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, 383 size_t size) 384 { 385 u_char off[8], hash[SHA256_DIGEST_LENGTH]; 386 SHA256_CTX ctx; 387 388 if (!(sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER)) 389 le64enc(off, (uint64_t)offset); 390 /* Copy precalculated SHA256 context for IV-Key. */ 391 bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); 392 SHA256_Update(&ctx, (uint8_t *)&offset, sizeof(offset)); 393 SHA256_Final(hash, &ctx); 394 bcopy(hash, iv, size); 395 } I don't get the purpose of the off variable - specifically, it looks unused. It looks to me like the idea was to convert offset to off if G_ELI_FLAG_NATIVE_BYTE_ORDER is not set but then it never got used and there's an "else" clause missing. Is this correct or am I missing something? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090913/221c77c1/signature.pgp From gfritz at gmail.com Sun Sep 13 19:03:11 2009 From: gfritz at gmail.com (Geoff Fritz) Date: Sun Sep 13 19:03:18 2009 Subject: gpart(8) not honoring sector sizes correctly? Message-ID: <20090913183150.GA48701@dev.null> I just recently started using gpart, and I ran into what I think might be a bug. I'm using FreeBSD/amd64 8.0-BETA4 I have a geli provider with a 4096 sector size. When I issued a "gpart add -s 1g -t freebsd_ufs ad0.eli" on this device, it appears the command assumes a 512-byte sector size, resulting in a partition that is 8G in size. The bsdlabel command handles this correctly, so I assumed that gpart should. Is this a bug? I only began messing with gpart after reading that it's related (I think) to getting the new bsdlabel in FreeBSD 8.0 to utilize 26 partitions (instead of the normal 8). Is there any documentation on how to do this? Thanks. -- Geoff Fritz From xcllnt at mac.com Sun Sep 13 22:59:44 2009 From: xcllnt at mac.com (Marcel Moolenaar) Date: Sun Sep 13 22:59:51 2009 Subject: gpart(8) not honoring sector sizes correctly? In-Reply-To: <20090913183150.GA48701@dev.null> References: <20090913183150.GA48701@dev.null> Message-ID: <16CD87F9-A772-4FD2-B4AB-118154A68575@mac.com> On Sep 13, 2009, at 11:31 AM, Geoff Fritz wrote: > I just recently started using gpart, and I ran into what I think might > be a bug. I'm using FreeBSD/amd64 8.0-BETA4 > > I have a geli provider with a 4096 sector size. When I issued a > "gpart add -s 1g -t freebsd_ufs ad0.eli" on this device, it appears > the command assumes a 512-byte sector size, resulting in a partition > that is 8G in size. The bsdlabel command handles this correctly, so I > assumed that gpart should. > > Is this a bug? It's a known limitation. The sector size is not known when parsing the arguments, so it's assumed to be standard. Just specify the size in sectors when the sector size is known not to be 512-bytes. > I only began messing with gpart after reading that it's related (I > think) to getting the new bsdlabel in FreeBSD 8.0 to utilize 26 > partitions (instead of the normal 8). Is there any documentation on > how to do this? Create the BSD disklabel as follows: gpart create -s bsd -n 26 FYI, -- Marcel Moolenaar xcllnt@mac.com From bugmaster at FreeBSD.org Mon Sep 14 11:07:00 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 14 11:08:10 2009 Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org Message-ID: <200909141106.n8EB6xW9072330@freefall.freebsd.org> Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used f kern/126902 geom [geom] geom_label: kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s f kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/120021 geom [geom] [panic] net-p2p/qbittorrent crashes system when o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 51 problems total. From scf at FreeBSD.org Tue Sep 15 18:35:50 2009 From: scf at FreeBSD.org (Sean C. Farley) Date: Tue Sep 15 18:35:56 2009 Subject: Proper gmirror install Message-ID: I have been experimenting with installing FreeBSD using only gpart from the 8.0-BETA4 DVD. It has been helping my understanding of GPT vs. MBR. Now, I would like to verify the setup[1] I have made and the messages I am getting from it. The basic setup is for both disks: Slice Type Size ad0s1 Windows7 system 100MB ad0s2 Windows7 20GB gm0s3 FreeBSD (non-swap) 20GB ad0s3 and ad1s3 ad0s4 FreeBSD (swap) 2GB I am creating the mirror prior to creating the BSD label. I also take it from this posting[2] that it is the preferred method. Everything appears correct, however, I am getting these messages: GEOM: ad0s3: geometry does not match label (255h,63s != 16h,63s). GEOM: ad0s3: media size does not match label. GEOM: ad1s3: geometry does not match label (255h,63s != 16h,63s) GEOM: ad1s3: media size does not match label. Questions: 1. Is this due to the BSD label being within the mirror and is considered safe? 2. Am I correct in my understanding that having the BSD label within the mirror takes care of the need to hardcode the provider's name and/or subtracting one from the c: partition? 3. Other than not being able to boot directly from those slices (untried; maybe not true) as opposed to the mirrored slice, is there any other concern doing it this way? 4. gpart allows more than four slices to be created. Are those primary, extended or something else? 5. Any other suggestions? I plan on putting this example on the wiki once it is verified to be correct. BTW, I must say I like using gpart after getting used to it. It would be nice if it could also handle creating and maintaining a hybrid MBR/GPT setup. Sean 1. http://people.freebsd.org/~scf/gmirror-install.txt 2. http://lists.freebsd.org/pipermail/freebsd-current/2009-June/008638.html -- scf@FreeBSD.org From linimon at FreeBSD.org Thu Sep 17 10:21:03 2009 From: linimon at FreeBSD.org (linimon@FreeBSD.org) Date: Thu Sep 17 10:21:15 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe Message-ID: <200909171021.n8HAL2C0001919@freefall.freebsd.org> Old Synopsis: GEOM_PART_* fails with sliced gstripe New Synopsis: [geom] GEOM_PART_* fails with sliced gstripe Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: linimon Responsible-Changed-When: Thu Sep 17 10:20:28 UTC 2009 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=138891 From marcel at FreeBSD.org Thu Sep 17 20:32:14 2009 From: marcel at FreeBSD.org (marcel@FreeBSD.org) Date: Thu Sep 17 20:32:20 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe Message-ID: <200909172032.n8HKWEUG021155@freefall.freebsd.org> Synopsis: [geom] GEOM_PART_* fails with sliced gstripe State-Changed-From-To: open->closed State-Changed-By: marcel State-Changed-When: Thu Sep 17 20:25:11 UTC 2009 State-Changed-Why: Your disk partitioning is invalid. You cannot have both a MBR and a BSD disk label in the same place and independently of each other. ace# fdisk /dev/stripe/raid0 ace# bsdlabel /dev/stripe/raid0 If you look closely, FreeBSD 7.2 will use the MBR on /dev/stripe/raid0 and the BSD disklabel on /dev/stripe/raid0s4. However, since a BSD disklabel also embeds a MBR, FreeBSD 8.0 will correctly prefer the BSD disklabel on /dev/stripe/raid0. However, the BSD disk label is not the one that should be used. Fix the problem by wiping out the second sector on the disk. BTW: the problem is caused by creating a dangerously dedicated installation. It's known to be broken and should not be used. FYI, http://www.freebsd.org/cgi/query-pr.cgi?pr=138891 From amdmi3 at amdmi3.ru Sat Sep 19 22:48:13 2009 From: amdmi3 at amdmi3.ru (Dmitry Marakasov) Date: Sat Sep 19 22:48:20 2009 Subject: gmirror rebuild Message-ID: <20090919223121.GA4601@hades.panopticon> Hi! I have 2 HDD configuration, with a similar slice on each HDD dedicated to gmirror: --- % sudo gmirror list Geom name: hades State: DEGRADED Components: 2 Balance: round-robin Slice: 4096 Flags: NONE GenID: 0 SyncID: 2 ID: 3209987644 Providers: 1. Name: mirror/hades Mediasize: 446421491200 (416G) Sectorsize: 512 Mode: r6w5e10 Consumers: 1. Name: ad6s3 Mediasize: 446421491712 (416G) Sectorsize: 512 Mode: r1w1e1 State: SYNCHRONIZING Priority: 0 Flags: DIRTY, SYNCHRONIZING GenID: 0 SyncID: 2 Synchronized: 13% ID: 4192909129 2. Name: ad8s3 Mediasize: 446421491712 (416G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 0 SyncID: 2 ID: 1523468916 --- The mirror itself is BSD partitioned and there are ufs and ufs/journal filesystems on it: --- /dev/mirror/hadesa 989M 326M 584M 36% / /dev/mirror/hadesd 9.7G 404M 8.5G 4% /var /dev/mirror/hadese 9.7G 28K 8.9G 0% /tmp /dev/mirror/hadesf.journal 28G 7.4G 18G 28% /usr /dev/mirror/hadesg.journal 361G 161G 171G 48% /usr/home --- I've just had power outage and the box rebooted, and the mirror seem to be resynced from scratch (visible above). Honestly, I didn't expect that at all, but, well, that seems to be logical actually as I don't want different data to be read from it depending on what disk round-robin choses. However, I still don't like how it behaves. It seems to be copying one disk to another completely, which much worse than fsck after cold reboot, and it somewhat defies the purpose of mirroring, as if the drive fails while resync, I'm screwed. If one drive has bad sectors, they may be zeroed on another one (or am I wrong?). First question: why doesn't it read both drives and sync only differences? - Reading is usually faster - This is good for data safety. For example, the common case with modern crappy HDDs are the sectors which are unreadable not marked as bad by hdd, and are cured when the data is written over them. In the case of `read both disks & clone data from better one (that is, from the readable if another is not, or from the (I dunno the criteria) if the data doesn't match)` such sectors will be cured. That's somehow similar to zfs scrub. Second question: is it possible to avoid syncing? gjournal(8) says the syncing may be turned off on underlying mirror providers if it's used. I was somehow silly to thing it'll work magically, however I doubted that it'll work over partitioned mirror. Now thinking it over, I suppose I can enable journalling on all partitions on my mirror and turn the syncing off on it. Will it be safe? Also, I have clear_tmp_enable=YES, so I don't really need syncing for tmp. As I understand, I can only toggle syncing for the whole mirror, not separate partitions on it. Also, I can't (shouldn't) create separate mirrors for each partitions, cause they'll resync in parallel which is suboptimal in terms of performance. No solution here? -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From bugmaster at FreeBSD.org Mon Sep 21 11:06:55 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 21 11:08:14 2009 Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org Message-ID: <200909211106.n8LB6tO2030251@freefall.freebsd.org> Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used f kern/126902 geom [geom] geom_label: kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s f kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/120021 geom [geom] [panic] net-p2p/qbittorrent crashes system when o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 51 problems total. From a.n.s.i at gmx.net Mon Sep 21 15:05:12 2009 From: a.n.s.i at gmx.net (Evgeny Solovyov) Date: Mon Sep 21 15:05:18 2009 Subject: geom_eli, N disks, zfs Message-ID: <20090921143821.27380@gmx.net> Is there any better way to configure a system to encrypt N-disk with passphrase for using under zfs as write in loader.conf following: geom_eli_load="YES" geli_da0p1_keyfile0_load="YES" geli_da0p1_keyfile0_type="da0p1:geli_keyfile0" geli_da0p1_keyfile0_name="/boot/keys/da0.key" geli_da2p1_keyfile0_load="YES" geli_da2p1_keyfile0_type="da2p1:geli_keyfile0" geli_da2p1_keyfile0_name="/boot/keys/da2.key" ... geli_dap1_keyfile0_load="YES" geli_dap1_keyfile0_type="dap1:geli_keyfile0" geli_dap1_keyfile0_name="/boot/keys/da.key" The problem is we must enter the passphrase N-times. Thanks. Evgeny Solovyov -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser From freebsdpr at satin.sensation.net.au Mon Sep 21 15:20:02 2009 From: freebsdpr at satin.sensation.net.au (freebsdpr) Date: Mon Sep 21 15:20:37 2009 Subject: kern/113885: [gmirror] [patch] improved gmirror balance algorithm Message-ID: <200909211520.n8LFK2Vq087549@freefall.freebsd.org> The following reply was made to PR kern/113885; it has been noted by GNATS. From: freebsdpr To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/113885: [gmirror] [patch] improved gmirror balance algorithm Date: Tue, 22 Sep 2009 01:13:05 +1000 (EST) > The patch will not increase streaming read performance beyond what's possible with a single drive[...] I meant that after applying the patch it literally only reads from a single drive. "iostat -w 1 -x" shows it consistently using the last drive of the set for all reads. From ac at belngo.info Mon Sep 21 21:05:41 2009 From: ac at belngo.info (Alaksiej C) Date: Mon Sep 21 21:05:47 2009 Subject: geom_eli, N disks, zfs In-Reply-To: <20090921143821.27380@gmx.net> References: <20090921143821.27380@gmx.net> Message-ID: <5709ce310909211335s25aba206i33571558e4aeb92f@mail.gmail.com> You can allocate one small disk/slice to be encrypted with passphrase (and - if you like - with keyfile(s) too). Inside of it you will store keyfiles for other disks, which should be encrypted without using passphrase(s). In such configuration it's necessary to know passphrase to unlock any disk, but you need to type it only once. P.S. And, actually, I think your question is fit better for freebsd-questions@. On Mon, Sep 21, 2009 at 5:38 PM, Evgeny Solovyov wrote: > Is there any better way to configure a system to encrypt N-disk with passphrase for using under zfs as write in loader.conf following: > > geom_eli_load="YES" > geli_da0p1_keyfile0_load="YES" > geli_da0p1_keyfile0_type="da0p1:geli_keyfile0" > geli_da0p1_keyfile0_name="/boot/keys/da0.key" > > geli_da2p1_keyfile0_load="YES" > geli_da2p1_keyfile0_type="da2p1:geli_keyfile0" > geli_da2p1_keyfile0_name="/boot/keys/da2.key" > > ... > > geli_dap1_keyfile0_load="YES" > geli_dap1_keyfile0_type="dap1:geli_keyfile0" > geli_dap1_keyfile0_name="/boot/keys/da.key" > > > The problem is we must enter the passphrase N-times. > > Thanks. > > Evgeny Solovyov > -- > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - > sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser > _______________________________________________ > freebsd-geom@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" > From petefrench at ticketswitch.com Tue Sep 22 10:37:07 2009 From: petefrench at ticketswitch.com (Pete French) Date: Tue Sep 22 10:37:13 2009 Subject: geom_eli, N disks, zfs In-Reply-To: <20090921143821.27380@gmx.net> Message-ID: > Is there any better way to configure a system to encrypt N-disk with passphrase for using under zfs as write in loader.conf following: I use a very short separate partition as the keyfile, decrypt that once and then use it to decrypt the others. My rc.conf looks like this: geli_autodetach="NO" geli_devices="ad4s1e ad6 ad8" geli_ad6_flags="-p -k /dev/ad4s1e.eli" geli_ad8_flags="-p -k /dev/ad4s1e.eli" which is a bit shorter than yours :-) ad4s1 is 5 sectors (i.e. 2560 bytes) hence ad4s1.eli is 2048 bytes. I initialised it with random data before encrypting the other discs and I keep a backup of the 4 sectors elsewhere just in case... -pete. From shurd at sasktel.net Wed Sep 23 00:32:10 2009 From: shurd at sasktel.net (Stephen Hurd) Date: Wed Sep 23 00:33:51 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe In-Reply-To: <200909172032.n8HKWEUG021155@freefall.freebsd.org> References: <200909172032.n8HKWEUG021155@freefall.freebsd.org> Message-ID: <4AB967E2.8010207@sasktel.net> marcel@FreeBSD.org wrote: > Your disk partitioning is invalid. You cannot have both a MBR and > a BSD disk label in the same place and independently of each other. > ace# fdisk /dev/stripe/raid0 > ace# bsdlabel /dev/stripe/raid0 > If you look closely, FreeBSD 7.2 will use the MBR on /dev/stripe/raid0 > and the BSD disklabel on /dev/stripe/raid0s4. However, since a BSD > disklabel also embeds a MBR, FreeBSD 8.0 will correctly prefer the > BSD disklabel on /dev/stripe/raid0. However, the BSD disk label is > not the one that should be used. > Fix the problem by wiping out the second sector on the disk. > BTW: the problem is caused by creating a dangerously dedicated > installation. It's known to be broken and should not be used. > FYI, > After wiping out the second sector or the drive (dd seek=1 count=1 if=/dev/zero of=/dev/stripe/raid0) fdisk now reports "invalid fdisk partition table found" but GEOM_PART_* still does not locate the a slice and the b/d slices will not mount. I have never had a /dev/stripe/raid0s* node, just /dev/stripe/raid0[a-d]. Is there any way to fix this short of a full backup/restore? (The reason I used DD mode here was that since the gstripe wouldn't be visible to the BIOS -- or anything other than FreeBSD -- slicing seemed silly.) From xcllnt at mac.com Wed Sep 23 00:57:45 2009 From: xcllnt at mac.com (Marcel Moolenaar) Date: Wed Sep 23 00:57:50 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe In-Reply-To: <4AB967E2.8010207@sasktel.net> References: <200909172032.n8HKWEUG021155@freefall.freebsd.org> <4AB967E2.8010207@sasktel.net> Message-ID: <08EDE240-FE64-48D6-905C-8203FE6268EB@mac.com> On Sep 22, 2009, at 5:12 PM, Stephen Hurd wrote: > > After wiping out the second sector or the drive (dd seek=1 count=1 > if=/dev/zero of=/dev/stripe/raid0) > fdisk now reports "invalid fdisk partition table found" but > GEOM_PART_* still does not locate the a slice and the b/d slices > will not mount. What is the sector size? > Is there any way to fix this short of a full backup/restore? I don't know yet... -- Marcel Moolenaar xcllnt@mac.com From shurd at sasktel.net Wed Sep 23 01:23:28 2009 From: shurd at sasktel.net (Stephen Hurd) Date: Wed Sep 23 01:23:34 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe In-Reply-To: <08EDE240-FE64-48D6-905C-8203FE6268EB@mac.com> References: <200909172032.n8HKWEUG021155@freefall.freebsd.org> <4AB967E2.8010207@sasktel.net> <08EDE240-FE64-48D6-905C-8203FE6268EB@mac.com> Message-ID: <4AB9788B.2040003@sasktel.net> Marcel Moolenaar wrote: >> After wiping out the second sector or the drive (dd seek=1 count=1 >> if=/dev/zero of=/dev/stripe/raid0) >> fdisk now reports "invalid fdisk partition table found" but >> GEOM_PART_* still does not locate the a slice and the b/d slices will >> not mount. > > What is the sector size? 512 according to diskinfo and gstripe list: > diskinfo /dev/stripe/raid0 /dev/stripe/raid0 512 42934992896 83857408 > gstripe list Geom name: raid0 State: UP Status: Total=4, Online=4 Type: AUTOMATIC Stripesize: 262144 ID: 40432321 Providers: 1. Name: stripe/raid0 Mediasize: 42934992896 (40G) Sectorsize: 512 Mode: r3w3e4 Consumers: 1. Name: da0s2 Mediasize: 10733990400 (10G) Sectorsize: 512 Mode: r3w3e5 Number: 0 2. Name: da1s2 Mediasize: 10733990400 (10G) Sectorsize: 512 Mode: r3w3e5 Number: 1 3. Name: da2s2 Mediasize: 10733990400 (10G) Sectorsize: 512 Mode: r3w3e5 Number: 2 4. Name: da3s2 Mediasize: 10733990400 (10G) Sectorsize: 512 Mode: r3w3e5 Number: 3 From eugen at kuzbass.ru Wed Sep 23 04:30:04 2009 From: eugen at kuzbass.ru (Eugene Grosbein) Date: Wed Sep 23 04:30:11 2009 Subject: kern/104389: [geom] [patch] sys/geom/geom_dump.c doesn't encode XML entities Message-ID: <200909230430.n8N4U4we074458@freefall.freebsd.org> The following reply was made to PR kern/104389; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: qa@freebsd.org Subject: Re: kern/104389: [geom] [patch] sys/geom/geom_dump.c doesn't encode XML entities Date: Wed, 23 Sep 2009 11:59:59 +0800 Hi! This it still the problem for 8.0-RC1 and patch-3 really helps. Please note, that localized versions of Windows assing to newly formatted USB flash drives the label "NEW VOLUME" translated to national language. So, inserting such drive instantly breaks geom utilities until drive removed. patch-3.diff in the PR solves the problem. Eugene Grosbein From a.n.s.i at gmx.net Wed Sep 23 08:33:18 2009 From: a.n.s.i at gmx.net (Evgeny Solovyov) Date: Wed Sep 23 08:33:24 2009 Subject: geom_eli, N disks, zfs In-Reply-To: References: Message-ID: <20090923083313.55390@gmx.net> > > Is there any better way to configure a system to encrypt N-disk with > passphrase for using under zfs as write in loader.conf following: > > I use a very short separate partition as the keyfile, decrypt that > once and then use it to decrypt the others. My rc.conf looks like > this: > > geli_autodetach="NO" > geli_devices="ad4s1e ad6 ad8" > geli_ad6_flags="-p -k /dev/ad4s1e.eli" > geli_ad8_flags="-p -k /dev/ad4s1e.eli" > > which is a bit shorter than yours :-) ad4s1 is 5 sectors (i.e. 2560 > bytes) hence ad4s1.eli is 2048 bytes. I initialised it with random > data before encrypting the other discs and I keep a backup of > the 4 sectors elsewhere just in case... > Yes, it will be one solution. But your setup we must mount root-fs first to read rc.conf, then we can attach disk to initialize ZFS volume. Or? But what about zfs-only system with one zpool using all N-disks? I think it will be better if geom_eli remembers first-typed passphrase and tries it for all disks at least ones. In 99% we use the same passphrase for all disks. Don't we? Then we don't have to worry about small 5-sectors 'magic' partition. For my installation I use boot-cd. It has only boot dir with keys and loader.conf like this: geom_eli_load="YES" geli_da0p1_keyfile0_load="YES" geli_da0p1_keyfile0_type="da0p1:geli_keyfile0" geli_da0p1_keyfile0_name="/boot/keys/da0.key" geli_da1p1_keyfile0_load="YES" geli_da1p1_keyfile0_type="da1p1:geli_keyfile0" geli_da1p1_keyfile0_name="/boot/keys/da1.key" .... geli_da9p1_keyfile0_load="YES" geli_da9p1_keyfile0_type="da9p1:geli_keyfile0" geli_da9p1_keyfile0_name="/boot/keys/da9.key" zfs_load="YES" vfs.root.mountfrom="zfs:tank" Yes it is not comfortable my be stupid to type passphrase 10 times :) But with good uptime its bearable. Advantage of that installation is I have to care only about make a copy of boot-cd :) Sorry for my terrible English. Thanks. -- GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 From petefrench at ticketswitch.com Wed Sep 23 09:59:59 2009 From: petefrench at ticketswitch.com (Pete French) Date: Wed Sep 23 10:00:05 2009 Subject: geom_eli, N disks, zfs In-Reply-To: <20090923083313.55390@gmx.net> Message-ID: > Yes, it will be one solution. But your setup we must mount root-fs first to read rc.conf, then we can attach disk to initialize ZFS volume. Or? Yes, this is true - but then I only encrypt the drives which have sensetive data on them. My boot drive doesnt come under that heading, though all the data is then mounted from an encrypted zpool. > But what about zfs-only system with one zpool using all N-disks? I havent though about that - I have two zpools, one unencrpted on the boot drive, and then a pair of mirrored encrypted drives for the rest. I never quite saw the mileage in encrypting the boot device really - as long as the actual data is protected then I am happy. -pete. From a.n.s.i at gmx.net Wed Sep 23 13:36:41 2009 From: a.n.s.i at gmx.net (Evgeny Solovyov) Date: Wed Sep 23 13:36:47 2009 Subject: geom_eli, N disks, zfs In-Reply-To: References: Message-ID: <20090923133638.203520@gmx.net> > > But what about zfs-only system with one zpool using all N-disks? > > I havent though about that - I have two zpools, one unencrpted on the boot > drive, and then a pair of mirrored encrypted drives for the rest. I never > quite saw the mileage in encrypting the boot device really - as long as > the actual data is protected then I am happy. Ups! we cannot use more then one disk in zfs root pool. Only mirror is supported. No stripe no Raidz. :( Then your configuration is the best for me. -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser From tony at crosswinds.net Wed Sep 23 17:04:37 2009 From: tony at crosswinds.net (Tony Holmes) Date: Wed Sep 23 17:04:44 2009 Subject: Mirrors and Stripes and Bad Disks, Oh My Message-ID: <20090923165459.GA95498@crosswinds.net> Hi All, I have a system set up with 4 disks ad4/ad6/ad8/ad10 in a combination of RAID 1 and RAID 10. ad4/ad8 and ad6/ad10 are mirrored (gm0 and gm1 respectively). I have set up mirrored disks as per http://onlamp.com/pub/a/bsd/2005/11/10/FreeBSD_Basics.html I have put 4 partitions on both pairs. The first 4 partitions of each are /, /var, /usr, /tmp. The last partition on both mirror sets are striped and used for /usr/home. Ok, ad8 dropped out - no biggie but I didn't notice it for a couple days. On Resync, ad4 has hard read errors. It rebooted in the process, marking ad8 as the master and ad4 as dirty (when the ad4->ad8 resynch failed!!) ad8 does need to be replaced as well as it has flaked out after a long period of time (could just be power/cable, but I don't trust it). So now I'm up a river a little and could use some guidance. I need to preserve the data on the stripe, swap out ad8 and ad4. I know that geom metadata is indepedant of the partition data. I need to get ad4 back as the master in the mirror without losing actual data. So I was thinking of doing the following - and geom/disk experts please jump in if you see any problem: 1. Bring up the system in single user mode. 2. Destroy gm0 (with ad4 and ad8) 3. Recreate gm0 with ad4 only 4. Break ad10 out of the gm1 mirror pair - this way during recovery I can build another copy of the stripe using ad8/ad10 if I need it. I expect to hit bad sectors on the copy off. I also do expect lost files/data if I have to go this route due to the time that ad8 was not mirrored. Will this give me gm0 with a master ad4? If I am able to recreate the stripe with identical parameters, will the file system be visible. It's a pita and yes I can recover most from backups but not a couple critical files that went on today (of course). TIA for any assistance. -- Tony Holmes Ph: (416) 993-1219 Founder and Senior Systems Architect Crosswinds Internet Communications Inc. From bugmaster at FreeBSD.org Mon Sep 28 11:06:55 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 28 11:08:08 2009 Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org Message-ID: <200909281106.n8SB6sKQ064009@freefall.freebsd.org> Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used f kern/126902 geom [geom] geom_label: kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s f kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/120021 geom [geom] [panic] net-p2p/qbittorrent crashes system when o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 51 problems total. From xcllnt at mac.com Mon Sep 28 17:52:00 2009 From: xcllnt at mac.com (Marcel Moolenaar) Date: Mon Sep 28 17:52:06 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe In-Reply-To: <4AB9788B.2040003@sasktel.net> References: <200909172032.n8HKWEUG021155@freefall.freebsd.org> <4AB967E2.8010207@sasktel.net> <08EDE240-FE64-48D6-905C-8203FE6268EB@mac.com> <4AB9788B.2040003@sasktel.net> Message-ID: On Sep 22, 2009, at 6:23 PM, Stephen Hurd wrote: > Marcel Moolenaar wrote: >>> After wiping out the second sector or the drive (dd seek=1 count=1 >>> if=/dev/zero of=/dev/stripe/raid0) >>> fdisk now reports "invalid fdisk partition table found" but >>> GEOM_PART_* still does not locate the a slice and the b/d slices >>> will not mount. >> >> What is the sector size? > > 512 according to diskinfo and gstripe list: Ok, so nothing weird. What I do see is that you created a RAID within MBR slices, so you can't have a MBR on top of the RAID. In other words, it's invalid to do: fdisk /dev/stripe/raid0 The correct location for the BSD disklabel would be sector 2 of the RAID. Can you dump sector 64 & 65 of raid0? (i.e. dd if=/dev/stripe/raid0 of=/tmp/raid0-64.dmp iseek=63 bs=512 count=2) -- Marcel Moolenaar xcllnt@mac.com From shurd at sasktel.net Mon Sep 28 21:03:45 2009 From: shurd at sasktel.net (Stephen Hurd) Date: Mon Sep 28 21:03:52 2009 Subject: kern/138891: [geom] GEOM_PART_* fails with sliced gstripe In-Reply-To: References: <200909172032.n8HKWEUG021155@freefall.freebsd.org> <4AB967E2.8010207@sasktel.net> <08EDE240-FE64-48D6-905C-8203FE6268EB@mac.com> <4AB9788B.2040003@sasktel.net> Message-ID: <4AC124AC.4050405@sasktel.net> Marcel Moolenaar wrote: >>>> fdisk now reports "invalid fdisk partition table found" but >>>> GEOM_PART_* still does not locate the a slice and the b/d slices >>>> will not mount. >>> >>> What is the sector size? >> >> 512 according to diskinfo and gstripe list: > > Ok, so nothing weird. > > Can you dump sector 64 & 65 of raid0? > (i.e. dd if=/dev/stripe/raid0 of=/tmp/raid0-64.dmp iseek=63 bs=512 > count=2) All zeros. > dd if=/dev/stripe/raid0 iseek=63 bs=512 count=2 | hd -C 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 2+0 records in 2+0 records out 1024 bytes transferred in 0.004813 secs (212759 bytes/sec) 00000400 From grarpamp at gmail.com Tue Sep 29 07:42:40 2009 From: grarpamp at gmail.com (grarpamp) Date: Tue Sep 29 07:42:46 2009 Subject: bsdlabel, vnode_pager Message-ID: Updated a box from RELENG_7 to RELENG_8 yesterday... make buildworld, installworld, mergemaster, boot0cfg -Bv ad0, bsdlabel -B ad0s1. When using bsdlabel I get this from this file: src/sys/geom/geom_ctl.c:442: Class not found this happens I think when bsdlabel refuses to write anything. So I boot in boot -sv, I get this after it writes to disk: vnode_pager_getpages: I/O read error then even with simple sync I get: sync: Input/output error Although I've got the shell prompt still, any attempt to do anything fails due to the above. /sbin/reboot doesn't work, requiring powerdown. After that things come back fine and I think I'm running on the new boot0 and slice code. It only wigs out after bsdlabel is able to write something. At various times under RELENG_7 I used these two names in bsdlabel, just like '4.2BSD' is used to mark the partition's usage in bsdlabel. At some point I reverted them to unused as it seemed to have once solved the Class issue combined with not being able to edit the bsdlabel with bsdlabel. ZFS is obvious, unknown was to mark ufs or raw data slices that should not have any system tools looking inside it at at any time. /usr/include/sys/disklabel.h: #define FS_OTHER 10 /* in use, but unknown/unsupported */ #define FS_ZFS 27 /* Sun's ZFS */ #ifdef FSTYPENAMES static const char *fstypenames[] = { 'unknown' 'ZFS' This is currently repeatable with: boot -sv, bsdlabel -B ad0s1. Hopefully someone else will see it on their box as I'm not really set up to debug. Also, I hate CHS addressing, too many chances for operator off by one, or a dozen :) So whoever was thinking of removing it from toolsets ala: fdisk, has my full second on that motion :) Though wasn't there something about beginning/ending on proper boundaries for full stripe read/writes, performance or configuration or something like that? How does one know that with only LBA? Or is it superstition? Thx. # bsdlabel ad0s1 # /dev/ad0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 786432 0 4.2BSD 0 0 0 b: 131072 786432 unused 0 0 c: 6421905 0 unused 0 0 # "raw" part, don't edit d: 262144 917504 unused 0 0 e: 131072 1179648 unused 0 0 f: 1310720 1310720 4.2BSD 0 0 0 g: 3538944 2621440 4.2BSD 0 0 0 h: 261521 6160384 unused 0 0 # gpart show => 63 17803359 ad0 MBR (8.5G) 63 6421905 1 freebsd [active] (3.1G) 6421968 11381328 2 freebsd (5.4G) 17803296 126 - free - (63K) => 0 6421905 ad0s1 BSD (3.1G) 0 786432 1 freebsd-ufs (384M) 786432 131072 2 !0 (64M) 917504 262144 4 !0 (128M) 1179648 131072 5 !0 (64M) 1310720 1310720 6 freebsd-ufs (640M) 2621440 3538944 7 freebsd-ufs (1.7G) 6160384 261521 8 !0 (128M) # fdisk ad0 ******* Working on device /dev/ad0 ******* parameters extracted from in-core disklabel are: cylinders=17662 heads=16 sectors/track=63 (1008 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=17662 heads=16 sectors/track=63 (1008 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 6421905 (3135 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 15/ sector 63 The data for partition 2 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 6421968, size 11381328 (5557 Meg), flag 0 beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 15/ sector 63 The data for partition 3 is: The data for partition 4 is: From ivoras at freebsd.org Tue Sep 29 08:23:57 2009 From: ivoras at freebsd.org (Ivan Voras) Date: Tue Sep 29 08:24:03 2009 Subject: Mirrors and Stripes and Bad Disks, Oh My In-Reply-To: <20090923165459.GA95498@crosswinds.net> References: <20090923165459.GA95498@crosswinds.net> Message-ID: Tony Holmes wrote: > 1. Bring up the system in single user mode. > 2. Destroy gm0 (with ad4 and ad8) > 3. Recreate gm0 with ad4 only > 4. Break ad10 out of the gm1 mirror pair - this way during recovery I > can build another copy of the stripe using ad8/ad10 if I need it. > I expect to hit bad sectors on the copy off. I also do expect lost > files/data if I have to go this route due to the time that ad8 was not > mirrored. > Will this give me gm0 with a master ad4? Yes. > If I am able to recreate the stripe with identical parameters, will the > file system be visible. Yes. Don't touch anything else, though (like simultaneously updating to another FreeBSD version, etc...) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20090929/a9cbbce3/signature.pgp From dnaeon at gmail.com Wed Sep 30 23:35:05 2009 From: dnaeon at gmail.com (Marin Atanasov) Date: Wed Sep 30 23:35:12 2009 Subject: gmirror issue? Message-ID: <4AC3E432.9010603@gmail.com> Hi, I was doing some tests under 8.0-RC1 and noticed that when I set-up a root partition with gmirror, after the first reboot with the new mirrored root partition the system is not able to continue the boot process. The error message that is being printed is this: pid 63 (swapon), uid 0: exited on signal 11 .... pid 65: (fsck), uid 0: exited on signal 11 Segmentation fault Unknown error; help! ERROR: ABORTING BOOT (sending SIGTERM to parent)! The full details about the implementation setup I'm using with gmirror/gvinum are described here: http://www.daemonforums.org/showthread.php?p=27010#post27010 Regards, Marin