From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 9 09:00:29 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1789B16A528 for ; Fri, 9 Mar 2007 09:00:29 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id C110113C4A5 for ; Fri, 9 Mar 2007 09:00:28 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2990S44088053 for ; Fri, 9 Mar 2007 09:00:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2990SE9088052; Fri, 9 Mar 2007 09:00:28 GMT (envelope-from gnats) Date: Fri, 9 Mar 2007 09:00:28 GMT Message-Id: <200703090900.l2990SE9088052@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Alex Kozlov Cc: Subject: Re: bin/92723: [feature request] fdisk(8) should be able to output current slice table in configuration file format X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alex Kozlov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2007 09:00:29 -0000 The following reply was made to PR bin/92723; it has been noted by GNATS. From: Alex Kozlov To: bug-followup@FreeBSD.org, jau@iki.fi, spam@rm-rf.kiev.ua Cc: Subject: Re: bin/92723: [feature request] fdisk(8) should be able to output current slice table in configuration file format Date: Fri, 9 Mar 2007 10:52:01 +0200 On Fri, Mar 09, 2007 at 07:30:10AM +0000, Jukka A. Ukkonen wrote: > Quoting Alex Kozlov: > > > > fdisk -s is close enough > > If you are willing to do somewhat slow and also error prone > manual labor to recreate the exact same slices you have had > on another disk, then it is close enough. > > If you want a production level approach to be always able > to automatically rebuild the same slices from another disk, > it is not close enough. > You now have to either manually convert the incompatible > current output to a compatible input file or manually feed > whatever slice specifications to rebuild. > Neither of which is really "production quality automation". fdisk -s $dev|perl -ne 'if(/^(.*?):\s+(\d+)\s+cyl\s+(\d+)\s+hd\s+(\d+)\s+sec/)\ {print "g c387621 h16 s63\n"}elsif(/^\s+(\d+):\s+(\d+)\s+(\d+)\s+([\da-z]+)\ \s+([\da-z]+)\s*$/){print "p $1 $4 $2 $3\n";if ($5 eq "0x80"){print"a $1\n"}}' Too lazy to write in awk or shell. Sorry. > We already have bsdlabel/disklabel reading and writing the > same format which allows copying and rebuilding the exact > same partitions. > We already have "mount -p" to print out all currently mounted > volumes or individual new mount points as fstab entries to > automate mounting selected volumes to the same locations they > are currently mounted to. Generally, I do not object against this functionality. But more useful enhancement to fdisk like pr 68312 or 40597 were not commited, so this has a slim chances. -- Adios