Backup MBR an Partition Table

% 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.
 
  • Thanks
Reactions: ccc
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?
 
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!
 
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.
 
Back
Top