Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2016 10:37:19 -0500
From:      Anton Yuzhaninov <citrin+bsd@citrin.ru>
To:        freebsd-questions@freebsd.org
Subject:   Re: replacing bootloader wipes disk?
Message-ID:  <c11dcecb-cb62-fa2a-7655-c22dfc9f0c43@citrin.ru>
In-Reply-To: <CAA0uU3UNzc89tGKQs658=y1N_hb1705rWYHBP1gGt8udUD_K0Q@mail.gmail.com>
References:  <CAA0uU3UNzc89tGKQs658=y1N_hb1705rWYHBP1gGt8udUD_K0Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c11dcecb-cb62-fa2a-7655-c22dfc9f0c43>