replacing bootloader wipes disk?

Anton Yuzhaninov citrin+bsd at citrin.ru
Tue Nov 22 15:37:26 UTC 2016


On 11/22/16 00:09, Mark Moellering wrote:
> fdisk -B -b /boot/boot0 /dev/ada0
> and boot0cfg -B ada0
>
>
> When I checked the drive this evening, it appeared to be completely
> blank, except for a bootloader.  I am not good enough with fdisk to
> tell but could these commands have erased the drive?  They don't look
> like they would but fdisk is not something I use much...  Any help is
> greatly appreciated

1. fdisk should not erase the drive, in the worst case it can corrupt 
partition table.

2. It was better to see
gpart show (and may be make gpart backup)
before reinstalling bootloader. If disk had a GPT partition table then 
gpart command should be used.

And even with MBR partitions your can use gpart:
geom part bootcode -b /boot/mbr /dev/ada0


More information about the freebsd-questions mailing list