"deep" gpart backup?

Mark Felder feld at FreeBSD.org
Tue Jan 14 01:57:48 UTC 2014


On Jan 13, 2014, at 18:33, Marcel Moolenaar <marcel at xcllnt.net> wrote:

> 
> On Jan 11, 2014, at 9:27 AM, Mark Felder <feld at FreeBSD.org> wrote:
> 
>> On Sat, Jan 4, 2014, at 15:53, Lev Serebryakov wrote:
>>> Hello, Freebsd-geom.
>>> 
>>> Is here any way to make "deep" "gpart backup | gpart restore"? Now, when
>>> I
>>> have disk with MBR, with two slices, each of which has BSD label, I need
>>> three calls of backup / restore commands with proper arguments. It looks
>>> just stupid :)
>>> 
>> 
>> If gpart can see and manipulate all of these elements it really should
>> be able to backup and restore them all atomically.
> 
> This statement is close to being ridiculous. Being able to
> operate on all components is absolutely not a sufficient
> condition for doing atomic operations across a multitude
> of them. Atomicity is a very particular requirement.
> 

You're right. Throwing out that word without thinking carefully was not smart. After considering the bit of knowledge I have about how geom operates it wouldn't be able to go a layer deeper without tasting first unless we somehow teach gpart how to prepare transactions and write the labels all at once, then re-taste the device. Probably more difficult than it's worth. I imagine a batch transaction that rolls back to the previous state could be achieved. Though we all know the attempt would taint any existing data, but if you're attempting this you should have already said your farewells to the data anyway :-)

> Note also that gpart (in its most vague definition) cannot
> actually manipulate on *all* elements at the same time.
> Nested partitioning schemes are not seen by the gpart
> invocation that works on the outer-most container. Only
> when running gpart on a partition will it (= gpart) be
> able to work on the nested partitions. As such, no single
> gpart invocation sees all levels of nesting.
> 

Aha, one step ahead of me :-)

> gpart is an inherently low-level utility and what you want
> is intended (i.e. by design) to be handled at an application
> layer above gpart.
> 

It's pretty low level, but it does seem to be missing some features I would expect in such a low level utility such as the ability to create partitions with custom IDs. Being limited to the handful defined in the gpart man page has caused me problems a few times. See: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html which are almost all included in the Linux fdisk utility.

Annnnd now something at the end of the gpart man page just caught my eye:

AUTHORS
     Marcel Moolenaar <marcel at FreeBSD.org>


I'll see my way out :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20140113/ce167e07/attachment.sig>


More information about the freebsd-geom mailing list