backup a partition table with gpart(8)

Greg Rivers gcr+freebsd-geom at tharned.org
Thu Nov 18 20:44:33 UTC 2010


On Thu, 18 Nov 2010, Marcel Moolenaar wrote:

> On Nov 18, 2010, at 10:00 AM, Greg Rivers wrote:
>>
>> So instead of a special dump command or complicated XML formatting, 
>> just make "gpart show" output suitable for input (it's probably already 
>> close), and add the verb to read that input ("gpart read" or "gpart 
>> apply" or such).  Add the ability to handle wildcards and run the 
>> editor, and gpart could be as friendly to use as bsdlabel is.
>
> BTW: I don't think bsdlabel is friendly to use at all, so I certainly 
> hope not that gpart will become as friendly as bsdlabel. It would be a 
> regression :-)
>
> I would not try and mix functionality in a single command. Output 
> suitable for humans is ipso facto unsuitable for machines (and vice 
> versa). I'm sure there are exceptions, but I do not think gpart is one 
> of them.
>
> It's better to introduce gpart backup and gpart restore and have them 
> optimized for the purpose than it is to try and solve two independent 
> problems with gpart show, which already has its own problems of 
> providing user-friendly output.
>

I appreciate the humor, but I'd hazard a guess that I'm not the only one 
who misses bsdlabel's functionality in gpart. :-)  I did not intend what I 
said to be taken as criticism of gpart.

But bsdlabel's behavior is consistent with fdisk(8) too (-p, -f), and also 
with Solaris' prtvtoc(1M) and fmthard(1M).  Historically, it's pretty much 
expected that partition managers work that way or at least have that 
feature.

Maybe "gpart show" shouldn't be overloaded, but having something like 
"gpart backup" and "gpart restore" working on a format that's easily 
readable and editable by a person would be a real feature.

-- 
Greg


More information about the freebsd-geom mailing list