From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 25 12:50:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22B816A419 for ; Fri, 25 Jan 2008 12:50:02 +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 CEE7913C4D1 for ; Fri, 25 Jan 2008 12:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0PCo2mT053496 for ; Fri, 25 Jan 2008 12:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0PCo29t053495; Fri, 25 Jan 2008 12:50:02 GMT (envelope-from gnats) Resent-Date: Fri, 25 Jan 2008 12:50:02 GMT Resent-Message-Id: <200801251250.m0PCo29t053495@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Simun Mikecin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DB3016A417 for ; Fri, 25 Jan 2008 12:42:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 795BB13C457 for ; Fri, 25 Jan 2008 12:42:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0PCeQFQ098468 for ; Fri, 25 Jan 2008 12:40:26 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m0PCeQwv098467; Fri, 25 Jan 2008 12:40:26 GMT (envelope-from nobody) Message-Id: <200801251240.m0PCeQwv098467@www.freebsd.org> Date: Fri, 25 Jan 2008 12:40:26 GMT From: Simun Mikecin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/119976: Add ZFS support to gpt(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2008 12:50:03 -0000 >Number: 119976 >Category: bin >Synopsis: Add ZFS support to gpt(8) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 25 12:50:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Simun Mikecin >Release: 8.0-CURRENT >Organization: >Environment: >Description: sys/gpt.h has GPT_ENT_TYPE_FREEBSD_ZFS UUID defined, but gpt(8) doesn't recognize those partitions as FreeBSD ZFS. This patch adds: 1. support for recognizing those partitions ("show" command) 2. keyword "zfs" ("add" command) that can be used when adding new partitions (just like eg. "ufs"). 3. support for recognizing ZFS partitions stored in disklabel when migrating ("migrate" command) those partitions to GPT >How-To-Repeat: >Fix: Patch attached with submission follows: Files gpt.orig/add.o and gpt/add.o differ Files gpt.orig/boot.o and gpt/boot.o differ Files gpt.orig/create.o and gpt/create.o differ Files gpt.orig/destroy.o and gpt/destroy.o differ diff -urN gpt.orig/gpt.8 gpt/gpt.8 --- gpt.orig/gpt.8 2007-10-24 23:32:57.000000000 +0200 +++ gpt/gpt.8 2008-01-25 13:21:36.392875618 +0100 @@ -130,7 +130,7 @@ The type is given as an UUID, but .Nm accepts -.Cm boot , efi , swap , ufs , hfs , linux +.Cm boot , efi , swap , ufs , zfs, hfs , linux and .Cm windows as aliases for the most commonly used partition types. Files gpt.orig/gpt.o and gpt/gpt.o differ Files gpt.orig/label.o and gpt/label.o differ Files gpt.orig/map.o and gpt/map.o differ diff -urN gpt.orig/migrate.c gpt/migrate.c --- gpt.orig/migrate.c 2005-09-01 04:42:52.000000000 +0200 +++ gpt/migrate.c 2008-01-25 13:39:24.748139255 +0100 @@ -118,6 +118,13 @@ ent->ent_name, 36); break; } + case FS_ZFS: { + uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS; + le_uuid_enc(&ent->ent_type, &zfs); + utf8_to_utf16("FreeBSD ZFS partition", + ent->ent_name, 36); + break; + } default: warnx("%s: warning: unknown FreeBSD partition (%d)", device_name, dl->d_partitions[i].p_fstype); diff -urN gpt.orig/show.c gpt/show.c --- gpt.orig/show.c 2007-10-24 23:32:58.000000000 +0200 +++ gpt/show.c 2008-01-25 13:20:36.902299798 +0100 @@ -64,6 +64,7 @@ static uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; static uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS; static uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM; + static uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static char buf[80]; char *s; @@ -80,6 +81,8 @@ return ("FreeBSD UFS/UFS2"); if (uuid_equal(t, &vinum, NULL)) return ("FreeBSD vinum"); + if (uuid_equal(t, &zfs, NULL)) + return ("FreeBSD ZFS"); if (uuid_equal(t, &freebsd, NULL)) return ("FreeBSD legacy"); >Release-Note: >Audit-Trail: >Unformatted: