Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2012 22:05:55 +0300
From:      =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KLRg9GA0L7QstC10YY=?= <corebug@corebug.net>
To:        Warren Block <wblock@wonkity.com>
Cc:        FreeBSD Questions List <freebsd-questions@freebsd.org>
Subject:   Re: Force disk with old GPT label to be recognized as MBR one
Message-ID:  <CAKB6gVgUWbfnFTy4fkDwVgFShLsm0zvBx7DP7zsHNzwR3N5hEw@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1208300721490.7149@wonkity.com>
References:  <CAKB6gVj_TLaqaKx1j=JZjVzFZnCWEJr%2BY-khjKBeN_C8zJyLXQ@mail.gmail.com> <alpine.BSF.2.00.1208300721490.7149@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2012/8/30 Warren Block <wblock@wonkity.com>:
> On Thu, 30 Aug 2012, ??????? ??????? wrote:
>
>> Hello there, people!
>> I have a FreeBSD box with 9.1-RC3 i386 and an interesting HDD.
>> It was patitioned with GPT and zfs some (long) time ago. After that
>> the hdd has been completely repartitioned with MBR scheme and one
>> single freebsd (165) partition and one slice there. It worked fine in
>> 7.2, but now i have to get the data from that slice and when i connect
>> the hdd to 9.1 box, it finds old corrupt GPT label (i suppose, it's
>> backup GPT header somewhere in the end of actual disk) and does not
>> recognize the MBR scheme there.
>
>
> In case it has not been said: make a full backup of everything on that disk
> first using dd.
>
> Erasing the last 34 blocks or 17048 bytes of the disk will erase the backup
> GPT.  It may be enough to erase just the very last block.
>
>   # diskinfo -v /dev/ada1
>   /dev/ada1
>         512             # sectorsize
>         256060514304    # mediasize in bytes (238G)
>         500118192       # mediasize in sectors
>
>   # : Not tested, could be off by one!
>   # dd if=/dev/zero of=/dev/ada1 bs=512 seek=500118191
>
> Force a retaste with 'true > /dev/ada1', then see what gpart shows.  If the
> drive is still seen as GPT, adjust the seek to begin at (mediasize in
> sectors) - 34.

Thank you a lot! It worked like a charm!

-- 




~~~
WBR,
Vitaliy Turovets
Systems Administrator
Corebug.Net
+38(093)265-70-55
VITU-RIPE
X-NCC-RegID: ua.tv



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKB6gVgUWbfnFTy4fkDwVgFShLsm0zvBx7DP7zsHNzwR3N5hEw>