gpart backup, restore and bootcode
Arthur Chance
freebsd at qeng-ho.org
Tue May 27 08:32:42 UTC 2014
On 27/05/2014 08:59, Janos Dohanics wrote:
> Hello list members,
>
> Do the commands gpart backup and gpart restore also back up and restore
> the bootcode? The gpart(8) man page says:
>
> "restore Restore the partition table from a backup previously created
> by the backup action and read from standard input. Only the
> par- tition table is restored. This action does not affect
> the con- tent of partitions. After restoring the partition
> table and writing bootcode if needed, user data must be
> restored from backup."
>
> I read this section as "yes" - is this correct? I assume "yes" since my
> bootcode is embedded having been added using "gpart bootcode -b ..."
> and thus "embed-ded in the partitioning scheme's metadata".
>
> Is there a way to show/verify if bootcode is written to the disk?
>
If you actually try "gpart backup" you get something like
arthur at fileserver[0]> gpart backup ada0
GPT 128
1 freebsd-boot 40 128
2 freebsd-ufs 168 2097152 fs-root [bootme]
3 freebsd-swap 2097320 16777216 fs-swap
4 freebsd-ufs 18874536 2097152 fs-usr
5 freebsd-ufs 20971688 2097152 fs-spare1
6 freebsd-ufs 23068840 4194304 fs-tmp
7 freebsd-ufs 27263144 2097152 fs-spare2
8 freebsd-ufs 29360296 10485760 fs-usr-obj
9 freebsd-ufs 39846056 20971520 fs-var
10 freebsd-ufs 60817576 20971520 fs-usr-local
11 freebsd-ufs 81789096 4194304 fs-usr-src
which is pretty much a variant of "gpart show" on the same disk plus a
line saying how big the GPT is. No sign of a PMBR bootstrap in that.
More information about the freebsd-questions
mailing list