backup a partition table with gpart(8)

Andrey V. Elsukov bu7cher at yandex.ru
Thu Nov 18 10:53:45 UTC 2010


Hi, Marcel and All.

I'm thinking about such feature like ability to dump partition
table into file from which it can be recovered in the future.
Also it can be used to copy partition table to another device.

At the moment i think that just print out a list of commands that
should be done to create the same table it is the easiest way.
For example:
> gpart show ada1
=>       34  320172989  ada1  GPT  (153G)
         34        512     1  freebsd-boot  (256K)
        546    8388608     2  freebsd-swap  (4.0G)
    8389154  311783869     3  freebsd-zfs  (149G)

> gpart dump -f x ada1
geom part create -s gpt -f x ada1
geom part add -b 34 -s 512 -i 1 -t freebsd-boot -f x ada1
geom part add -b 546 -s 8388608 -i 2 -t freebsd-swap -f x ada1
geom part add -b 8389154 -s 311783869 -i 3 -t freebsd-zfs -f x ada1

Any comments and ideas are welcome.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20101118/39ae35f6/signature.pgp


More information about the freebsd-geom mailing list