Date: Fri, 9 Mar 2007 09:00:28 GMT From: Alex Kozlov <spam@rm-rf.kiev.ua> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/92723: [feature request] fdisk(8) should be able to output current slice table in configuration file format Message-ID: <200703090900.l2990SE9088052@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/92723; it has been noted by GNATS. From: Alex Kozlov <spam@rm-rf.kiev.ua> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703090900.l2990SE9088052>