# Backup MBR an Partition Table



## ccc (Aug 8, 2010)

hi

Howto backup MBR an Partition Table of freeBSD using Frenzy LiveCD ?


----------



## Beastie (Aug 8, 2010)

`% dd if=/dev/adN of=mbr_adN bs=512 count=1`
changing N accordingly.

But you need a writable location for the output file, so you can use a pendrive you've already mounted or you could simply do this from FreeBSD itself.


----------



## ccc (Aug 12, 2010)

Thx, but howto restore just a Partition Table?


----------



## jem (Aug 12, 2010)

fdisk(8)

It's able to output a disks slice table to a config file, and read the config file back in to partition the disk.


----------



## ccc (Aug 16, 2010)

jem said:
			
		

> fdisk(8)
> 
> It's able to output a disks slice table to a config file, and read the config file back in to partition the disk.



Can you pls give some more details how it works using fdisk?


----------



## Beastie (Aug 16, 2010)

So you have not read the man page yet. You should use the *-f* option with a "configfile". And there is a very detailed "configfile" at the end of the page. Read it!


----------



## gcooper@ (Aug 18, 2010)

Beastie said:
			
		

> `% dd if=/dev/adN of=mbr_adN bs=512 count=1`
> changing N accordingly.
> 
> But you need a writable location for the output file, so you can use a pendrive you've already mounted or you could simply do this from FreeBSD itself.



That works with a standard MBR, but not a non-conventional one, like GPT, made larger to accommodate ZFS -- see the examples section in the gpart manpage for more details.


----------

