From owner-freebsd-geom@FreeBSD.ORG Sun Sep 5 15:47:00 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A42BF10656AB; Sun, 5 Sep 2010 15:47:00 +0000 (UTC) (envelope-from arundel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6D58E8FC13; Sun, 5 Sep 2010 15:47:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o85Fl04S075056; Sun, 5 Sep 2010 15:47:00 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o85Fl0A7075052; Sun, 5 Sep 2010 15:47:00 GMT (envelope-from arundel) Date: Sun, 5 Sep 2010 15:47:00 GMT Message-Id: <201009051547.o85Fl0A7075052@freefall.freebsd.org> To: roddi@me.com, arundel@FreeBSD.org, freebsd-geom@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: bin/150239: [geom_part] [patch] gpart(8) bootcode displays highly ambiguous message X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 15:47:00 -0000 Old Synopsis: gpart bootcode displays highly ambiguous message New Synopsis: [geom_part] [patch] gpart(8) bootcode displays highly ambiguous message State-Changed-From-To: open->analyzed State-Changed-By: arundel State-Changed-When: Sun Sep 5 15:43:27 UTC 2010 State-Changed-Why: Wording in g_part.c isn't precise enough. http://www.freebsd.org/cgi/query-pr.cgi?pr=150239 From owner-freebsd-geom@FreeBSD.ORG Sun Sep 5 15:50:07 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D3491065693 for ; Sun, 5 Sep 2010 15:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E646E8FC19 for ; Sun, 5 Sep 2010 15:50:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o85Fo6Gv075236 for ; Sun, 5 Sep 2010 15:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o85Fo65n075234; Sun, 5 Sep 2010 15:50:06 GMT (envelope-from gnats) Date: Sun, 5 Sep 2010 15:50:06 GMT Message-Id: <201009051550.o85Fo65n075234@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Alexander Best Cc: Subject: Re: bin/150239: gpart bootcode displays highly ambiguous message X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexander Best List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 15:50:07 -0000 The following reply was made to PR bin/150239; it has been noted by GNATS. From: Alexander Best To: bug-followup@freebsd.org Cc: Subject: Re: bin/150239: gpart bootcode displays highly ambiguous message Date: Sun, 5 Sep 2010 15:42:33 +0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline this patch changes the output like you suggested. also my editor discovered an unnecessary space in g_part.c ;) cheers. alex -- a13x --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="g_part.c.diff" diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index b9fca08..5efe7ef 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -571,7 +571,7 @@ g_part_ctl_bootcode(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { sb = sbuf_new_auto(); - sbuf_printf(sb, "%s has bootcode\n", gp->name); + sbuf_printf(sb, "bootcode was written to %s\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -967,7 +967,7 @@ g_part_ctl_move(struct gctl_req *req, struct g_part_parms *gpp) { gctl_error(req, "%d verb 'move'", ENOSYS); return (ENOSYS); -} +} static int g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp) --lrZ03NoBR/3+SXJZ-- From owner-freebsd-geom@FreeBSD.ORG Sun Sep 5 18:16:03 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A381065693 for ; Sun, 5 Sep 2010 18:16:03 +0000 (UTC) (envelope-from takawata@init-main.com) Received: from sana.init-main.com (unknown [IPv6:2001:240:28::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1E54A8FC08 for ; Sun, 5 Sep 2010 18:16:01 +0000 (UTC) Received: from ns.init-main.com (localhost [127.0.0.1]) by sana.init-main.com (8.14.3/8.14.3) with ESMTP id o85IFmsa024096 for ; Mon, 6 Sep 2010 03:15:49 +0900 (JST) (envelope-from takawata@ns.init-main.com) Message-Id: <201009051815.o85IFmsa024096@sana.init-main.com> To: freebsd-geom@freebsd.org Date: Mon, 06 Sep 2010 03:15:47 +0900 From: Takanori Watanabe Subject: UDF label function patch. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 18:16:03 -0000 I wrote a patch to add UDF support on geom label module. How about it? Index: sys/conf/files =================================================================== --- sys/conf/files (revision 212175) +++ sys/conf/files (working copy) @@ -2023,6 +2023,7 @@ geom/label/g_label_msdosfs.c optional geom_label geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label +geom/label/g_label_udf.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/label/g_label_gpt.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm Index: sbin/geom/class/label/glabel.8 =================================================================== --- sbin/geom/class/label/glabel.8 (revision 212175) +++ sbin/geom/class/label/glabel.8 (working copy) @@ -109,6 +109,9 @@ CD ISO9660 (directory .Pa /dev/iso9660/ ) . .It +DVD UDF (directory +.Pa /dev/udf/ ) . +.It EXT2FS (directory .Pa /dev/ext2fs/ ) . .It Index: sys/geom/label/g_label_udf.c =================================================================== --- sys/geom/label/g_label_udf.c (revision 0) +++ sys/geom/label/g_label_udf.c (revision 0) @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 2010 Takanori Watanabe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#define G_LABEL_UDF_DIR "udf" +#define LOGICAL_SECTOR_SIZE 2048 +#define UDF_OFFSET (256*LOGICAL_SECTOR_SIZE) +#define VOLUME_LEN 16 + +static int +g_label_udf_checktag(struct desc_tag *tag, uint16_t id) +{ + uint8_t *itag; + uint8_t i, cksum = 0; + + itag = (uint8_t *)tag; + + if (le16toh(tag->id) != id) + return (EINVAL); + + for (i = 0; i < 16; i++) + cksum = cksum + itag[i]; + cksum = cksum - itag[4]; + + if (cksum == tag->cksum) + return (0); + + return (EINVAL); +} +static int +g_label_udf_uncompress_unicode(unsigned char *dest,unsigned char *src, int size,int srcsize) +{ + int i,j; + unsigned short unichar; + if(src[0] == 8){ + strlcpy(dest, src+1 , size); + return 0; + }else if(src[0] == 16){ + /*Encode as UTF-8*/ + for(j = 0,i = 1; i < srcsize; i+=2){ + unichar = src[i]<<8|src[i+1]; + if(unichar == 0){ + *dest = 0; + return 0; + } + if(unichar < 0x7f){ + j++; + if(j > size){ + *dest = 0; + return 0; + } + *dest++ = unichar; + }else if(unichar < 0x7ff){ + j += 2 ; + if(j > size){ + *dest = 0; + return 0; + } + *dest++ = ((unichar>>6)&0x1f)|0xc0; + *dest++ = (unichar &0x3f)|0x80; + }else{ + j+= 3; + if(j > size){ + *dest = 0; + return 0; + } + *dest++ = ((unichar>>12)&0x0f)|0xe0; + *dest++ = ((unichar>>6)&0x3f)|0x80; + *dest++ = (unichar&0x3f)|0x80; + } + } + } + + return 1; +} + +static void +g_label_udf_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_provider *pp; + unsigned char *sector = NULL; + unsigned char *volume = NULL; + int i; + struct anchor_vdp *avdp; + struct logvol_desc *logvol; + + g_topology_assert_not(); + pp = cp->provider; + label[0] = '\0'; + + if ((UDF_OFFSET % pp->sectorsize) != 0) + return; + sector = (unsigned char *)g_read_data(cp, UDF_OFFSET, pp->sectorsize, + NULL); + if (sector == NULL) + return; + + if (g_label_udf_checktag((struct desc_tag *)sector, TAGID_ANCHOR) != 0) { + goto end; + } + avdp = (struct anchor_vdp *) sector; + for(i = 0; i < avdp->main_vds_ex.len; i+= LOGICAL_SECTOR_SIZE){ + volume =(unsigned char *) + g_read_data(cp, + LOGICAL_SECTOR_SIZE + *avdp->main_vds_ex.loc + i, + LOGICAL_SECTOR_SIZE, + NULL); + if (g_label_udf_checktag((struct desc_tag *)volume, + TAGID_LOGVOL) != 0) { + g_free(volume); + continue; + } + logvol = (struct logvol_desc *)volume; + G_LABEL_DEBUG(1, "UDF file system detected on %s.", pp->name); + if(g_label_udf_uncompress_unicode(label, logvol->logvol_id, size, sizeof(logvol->logvol_id))!= 0){ + label[0] = '\0'; + } + break; + } +end: + if(sector){ + g_free(sector); + } + if(volume){ + g_free(volume); + } +} + +struct g_label_desc g_label_udf = { + .ld_taste = g_label_udf_taste, + .ld_dir = G_LABEL_UDF_DIR, + .ld_enabled = 1 +}; +G_LABEL_INIT(udf, g_label_udf, "Create device nodes for UDF volumes"); Index: sys/geom/label/g_label.c =================================================================== --- sys/geom/label/g_label.c (revision 212175) +++ sys/geom/label/g_label.c (working copy) @@ -78,6 +78,7 @@ const struct g_label_desc *g_labels[] = { &g_label_ufs_id, &g_label_ufs_volume, + &g_label_udf, &g_label_iso9660, &g_label_msdosfs, &g_label_ext2fs, Index: sys/geom/label/g_label.h =================================================================== --- sys/geom/label/g_label.h (revision 212175) +++ sys/geom/label/g_label.h (working copy) @@ -80,6 +80,7 @@ /* Supported labels. */ extern struct g_label_desc g_label_ufs_id; extern struct g_label_desc g_label_ufs_volume; +extern struct g_label_desc g_label_udf; extern struct g_label_desc g_label_iso9660; extern struct g_label_desc g_label_msdosfs; extern struct g_label_desc g_label_ext2fs; Index: sys/modules/geom/geom_label/Makefile =================================================================== --- sys/modules/geom/geom_label/Makefile (revision 212175) +++ sys/modules/geom/geom_label/Makefile (working copy) @@ -10,6 +10,7 @@ SRCS+= g_label_msdosfs.c SRCS+= g_label_ntfs.c SRCS+= g_label_reiserfs.c +SRCS+= g_label_udf.c SRCS+= g_label_ufs.c .include From owner-freebsd-geom@FreeBSD.ORG Mon Sep 6 11:06:56 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64BA61065697 for ; Mon, 6 Sep 2010 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 52C008FC08 for ; Mon, 6 Sep 2010 11:06:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o86B6uDo011777 for ; Mon, 6 Sep 2010 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o86B6tVg011775 for freebsd-geom@FreeBSD.org; Mon, 6 Sep 2010 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 6 Sep 2010 11:06:55 GMT Message-Id: <201009061106.o86B6tVg011775@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 11:06:56 -0000 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 -------------------------------------------------------------------------------- a bin/150239 geom [geom_part] [patch] gpart(8) bootcode displays highly o kern/149762 geom volume labels with rogue characters o bin/149215 geom [panic] [geom_part] gpart(8): Delete linux's slice via o kern/147852 geom [geom] [panic] graid3 panic: wrong offset 16384 for se o kern/147851 geom [geom] [panic] graid3 panic: g_read_data: invalid leng o kern/147667 geom [gmirror] Booting with one component of a gmirror, the o kern/147664 geom [geom] [patch] Add the ability to create linux and fat o kern/145818 geom [geom] geom_stat_open showing cached information for n o kern/145042 geom [geom] System stops booting after printing message "GE o kern/144962 geom [geom] panic when accessing GPT disk with a large numb o kern/144905 geom [geom][gpart] panic in gpart_ctlreq when unplugging ca o bin/144521 geom geom(1) tool parsing non-subclass command broken o kern/143455 geom gstripe(8) in RELENG_8 (31st Jan 2010) broken o kern/142563 geom [geom] [hang] ioctl freeze in zpool f kern/142365 geom [geom] FreeBSD RAID1 (gmirror) is much slower than Lin o kern/141740 geom [geom] gjournal(8): g_journal_destroy concurrent error s kern/141235 geom [geom_part] 8.0 no longer provides /dev entries for al o kern/140352 geom [geom] gjournal + glabel not working 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 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 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/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 f kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad 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/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 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 60 problems total. From owner-freebsd-geom@FreeBSD.ORG Mon Sep 6 16:55:10 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E14F010656D3 for ; Mon, 6 Sep 2010 16:55:10 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 947B78FC1B for ; Mon, 6 Sep 2010 16:55:10 +0000 (UTC) Received: by qwg5 with SMTP id 5so4332202qwg.13 for ; Mon, 06 Sep 2010 09:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=znVU9Zxps0XO5F8KxKtOPILDEwPmXLfMISJ4vWOwYsw=; b=CHqNZvkHjeCGshdPpRCStawtroz2xi8aCqBwYIBVNmZsQ7WcEmgBd6RMX/4fNBsBq1 Msyrw9bvJY2YYXw1AvamRWObkdlVi8s37xCgl/w7i/gPeYq5I0YLc8CBkr0QbJNgy3yP iGem68ow49pNvygAbEFR52+BylfWl0GUFpcgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=H52DfWOO+XZcvQ3iM7iRQHTgY8Kh/ID0+utqCcZVagk/ZEtqRBzKkcqx+N3fc07asc uNOXuwYDubZR44YblRUc4YjZ3Ie8rVf6aevUtAiZm89ImmvhKd6dkCLQKlogLuPYXgqE FR4uWzs8IlZ/PMzpQkp3P3tPdv0g0UV8OLbCI= Received: by 10.229.220.78 with SMTP id hx14mr1563093qcb.148.1283790265995; Mon, 06 Sep 2010 09:24:25 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-137-20.dsl.klmzmi.sbcglobal.net [99.181.137.20]) by mx.google.com with ESMTPS id r38sm5783468qcs.2.2010.09.06.09.24.23 (version=SSLv3 cipher=RC4-MD5); Mon, 06 Sep 2010 09:24:24 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C8515B6.4080304@DataIX.net> Date: Mon, 06 Sep 2010 12:24:22 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100806 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Takanori Watanabe References: <201009051815.o85IFmsa024096@sana.init-main.com> In-Reply-To: <201009051815.o85IFmsa024096@sana.init-main.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: UDF label function patch. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 16:55:11 -0000 Can you file this here: http://www.freebsd.org/send-pr.html as a misc/change-request so it does not get lost ? Would be awesome! On 09/05/2010 14:15, Takanori Watanabe wrote: > I wrote a patch to add UDF support on geom label module. > How about it? > > Index: sys/conf/files > =================================================================== > --- sys/conf/files (revision 212175) > +++ sys/conf/files (working copy) > @@ -2023,6 +2023,7 @@ > geom/label/g_label_msdosfs.c optional geom_label > geom/label/g_label_ntfs.c optional geom_label > geom/label/g_label_reiserfs.c optional geom_label > +geom/label/g_label_udf.c optional geom_label > geom/label/g_label_ufs.c optional geom_label > geom/label/g_label_gpt.c optional geom_label > geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm > Index: sbin/geom/class/label/glabel.8 > =================================================================== > --- sbin/geom/class/label/glabel.8 (revision 212175) > +++ sbin/geom/class/label/glabel.8 (working copy) > @@ -109,6 +109,9 @@ > CD ISO9660 (directory > .Pa /dev/iso9660/ ) . > .It > +DVD UDF (directory > +.Pa /dev/udf/ ) . > +.It > EXT2FS (directory > .Pa /dev/ext2fs/ ) . > .It > Index: sys/geom/label/g_label_udf.c > =================================================================== > --- sys/geom/label/g_label_udf.c (revision 0) > +++ sys/geom/label/g_label_udf.c (revision 0) > @@ -0,0 +1,168 @@ > +/*- > + * Copyright (c) 2010 Takanori Watanabe > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#define G_LABEL_UDF_DIR "udf" > +#define LOGICAL_SECTOR_SIZE 2048 > +#define UDF_OFFSET (256*LOGICAL_SECTOR_SIZE) > +#define VOLUME_LEN 16 > + > +static int > +g_label_udf_checktag(struct desc_tag *tag, uint16_t id) > +{ > + uint8_t *itag; > + uint8_t i, cksum = 0; > + > + itag = (uint8_t *)tag; > + > + if (le16toh(tag->id) != id) > + return (EINVAL); > + > + for (i = 0; i < 16; i++) > + cksum = cksum + itag[i]; > + cksum = cksum - itag[4]; > + > + if (cksum == tag->cksum) > + return (0); > + > + return (EINVAL); > +} > +static int > +g_label_udf_uncompress_unicode(unsigned char *dest,unsigned char *src, int size,int srcsize) > +{ > + int i,j; > + unsigned short unichar; > + if(src[0] == 8){ > + strlcpy(dest, src+1 , size); > + return 0; > + }else if(src[0] == 16){ > + /*Encode as UTF-8*/ > + for(j = 0,i = 1; i < srcsize; i+=2){ > + unichar = src[i]<<8|src[i+1]; > + if(unichar == 0){ > + *dest = 0; > + return 0; > + } > + if(unichar < 0x7f){ > + j++; > + if(j > size){ > + *dest = 0; > + return 0; > + } > + *dest++ = unichar; > + }else if(unichar < 0x7ff){ > + j += 2 ; > + if(j > size){ > + *dest = 0; > + return 0; > + } > + *dest++ = ((unichar>>6)&0x1f)|0xc0; > + *dest++ = (unichar &0x3f)|0x80; > + }else{ > + j+= 3; > + if(j > size){ > + *dest = 0; > + return 0; > + } > + *dest++ = ((unichar>>12)&0x0f)|0xe0; > + *dest++ = ((unichar>>6)&0x3f)|0x80; > + *dest++ = (unichar&0x3f)|0x80; > + } > + } > + } > + > + return 1; > +} > + > +static void > +g_label_udf_taste(struct g_consumer *cp, char *label, size_t size) > +{ > + struct g_provider *pp; > + unsigned char *sector = NULL; > + unsigned char *volume = NULL; > + int i; > + struct anchor_vdp *avdp; > + struct logvol_desc *logvol; > + > + g_topology_assert_not(); > + pp = cp->provider; > + label[0] = '\0'; > + > + if ((UDF_OFFSET % pp->sectorsize) != 0) > + return; > + sector = (unsigned char *)g_read_data(cp, UDF_OFFSET, pp->sectorsize, > + NULL); > + if (sector == NULL) > + return; > + > + if (g_label_udf_checktag((struct desc_tag *)sector, TAGID_ANCHOR) != 0) { > + goto end; > + } > + avdp = (struct anchor_vdp *) sector; > + for(i = 0; i < avdp->main_vds_ex.len; i+= LOGICAL_SECTOR_SIZE){ > + volume =(unsigned char *) > + g_read_data(cp, > + LOGICAL_SECTOR_SIZE > + *avdp->main_vds_ex.loc + i, > + LOGICAL_SECTOR_SIZE, > + NULL); > + if (g_label_udf_checktag((struct desc_tag *)volume, > + TAGID_LOGVOL) != 0) { > + g_free(volume); > + continue; > + } > + logvol = (struct logvol_desc *)volume; > + G_LABEL_DEBUG(1, "UDF file system detected on %s.", pp->name); > + if(g_label_udf_uncompress_unicode(label, logvol->logvol_id, size, sizeof(logvol->logvol_id))!= 0){ > + label[0] = '\0'; > + } > + break; > + } > +end: > + if(sector){ > + g_free(sector); > + } > + if(volume){ > + g_free(volume); > + } > +} > + > +struct g_label_desc g_label_udf = { > + .ld_taste = g_label_udf_taste, > + .ld_dir = G_LABEL_UDF_DIR, > + .ld_enabled = 1 > +}; > +G_LABEL_INIT(udf, g_label_udf, "Create device nodes for UDF volumes"); > Index: sys/geom/label/g_label.c > =================================================================== > --- sys/geom/label/g_label.c (revision 212175) > +++ sys/geom/label/g_label.c (working copy) > @@ -78,6 +78,7 @@ > const struct g_label_desc *g_labels[] = { > &g_label_ufs_id, > &g_label_ufs_volume, > + &g_label_udf, > &g_label_iso9660, > &g_label_msdosfs, > &g_label_ext2fs, > Index: sys/geom/label/g_label.h > =================================================================== > --- sys/geom/label/g_label.h (revision 212175) > +++ sys/geom/label/g_label.h (working copy) > @@ -80,6 +80,7 @@ > /* Supported labels. */ > extern struct g_label_desc g_label_ufs_id; > extern struct g_label_desc g_label_ufs_volume; > +extern struct g_label_desc g_label_udf; > extern struct g_label_desc g_label_iso9660; > extern struct g_label_desc g_label_msdosfs; > extern struct g_label_desc g_label_ext2fs; > Index: sys/modules/geom/geom_label/Makefile > =================================================================== > --- sys/modules/geom/geom_label/Makefile (revision 212175) > +++ sys/modules/geom/geom_label/Makefile (working copy) > @@ -10,6 +10,7 @@ > SRCS+= g_label_msdosfs.c > SRCS+= g_label_ntfs.c > SRCS+= g_label_reiserfs.c > +SRCS+= g_label_udf.c > SRCS+= g_label_ufs.c > > .include > _______________________________________________ > 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" -- jhell,v From owner-freebsd-geom@FreeBSD.ORG Mon Sep 6 19:39:26 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AAC21065693 for ; Mon, 6 Sep 2010 19:39:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3763F8FC0A for ; Mon, 6 Sep 2010 19:39:25 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3297045C9F; Mon, 6 Sep 2010 21:39:24 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4B41B45C9B; Mon, 6 Sep 2010 21:39:19 +0200 (CEST) Date: Mon, 6 Sep 2010 21:39:07 +0200 From: Pawel Jakub Dawidek To: Takanori Watanabe Message-ID: <20100906193907.GC1956@garage.freebsd.pl> References: <201009051815.o85IFmsa024096@sana.init-main.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O3RTKUHj+75w1tg5" Content-Disposition: inline In-Reply-To: <201009051815.o85IFmsa024096@sana.init-main.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: UDF label function patch. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 19:39:26 -0000 --O3RTKUHj+75w1tg5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 06, 2010 at 03:15:47AM +0900, Takanori Watanabe wrote: > I wrote a patch to add UDF support on geom label module.=20 > How about it? The patch seems useful, so I'm happy with it going in, but before you do that, could you please try to make it style(9)-clean? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --O3RTKUHj+75w1tg5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyFQ1oACgkQForvXbEpPzSU5QCgi59SFNrGj+Kcm4KoNgiAn0nE f2gAoLWff9DhLQ0x8ppwhjX/tSvk07NQ =KCg3 -----END PGP SIGNATURE----- --O3RTKUHj+75w1tg5-- From owner-freebsd-geom@FreeBSD.ORG Mon Sep 6 22:19:11 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DD7510656A4; Mon, 6 Sep 2010 22:19:11 +0000 (UTC) (envelope-from arundel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3574B8FC16; Mon, 6 Sep 2010 22:19:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o86MJBOe009383; Mon, 6 Sep 2010 22:19:11 GMT (envelope-from arundel@freefall.freebsd.org) Received: (from arundel@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o86MJBFX009379; Mon, 6 Sep 2010 22:19:11 GMT (envelope-from arundel) Date: Mon, 6 Sep 2010 22:19:11 GMT Message-Id: <201009062219.o86MJBFX009379@freefall.freebsd.org> To: arundel@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-geom@FreeBSD.org From: arundel@FreeBSD.org Cc: Subject: Re: kern/150334: [geom] [udf] [patch] geom label does not support UDF X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 22:19:11 -0000 Old Synopsis: geom label does not support UDF New Synopsis: [geom] [udf] [patch] geom label does not support UDF Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: arundel Responsible-Changed-When: Mon Sep 6 22:16:51 UTC 2010 Responsible-Changed-Why: Assign to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=150334 From owner-freebsd-geom@FreeBSD.ORG Tue Sep 7 15:23:42 2010 Return-Path: Delivered-To: geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5733710656D9 for ; Tue, 7 Sep 2010 15:23:42 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0608B8FC20 for ; Tue, 7 Sep 2010 15:23:41 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3AACD.dip.t-dialin.net [87.179.170.205]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id A21CE844010; Tue, 7 Sep 2010 17:05:29 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id C35941133; Tue, 7 Sep 2010 17:05:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1283871926; bh=KQYdwzp1DsxJT+ppUWtZTqw/gy2OgEfusZD/fY9NGr8=; h=Message-ID:Date:From:To:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=QtDDCgioSBPGs9vpnPYniZg/1b+ejesBMTIEpiY+aPd8wILJj8kQkO3fyFn8iHd3M mcF/TM3pdj6BC0quE/Ty0yOZSsMMPchE2LmaqNQF0Q0bFaWEC4Qo+e8AdadkSVhIkO mdlM1YETQ6yrXDOP9PVE+3tgrmAlP95jIHlBvet2Orr4EcXdxet/fXTHP0wwCNaYcD EO31USfSyawW29KnDniJJQtIazHA1anSWrdrm+f6n1j1oqtotVIHq+eE6JshRUoZMD esT404YcJjaSKRk3NWHN4fdQf/d/156o3pvfdkEtzNUc1VKusTNexsFxA/LEPvNYdd nmRwPqxM0JlVw== Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o87F5QaA021453; Tue, 7 Sep 2010 17:05:26 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 07 Sep 2010 17:05:26 +0200 Message-ID: <20100907170526.834646wxfkh4sou8@webmail.leidinger.net> Date: Tue, 07 Sep 2010 17:05:26 +0200 From: Alexander Leidinger To: geom@FreeBSD.org, mav@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: A21CE844010.A75CF X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.1, required 6, autolearn=disabled, ALL_TRUSTED -1.00, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1284476732.27925@7y+kdlOz0Kh20nG4QaRBvQ X-EBL-Spam-Status: No X-Mailman-Approved-At: Tue, 07 Sep 2010 15:41:59 +0000 Cc: Subject: Determinig removable devices in shell scripts? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 15:23:42 -0000 Hi, is there an easy way to determine in a shell script if a device (da/ada) is removable (USB memory stick, eSATA connection)? I was thinking more or less about something like "sysctl kern.disks". Bye, Alexander. -- Pardon me, but do you know what it means to be TRULY ONE with your BOOTH! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-freebsd-geom@FreeBSD.ORG Tue Sep 7 18:13:31 2010 Return-Path: Delivered-To: geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5283310656EC for ; Tue, 7 Sep 2010 18:13:31 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 85A0B8FC26 for ; Tue, 7 Sep 2010 18:13:30 +0000 (UTC) Received: by bwz20 with SMTP id 20so5276608bwz.13 for ; Tue, 07 Sep 2010 11:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=BEJemUbxLZrHPQxskU3oUPflwco+whIiqAIVnBpwiyc=; b=Rzfh9SwXlUHR5urSfxdNDLkFGmzWOwxHl3ZdvP0kva6Gl4v7N8gdJGA9/B9Ocu+f+D D7Md2mOI/tuY/igBRg7p/gzVe9aineNPdZmJW6B/Jq375mkIL1foa4jVzLP1fQSEeNUf 0a8QT4vz3VIAoM0eP3C6Uc8F3hCKpDfQaXfJM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=CiKWMnl8GowoEndWd3CFyFPB5LfpyD2BHuKiWTmrdICOd7y0ByI+saTnZukTlos9CJ giL36zy2ccAYQ9nqQMhyNpGZB1yeUbBeiLe5CKEY910prl4xkBjyKMlO1N+zROgr69Pv Hws0cn3fq4FnbjGlAE4wGQO+aaXDum14M1wMs= Received: by 10.204.85.89 with SMTP id n25mr4253560bkl.105.1283879858782; Tue, 07 Sep 2010 10:17:38 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 11sm5484291bkj.11.2010.09.07.10.17.36 (version=SSLv3 cipher=RC4-MD5); Tue, 07 Sep 2010 10:17:37 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C8673A0.6070605@FreeBSD.org> Date: Tue, 07 Sep 2010 20:17:20 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Alexander Leidinger References: <20100907170526.834646wxfkh4sou8@webmail.leidinger.net> In-Reply-To: <20100907170526.834646wxfkh4sou8@webmail.leidinger.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: geom@FreeBSD.org Subject: Re: Determinig removable devices in shell scripts? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 18:13:31 -0000 Hi. Alexander Leidinger wrote: > is there an easy way to determine in a shell script if a device (da/ada) > is removable (USB memory stick, eSATA connection)? I was thinking more > or less about something like "sysctl kern.disks". There is two kinds of removability - removable media and removable device. For removable media: SCSI/ATAPI disks (da) report different device types for fixed disks (HDD) and removable (ZIP, FDD, card readers, ...). It can be found via `camcontrol inquiry daX`. I haven't heard about ATA (non-ATAPI) disks with removable media, though specifications last time include dedicated fields for media serial number, which may mean removable media. For removable devices: I believe it is controller of even more - platform dependent. For USB it probably may be assumed by default, for others it depends. All I have seen - AHCI controller have two bits per port defining different kind of removability. You may see them during verbose boot. But BIOS vendors often not bothering to fill them correctly even if some ports wired to external connectors. To get information about controller, you may try `camcontrol negotiate ada0 -v`. -- Alexander Motin From owner-freebsd-geom@FreeBSD.ORG Wed Sep 8 12:32:26 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F4110656B4 for ; Wed, 8 Sep 2010 12:32:26 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id E80488FC19 for ; Wed, 8 Sep 2010 12:32:25 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o88CW9tO028521; Wed, 8 Sep 2010 14:32:24 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o88CW9RX028520; Wed, 8 Sep 2010 14:32:09 +0200 (CEST) (envelope-from olli) Date: Wed, 8 Sep 2010 14:32:09 +0200 (CEST) Message-Id: <201009081232.o88CW9RX028520@lurza.secnetix.de> From: Oliver Fromme To: freebsd-geom@FreeBSD.ORG, Alexander@leidinger.net In-Reply-To: <20100907170526.834646wxfkh4sou8@webmail.leidinger.net> X-Newsgroups: list.freebsd-geom User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Wed, 08 Sep 2010 14:32:24 +0200 (CEST) Cc: Subject: Re: Determinig removable devices in shell scripts? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-geom@FreeBSD.ORG, Alexander@leidinger.net List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 12:32:26 -0000 Alexander Leidinger wrote: > is there an easy way to determine in a shell script if a device > (da/ada) is removable (USB memory stick, eSATA connection)? I was > thinking more or less about something like "sysctl kern.disks". USB devices are easy, just check if the da(4) device is connected to umass. I think camcontrol will tell you. Same with FireWire devices via sbp(4). eSATA might be more difficult. Finally, there are cases where it's pretty much impossible to detect. I've got a hot-swap frame for P-ATA hard drives which I use for backups, using atacontrol(8) attach/detach/ reinit, so it's basically a removable device. But it's completely transparent to the OS, i.e. there is no way to determine if a certain ad(4) device is located in such a swappable frame or not. Well ... if the device was not present during boot (see /var/run/dmesg.boot), then it is obviously removable, but the reverse isn't true since a removable device might be already present during boot, so that's not a complete solution to the problem. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd One Unix to rule them all, One Resolver to find them, One IP to bring them all and in the zone to bind them. From owner-freebsd-geom@FreeBSD.ORG Wed Sep 8 12:39:50 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55A5D10656D0 for ; Wed, 8 Sep 2010 12:39:50 +0000 (UTC) (envelope-from zeus@relay.ibs.dn.ua) Received: from relay.ibs.dn.ua (relay1.ibs.dn.ua [91.216.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 42C8A8FC2A for ; Wed, 8 Sep 2010 12:39:48 +0000 (UTC) Received: from relay.ibs.dn.ua (localhost [127.0.0.1]) by relay.ibs.dn.ua with ESMTP id o88CMBqd055050 for ; Wed, 8 Sep 2010 15:22:11 +0300 (EEST) Received: (from zeus@localhost) by relay.ibs.dn.ua (8.14.4/8.14.4/Submit) id o88CM9xk055039 for freebsd-geom@freebsd.org; Wed, 8 Sep 2010 15:22:09 +0300 (EEST) Date: Wed, 8 Sep 2010 15:22:09 +0300 From: Zeus V Panchenko To: freebsd-geom@freebsd.org Message-ID: <20100908122209.GA2669@relay.ibs.dn.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 8.1-RELEASE X-Editor: GNU Emacs 23.2.1 Subject: gmirror: how to use unused space after hdd-s upgrade X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 12:39:50 -0000 Hi All, if offtopic, please excuse me, but i didn't find the correct answer yet ... so, i have: #> dmesg | grep ada ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-8 SATA 2.x device ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C) ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 ada1: ATA-7 SATA 2.x device ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada1: Command Queueing enabled ada1: 239372MB (490234752 512 byte sectors: 16H 63S/T 16383C) #> gmirror list Geom name: gm0 State: COMPLETE Components: 2 Balance: load Slice: 4096 Flags: NONE GenID: 1 SyncID: 5 ID: 3265418851 Providers: 1. Name: mirror/gm0 Mediasize: 251000192512 (234G) Sectorsize: 512 Mode: r5w5e14 Consumers: 1. Name: ada1 Mediasize: 251000193024 (234G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 1 SyncID: 5 ID: 3507101685 2. Name: ada0 Mediasize: 500107862016 (466G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 1 SyncID: 5 ID: 2360533566 #> df -h Filesystem Size Used Avail Capacity Mounted on /dev/mirror/gm0s1a 989M 110M 800M 12% / devfs 1.0K 1.0K 0B 100% /dev /dev/mirror/gm0s1f 142G 1.8G 129G 1% /storage /dev/mirror/gm0s1d 19G 4.6G 13G 26% /usr /dev/mirror/gm0s1e 48G 26G 19G 58% /var #> mount /dev/mirror/gm0s1a on / (ufs, local) devfs on /dev (devfs, local, multilabel) /dev/mirror/gm0s1f on /storage (ufs, local, soft-updates) /dev/mirror/gm0s1d on /usr (ufs, local, soft-updates) /dev/mirror/gm0s1e on /var (ufs, local, soft-updates) i want to upgrade consumer ada1 to the same size/geometry as ada0 and to extend /dev/mirror/gm0s1f to use all rest available unused space ... so, how can i do that correct way, please? am i correct to think it can be done such way? 1. to remove small ada1 and install new hdd (equal to ada0) 2. gmirror remove gm0 ada1 gmirror forget ada1 growfs /dev/mirror/gm0s1f gmirror insert gm0 ada1 thanks in advance -- Zeus V. Panchenko IT Dpt., IBS ltd GMT+2 (EET) From owner-freebsd-geom@FreeBSD.ORG Wed Sep 8 13:47:24 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6028910656DE for ; Wed, 8 Sep 2010 13:47:24 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 15E9A8FC15 for ; Wed, 8 Sep 2010 13:47:24 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OtKzi-0000Av-EX for freebsd-geom@freebsd.org; Wed, 08 Sep 2010 15:47:22 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Sep 2010 15:47:22 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Sep 2010 15:47:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Wed, 08 Sep 2010 15:47:12 +0200 Lines: 57 Message-ID: References: <20100908122209.GA2669@relay.ibs.dn.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100518 Thunderbird/3.0.4 In-Reply-To: <20100908122209.GA2669@relay.ibs.dn.ua> X-Enigmail-Version: 1.0.1 Subject: Re: gmirror: how to use unused space after hdd-s upgrade X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 13:47:24 -0000 On 09/08/10 14:22, Zeus V Panchenko wrote: > #> gmirror list > > Geom name: gm0 > State: COMPLETE > Components: 2 > Balance: load > Slice: 4096 > Flags: NONE > GenID: 1 > SyncID: 5 > ID: 3265418851 > Providers: > 1. Name: mirror/gm0 > Mediasize: 251000192512 (234G) > Sectorsize: 512 > Mode: r5w5e14 > Consumers: > 1. Name: ada1 > Mediasize: 251000193024 (234G) > Sectorsize: 512 > Mode: r1w1e1 > State: ACTIVE > Priority: 0 > Flags: DIRTY > GenID: 1 > SyncID: 5 > ID: 3507101685 > 2. Name: ada0 > Mediasize: 500107862016 (466G) > Sectorsize: 512 > Mode: r1w1e1 > State: ACTIVE > Priority: 0 > Flags: DIRTY > GenID: 1 > SyncID: 5 > ID: 2360533566 > > i want to upgrade consumer ada1 to the same size/geometry as ada0 and > to extend /dev/mirror/gm0s1f to use all rest available unused space ... If by "upgrade" you mean replace it with a disk of the same size as the other one then yes, it can be done that way. If you mean change the partition table on either of the drive so it's out of sync with the other drive then no, mirrors don't work that way. > so, how can i do that correct way, please? In theory, you *could* mirror the whole ada1 to one partition of ada0 and use the rest of space on ada0 for a second partition in the same partition table, GEOM supports such gimmickry, but that would make the drive unbootable. From owner-freebsd-geom@FreeBSD.ORG Wed Sep 8 14:12:08 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0007810656DA for ; Wed, 8 Sep 2010 14:12:07 +0000 (UTC) (envelope-from zeus@relay.ibs.dn.ua) Received: from relay.ibs.dn.ua (relay1.ibs.dn.ua [91.216.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4D98FC15 for ; Wed, 8 Sep 2010 14:12:06 +0000 (UTC) Received: from relay.ibs.dn.ua (localhost [127.0.0.1]) by relay.ibs.dn.ua with ESMTP id o88EC4Eh080676; Wed, 8 Sep 2010 17:12:04 +0300 (EEST) Received: (from zeus@localhost) by relay.ibs.dn.ua (8.14.4/8.14.4/Submit) id o88EC4nD080675; Wed, 8 Sep 2010 17:12:04 +0300 (EEST) Date: Wed, 8 Sep 2010 17:12:04 +0300 From: Zeus V Panchenko To: Ivan Voras Message-ID: <20100908141204.GB68517@relay.ibs.dn.ua> References: <20100908122209.GA2669@relay.ibs.dn.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 8.1-RELEASE X-Editor: GNU Emacs 23.2.1 Cc: freebsd-geom@freebsd.org Subject: Re: gmirror: how to use unused space after hdd-s upgrade X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2010 14:12:08 -0000 Ivan Voras (ivoras@freebsd.org) [10.09.08 16:47] wrote: > On 09/08/10 14:22, Zeus V Panchenko wrote: > > >#> gmirror list > > > >Geom name: gm0 > >State: COMPLETE > >Components: 2 > >Balance: load > >Slice: 4096 > >Flags: NONE > >GenID: 1 > >SyncID: 5 > >ID: 3265418851 > >Providers: > >1. Name: mirror/gm0 > > Mediasize: 251000192512 (234G) > > Sectorsize: 512 > > Mode: r5w5e14 > >Consumers: > >1. Name: ada1 > > Mediasize: 251000193024 (234G) > > Sectorsize: 512 > > Mode: r1w1e1 > > State: ACTIVE > > Priority: 0 > > Flags: DIRTY > > GenID: 1 > > SyncID: 5 > > ID: 3507101685 > >2. Name: ada0 > > Mediasize: 500107862016 (466G) > > Sectorsize: 512 > > Mode: r1w1e1 > > State: ACTIVE > > Priority: 0 > > Flags: DIRTY > > GenID: 1 > > SyncID: 5 > > ID: 2360533566 > > > > >i want to upgrade consumer ada1 to the same size/geometry as ada0 and > >to extend /dev/mirror/gm0s1f to use all rest available unused space ... > > If by "upgrade" you mean replace it with a disk of the same size as the > other one then yes, it can be done that way. yes, i mean replacement of ada1 with the drive the same as ada0 and, am i correct to think that growfs /dev/mirror/gm0s1f will be enough to use the rest of the raw space? > If you mean change the partition table on either of the drive so > it's out of sync with the other drive then no, mirrors don't work > that way. but ada1 will be new one, no partition table on it yet ... > >so, how can i do that correct way, please? > > In theory, you *could* mirror the whole ada1 to one partition of ada0 > and use the rest of space on ada0 for a second partition in the same > partition table, GEOM supports such gimmickry, but that would make the > drive unbootable. ok, than only growfs? no fdisk, but can i bsdlabel the rest of the raw space? -- Zeus V. Panchenko IT Dpt., IBS ltd GMT+2 (EET) From owner-freebsd-geom@FreeBSD.ORG Thu Sep 9 07:20:28 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73BC610656A9 for ; Thu, 9 Sep 2010 07:20:28 +0000 (UTC) (envelope-from s.dave.jones@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3180D8FC19 for ; Thu, 9 Sep 2010 07:20:28 +0000 (UTC) Received: by vws7 with SMTP id 7so1160026vws.13 for ; Thu, 09 Sep 2010 00:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=lswL+ylfSFAnOWHJAuSEwC364xCD7DlIRRVmeHb0yRo=; b=YnChrQk8Cu8CTHSJxKq6OPfhXE94E9AbOsfzzXGnZFgWVv+IRNgaQKZyGQOhNCDXOf L6RHj3vOau0rgNZlfiV50oL9nwkG1Dy0TRtGO2XPWXWWRrj10p4n/bMMX5iqKXa5pJOG 3ULIAdX2WFQITdJ94Fv7nFyUExqRT+kPxJpco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KBfexgrB92tPbTeAs3H1C83snykMCKeqvFCqLADHXMCoIKWq/XXwzg7t2L4ISG4OkZ AqNx65l4IojWi4ww/0yg9fn50SHB8+jLszCVDAKlka/8pGJWF+rLegxJvqI/66uJsFJV mvPDHiE+QFjQXhI7Wim1rLUoF9/OGxDl7h/aU= MIME-Version: 1.0 Received: by 10.220.157.143 with SMTP id b15mr369295vcx.120.1284014977719; Wed, 08 Sep 2010 23:49:37 -0700 (PDT) Received: by 10.220.202.138 with HTTP; Wed, 8 Sep 2010 23:49:37 -0700 (PDT) Date: Thu, 9 Sep 2010 14:49:37 +0800 Message-ID: From: dave jones To: freebsd-geom@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 07:20:28 -0000 Hi, I'm running FreeBSD 9-current. Since the bios supports ahci, I enable it and load ahci module with no problem. Here's the dmessage: # dmesg |grep ada0 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-7 SATA 2.x device ada0: 150.000MB/s transfers (SATA 1.x, UDMA5, PIO 512bytes) ada0: 61616MB (126189568 512 byte sectors: 16H 63S/T 16383C) However, when I run "gpart show ada0", I got: gpart: No such geom: ada0. I also load geom_mbr and geom_bsd modules, but it sill can't show ada0. Does anyone tell me how to solve that issue? Thanks. Best regards, Dave. From owner-freebsd-geom@FreeBSD.ORG Thu Sep 9 08:08:23 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBB8110656C5 for ; Thu, 9 Sep 2010 08:08:23 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from honeysuckle.london.02.net (honeysuckle.london.02.net [87.194.255.144]) by mx1.freebsd.org (Postfix) with ESMTP id A376B8FC14 for ; Thu, 9 Sep 2010 08:08:23 +0000 (UTC) Received: from unknown (94.193.93.212) by honeysuckle.london.02.net (8.5.124.10) id 4C884E6F0002F3DD; Thu, 9 Sep 2010 08:50:05 +0100 Date: Thu, 9 Sep 2010 08:50:07 +0100 From: Bruce Cran To: dave jones Message-ID: <20100909085007.00001b09@unknown> In-Reply-To: References: X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 08:08:23 -0000 On Thu, 9 Sep 2010 14:49:37 +0800 dave jones wrote: > However, when I run "gpart show ada0", I got: > gpart: No such geom: ada0. You'll need to create an MBR or GPT scheme on ada0 using gpart before it'll show up. -- Bruce Cran From owner-freebsd-geom@FreeBSD.ORG Thu Sep 9 09:23:27 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B15110656DA for ; Thu, 9 Sep 2010 09:23:27 +0000 (UTC) (envelope-from s.dave.jones@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD468FC1C for ; Thu, 9 Sep 2010 09:23:26 +0000 (UTC) Received: by vws7 with SMTP id 7so1254571vws.13 for ; Thu, 09 Sep 2010 02:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=/xOBHM9HQLLd0c+4RJ5A03Cn6p6hkCkADhdKt+HxaFc=; b=s44T6BRLakzeRB7d7vTvhjeK6qyPBZSTHGW0IVRr1vBX8K4hD7oqNwhlr6Cbz/y7KM 68Dc0FaAhRsNpFq2r6XI7axmo/YoiEf4VCJ2e1WjDa5YpKmhGNOZMp1Ib5NFrA3QSKar T31Dvt6AMLdSdEQJuJ/B1+AzcLSOXNbjVEz2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ZcjBVb8bilWYXy7cfSEErGYatR+MTbLYH6cI3bLh1KvQClAMnJsrDPiT4ndUyc+2D2 Ja5a+D/iwNWxJ8+YVCxgs3vbcye0JQ/S0RrPHQn4zB8CWmnI9Vwkl05Xf6NTVh0/usQ9 TM0GYWpzD6ORx7DWsSrNsz9fM0NMwqW91Vxn0= MIME-Version: 1.0 Received: by 10.220.121.134 with SMTP id h6mr637894vcr.111.1284024205984; Thu, 09 Sep 2010 02:23:25 -0700 (PDT) Received: by 10.220.202.138 with HTTP; Thu, 9 Sep 2010 02:23:25 -0700 (PDT) In-Reply-To: <20100909085007.00001b09@unknown> References: <20100909085007.00001b09@unknown> Date: Thu, 9 Sep 2010 17:23:25 +0800 Message-ID: From: dave jones To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-geom@freebsd.org Subject: Re: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 09:23:27 -0000 Hi Bruce, Thanks for the reply. I tried to run gpart create -s mbr ada0, I got: gpart: geom 'ada0': Operation not permitted Then I umount some partitions which are mounted on ada0, gpart shows partitions: # gpart show ada0 => 63 126189504 ada0 MBR (60G) 63 81919089 1 freebsd [active] (39G) 81919152 44255358 2 !12 (21G) 126174510 15057 - free - (7.4M) I don't know why? Did I miss something? Would you tell me, thanks. Regards, Dave. On Thu, Sep 9, 2010 at 3:50 PM, Bruce Cran wrote: > On Thu, 9 Sep 2010 14:49:37 +0800 > dave jones wrote: > >> However, when I run "gpart show ada0", I got: >> gpart: No such geom: ada0. > > You'll need to create an MBR or GPT scheme on ada0 using gpart before > it'll show up. > > -- > Bruce Cran > From owner-freebsd-geom@FreeBSD.ORG Thu Sep 9 12:01:44 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3578C10656C1 for ; Thu, 9 Sep 2010 12:01:44 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id DC9A48FC12 for ; Thu, 9 Sep 2010 12:01:43 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Otfp0-0003hw-7n for freebsd-geom@freebsd.org; Thu, 09 Sep 2010 14:01:42 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Sep 2010 14:01:42 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Sep 2010 14:01:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Thu, 09 Sep 2010 14:01:33 +0200 Lines: 28 Message-ID: References: <20100909085007.00001b09@unknown> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100518 Thunderbird/3.0.4 In-Reply-To: X-Enigmail-Version: 1.0.1 Subject: Re: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 12:01:44 -0000 On 09/09/10 11:23, dave jones wrote: > Hi Bruce, > > Thanks for the reply. I tried to run gpart create -s mbr ada0, I got: > gpart: geom 'ada0': Operation not permitted hmmm.... > Then I umount some partitions which are mounted on ada0, gpart shows partitions: HMMMMMM..... You did just try to erase your existing partitions on ada0 with "gpart create", did you? :) > # gpart show ada0 > => 63 126189504 ada0 MBR (60G) > 63 81919089 1 freebsd [active] (39G) > 81919152 44255358 2 !12 (21G) > 126174510 15057 - free - (7.4M) > > > I don't know why? Did I miss something? Would you tell me, thanks. I think you should first send a list of changes to the kernel and loaded kernel modules, as it looks like you changed something. Then, send the output of "mount" command with the partitions mounted. From owner-freebsd-geom@FreeBSD.ORG Fri Sep 10 02:50:24 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE2321065670 for ; Fri, 10 Sep 2010 02:50:23 +0000 (UTC) (envelope-from s.dave.jones@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA5F8FC0A for ; Fri, 10 Sep 2010 02:50:23 +0000 (UTC) Received: by vws7 with SMTP id 7so2348700vws.13 for ; Thu, 09 Sep 2010 19:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Xk0aaY/KQX6GGZ8T0fawGnv3y33m0/zCtEqkQRW+svI=; b=ARVtzCYoGqTi+0kCiHO3GvfUTGAFZfLpp7FCYCPlHyFB3YPa4Zbfrz/+Nj9yXK0pxC fZ8n4PGCCnCvXhb3tGWTVBrVkj1TCLerV+rciVEMqLBmJBiSZJT5sa7iMvhK5dSj2gOo Y5mAC9EPi60oeKoaDD4576bZBqxlAQtsrTgBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KI/Jdipa1aymxOaTD0KRXwfO3nzjuAJKkJ5rsIpXm4V3TBBU+7a8y97nMhL49C2uZ2 KiY+gABOzn1LCbeSOSK2gs1An+XtjXIawmGu9VH4qScw52kQLm8z07dRxYPpa8z6MpCE jzr9ZlLAUEVFNU0t+lFggXiZ74WY/uIh8SoV8= MIME-Version: 1.0 Received: by 10.220.49.16 with SMTP id t16mr82534vcf.199.1284087022602; Thu, 09 Sep 2010 19:50:22 -0700 (PDT) Received: by 10.220.202.138 with HTTP; Thu, 9 Sep 2010 19:50:22 -0700 (PDT) In-Reply-To: References: <20100909085007.00001b09@unknown> Date: Fri, 10 Sep 2010 10:50:22 +0800 Message-ID: From: dave jones To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-geom@freebsd.org Subject: Re: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 02:50:24 -0000 On Thu, Sep 9, 2010 at 8:01 PM, Ivan Voras wrote: > On 09/09/10 11:23, dave jones wrote: >> >> Hi Bruce, >> >> Thanks for the reply. I tried to run gpart create -s mbr ada0, I got: >> gpart: geom 'ada0': Operation not permitted > > hmmm.... > >> Then I umount some partitions which are mounted on ada0, gpart shows >> partitions: > > HMMMMMM..... > > You did just try to erase your existing partitions on ada0 with "gpart > create", did you? :) > >> # gpart show ada0 >> =3D> =A0 =A0 =A0 =A063 =A0126189504 =A0ada0 =A0MBR =A0(60G) >> =A0 =A0 =A0 =A0 =A063 =A0 81919089 =A0 =A0 1 =A0freebsd =A0[active] =A0(= 39G) >> =A0 =A081919152 =A0 44255358 =A0 =A0 2 =A0!12 =A0(21G) >> =A0 126174510 =A0 =A0 =A015057 =A0 =A0 =A0 =A0- free - =A0(7.4M) >> >> >> I don't know why? Did I miss something? Would you tell me, thanks. > > I think you should first send a list of changes to the kernel and loaded > kernel modules, as it looks like you changed something. Then, send the > output of "mount" command with the partitions mounted. Ok, in /boot/loader.conf, I have added the following: ahci_load=3D"YES" geom_mbr_load=3D"YES" msdosfs_iconv_load=3D"YES" # dmesg | grep ada0 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-7 SATA 2.x device ada0: 150.000MB/s transfers (SATA 1.x, UDMA5, PIO 512bytes) ada0: 61616MB (126189568 512 byte sectors: 16H 63S/T 16383C) # mount /dev/ad0s1a on / (ufs, NFS exported, local) devfs on /dev (devfs, local, multilabel) procfs on /proc (procfs, local) tmpfs on /tmp (tmpfs, local) devfs on /var/named/dev (devfs, local, multilabel) /dev/ada0s1 on /test1 (ufs, local, soft-updates) /dev/ada0s2 on /test2 (msdosfs, NFS exported, local) # gpart show ada0 gpart: No such geom: ada0. # umount /test1 && umount /test2 # gpart show ada0 =3D> 63 126189504 ada0 MBR (60G) 63 81919089 1 freebsd [active] (39G) 81919152 44255358 2 !12 (21G) 126174510 15057 - free - (7.4M) My question is why should I umount /test1 and /test2 then gpart can show ada0 partition. Any idea? Thank you very much! Regards, Dave. From owner-freebsd-geom@FreeBSD.ORG Fri Sep 10 03:45:33 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6AF106566B for ; Fri, 10 Sep 2010 03:45:33 +0000 (UTC) (envelope-from rick@rix.kiwi-computer.com) Received: from rix.kiwi-computer.com (66-191-70-202.static.stcd.mn.charter.com [66.191.70.202]) by mx1.freebsd.org (Postfix) with SMTP id 765E08FC08 for ; Fri, 10 Sep 2010 03:45:33 +0000 (UTC) Received: (qmail 7396 invoked by uid 2000); 10 Sep 2010 03:18:51 -0000 Date: Thu, 9 Sep 2010 22:18:51 -0500 From: "Rick C. Petty" To: freebsd-geom@freebsd.org Message-ID: <20100910031851.GA7066@rix.kiwi-computer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: it's a race between gmirror and UFS labels X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd2009@kiwi-computer.com List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 03:45:34 -0000 I've been struggling with GEOM_MIRROR over-aggressively dropping drives and it's causing some issues. I'm running 8.1-stable. Essentially I have gmirror'd disks, gpart partitions inside the mirror, and UFS labels on all my gpartitioned filesystems. Everything is fine as long as the mirror probes the disks first (which it does). The problem is that after kernel panics, gmirror often drops a disk: GEOM_MIRROR: Component ada0 (device fs0) broken, skipping. If it drops ada1, I have no problems, but if it drops ada0, then ada0 is subsequently probed for its GPT partitions, of which the secondary table is corrupt (probably because it's looking at the GEOM_MIRROR metadata). Unfortunately, it proceeds and then mounts all the UFS filesystems by label from /dev/ada0 instead of those in /dev/mirror/fs0 which is bad. This has happened a number of times and it's getting quite annoying. Not only is the rest of my mirror now invalid (as it's outdated with respect to /dev/ada0), but I have to bring the system down to single user mode to re-insert ada0 into that mirror. I don't mean to start another discussion about why mixing start-of-disk metadata magic with end-of-disk metadata magic is a bad thing. I just want some suggestions about how to prevent this from happening nearly every time GEOM_MIRROR drops a disk due to a panic. GEOM_MIRROR seems very aggressive when it comes to dropping disks and not describing why the disk is "broken", which should probably be fixed. Also GPT probes should probably be prioritized to choose other geom providers first (or maybe providers with the same name but correct secondary GPT tables should win over those with mismatched tables, but due to how GEOM probes I can't see that happening). Probably what *should* happen is that even though ada0 is rejected as a GEOM_MIRROR provider, it should be marked as belonging to that mirror regardless of whether it's broken. That way no other GEOMs will probe this provider. To me, it seems that gmirror's handling of brokenness is itself broken. So someone please tell me why gmirror doesn't keep ownership of the broken providers? One can always remove the broken providers manually. To me the current behavior seems way too aggressive. It's one thing if the G_MIRROR_MAGIC doesn't match, but quite another thing to have it marked as broken and thus released into the provider pool for other GEOMs to sample it at will. -- Rick C. Petty From owner-freebsd-geom@FreeBSD.ORG Fri Sep 10 09:46:56 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA0D106566B for ; Fri, 10 Sep 2010 09:46:56 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 931578FC17 for ; Fri, 10 Sep 2010 09:46:56 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ou0C5-0005GE-79 for freebsd-geom@freebsd.org; Fri, 10 Sep 2010 11:46:53 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 11:46:53 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Sep 2010 11:46:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Fri, 10 Sep 2010 11:46:45 +0200 Lines: 8 Message-ID: References: <20100909085007.00001b09@unknown> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100518 Thunderbird/3.0.4 In-Reply-To: X-Enigmail-Version: 1.0.1 Subject: Re: gpart cannot find ada0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 09:46:56 -0000 On 09/10/10 04:50, dave jones wrote: > Ok, in /boot/loader.conf, I have added the following: > geom_mbr_load="YES" Remove this line and report what happens then. From owner-freebsd-geom@FreeBSD.ORG Fri Sep 10 10:30:29 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE45D106564A for ; Fri, 10 Sep 2010 10:30:29 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1C98FC13 for ; Fri, 10 Sep 2010 10:30:29 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 42FEB19E02A; Fri, 10 Sep 2010 12:14:12 +0200 (CEST) Received: from [192.168.1.2] (ip-86-49-61-235.net.upcbroadband.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id A09F619E027; Fri, 10 Sep 2010 12:14:09 +0200 (CEST) Message-ID: <4C8A04EC.3090409@quip.cz> Date: Fri, 10 Sep 2010 12:14:04 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 MIME-Version: 1.0 To: rick-freebsd2009@kiwi-computer.com References: <20100910031851.GA7066@rix.kiwi-computer.com> In-Reply-To: <20100910031851.GA7066@rix.kiwi-computer.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: it's a race between gmirror and UFS labels and gjournal X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 10:30:29 -0000 Rick C. Petty wrote: > I've been struggling with GEOM_MIRROR over-aggressively dropping drives > and it's causing some issues. I'm running 8.1-stable. > > Essentially I have gmirror'd disks, gpart partitions inside the mirror, > and UFS labels on all my gpartitioned filesystems. Everything is fine > as long as the mirror probes the disks first (which it does). > > The problem is that after kernel panics, gmirror often drops a disk: > > GEOM_MIRROR: Component ada0 (device fs0) broken, skipping. > > If it drops ada1, I have no problems, but if it drops ada0, then ada0 > is subsequently probed for its GPT partitions, of which the secondary > table is corrupt (probably because it's looking at the GEOM_MIRROR > metadata). Unfortunately, it proceeds and then mounts all the UFS > filesystems by label from /dev/ada0 instead of those in /dev/mirror/fs0 > which is bad. The same problem is with gjournal on gmirror. If gmirror drops the disk, then gjournal is (sometimes) detected on the first "broken disk" and this disk cannot be re-inserted in to gmirror again. (I have this experience on 7.x). One must reboot in to single-user without gjournal module loaded and re-insert the disk in to gmirror. Miroslav Lachman From owner-freebsd-geom@FreeBSD.ORG Fri Sep 10 22:33:30 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 731AA1065674 for ; Fri, 10 Sep 2010 22:33:30 +0000 (UTC) (envelope-from rick@rix.kiwi-computer.com) Received: from rix.kiwi-computer.com (66-191-70-202.static.stcd.mn.charter.com [66.191.70.202]) by mx1.freebsd.org (Postfix) with SMTP id 09D238FC13 for ; Fri, 10 Sep 2010 22:33:29 +0000 (UTC) Received: (qmail 29859 invoked by uid 2000); 10 Sep 2010 22:33:29 -0000 Date: Fri, 10 Sep 2010 17:33:29 -0500 From: "Rick C. Petty" To: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <20100910223329.GB29252@rix.kiwi-computer.com> References: <20100910031851.GA7066@rix.kiwi-computer.com> <4C8A04EC.3090409@quip.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C8A04EC.3090409@quip.cz> User-Agent: Mutt/1.4.2.3i Cc: freebsd-geom@freebsd.org Subject: Re: it's a race between gmirror and UFS labels and gjournal X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd2009@kiwi-computer.com List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 22:33:30 -0000 On Fri, Sep 10, 2010 at 12:14:04PM +0200, Miroslav Lachman wrote: > > The same problem is with gjournal on gmirror. If gmirror drops the disk, > then gjournal is (sometimes) detected on the first "broken disk" and > this disk cannot be re-inserted in to gmirror again. (I have this > experience on 7.x). One must reboot in to single-user without gjournal > module loaded and re-insert the disk in to gmirror. I take back my earlier statement about booting into single-user. That didn't even work, because my root filesystem is on that mirror. I had to physically pull the cable off of one drive so that GEOM probed correctly and grabbed the mirror. Thankfully, the controller recognized when I plugged in the disk again (some controllers still don't, in FreeBSD), or I wouldn't have been able to get that other disk back into the mirror. And thankfully I had physical access to the machine. My condolences to those of you who run up against this broken behavior with remote machines. The point here is that there is some brokenness with GEOM probing. The fix that I hope to see is that gmirror doesn't drop the "broken" providers so that other GEOMs can taste them. It should instead hold on to those providers (yet marked as broken) and let the sysadmin decide how to handle it. In my case, I would wanted to do a "gmirror rebuild" after verifying the correct disks were mapped to the correct mirrors. With the current implementation, this just isn't possible. I'm hoping some can explain to me why broken providers are released back into GEOM for re-tasting. I'm willing to submit patches, but I haven't figured out why disks marked as broken aren't kept as part of the mirror in the first place. -- Rick C. Petty