Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Apr 2010 18:36:43 +0200
From:      Olivier Smedts <olivier@gid0.org>
To:        Bartosz Stec <bartosz.stec@it4pro.pl>
Cc:        freebsd-fs@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: gpart failing with no such geom after gpt corruption
Message-ID:  <r2t367b2c981004010936o52837211j8dc8d62ce128d612@mail.gmail.com>
In-Reply-To: <4BB49E3F.7070506@it4pro.pl>
References:  <4BB49E3F.7070506@it4pro.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/4/1 Bartosz Stec <bartosz.stec@it4pro.pl>:
> Hello ZFS and GPT hackers :)
>
> I'm sending this message to both freebsd-current and freebsd-fs because i=
t
> doesn't seems to be a CURRENT-specific issue.
>
> Yesterday I tried to migrate my mixed UFS/RAIDZ config to clean RAIDZ wit=
h
> GPT boot. I've following mostly this guide:
> http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1
> I'm using CURRENT on 3x40GB HDDs (ad0-ad3) and additional 250GB HDD has b=
een
> used for data migration (ad4).
>
> Data was copied form RAIDZ to 250GB HDD, GPT sheme was created on =A040GB
> HDDs, then new zpool on them, and finally data went back to RAIDZ. Bootin=
g
> from RAIDZ was succesful, so far so good.
>
> After a while I've =A0noticed some SMART errors on ad1, so I've booted ma=
chine
> with seatools for dos and made long test. One bad sector was found and
> reallocated, nothing to worry about.
> As I was in seatools already, I've decided to adjust LBA size on that dis=
k
> (seatools can do that), because it was about 30MB larger than the other t=
wo,
> and because of that I had to adjust size of freebsd-zfs partition on that
> disk to match exact size of others (otherwise 'zpool create' will complai=
n).
> So LBA was adjusted and system rebooted.
>
> Yes, I was aware that changing disk size probably end with corrupted GPT =
and
> data loss, but it doesn't seem to be a big deal for me as far as 2/3 of
> zpool is alive, because I can always recreate gpt and resilver ad1.
>
> Unfortunately it wasn't so easy. First of all system booted, and as I
> expected kernel message shows GPT error on ad1. Zpool was degraded but al=
ive
> and kicking. However, when I tried to execute any gpart command on ad1, i=
t
> return:
>
> =A0 ad1: no such geom

Are you sure you created a partition scheme with gpart on ad1 before
issuing partition-related gpart commands ?

>
> ad1 was present under /dev, and it could be accessed by sysinstall/fdisk,
> but no with gpart. I've created bsd slice with sysinstall on ad1 and
> rebooted, with hope that after reboot I could acces ad1 with gpart and
> recreate GPT scheme. Another surprise - system didn't boot at all, reboot=
ing
> after couple of seconds in loader (changing boot device didn't make a
> difference).
>
> Only way I could boot system at this moment was connecting 250GB HDD whic=
h
> fortunately still had data from zpool migration and boot from it. Another
> surprise - kernel was still complaining about GPT corruption on ad1. I ha=
d
> no other ideas so I ran
>
> =A0 dd if=3D/dev/zero of=3D/dev/ad1 bs=3D512 count=3D512
>
> to clear beginning of the hdd. After that disk was still unaccesible from=
t
> gpart, so I tried sysinstall/fdisk againt to create standard BSD
> partitioning scheme and rebooted system.
> After that finally gpart started to talk with ad1 and GPT scheme and zpoo=
l
> has been recreated and work as it supposed to.
>
> Still, how can we clear broken GPT data after it got corrupted?
> Why gpart has been showing "ad1: no such geom", and how can we deal with
> this problem?
> Finally, why gptzfsboot failed with GPT corrupted on other disk after try=
ing
> to fix it, while it booted at first place?
>
> Or maybe changing LBA size of already partitioned HDD is extreme case, an=
d
> the only way these problems could be triggered ;)?
>
> Cheers!
>
> --
> Bartosz Stec
>
>
> _______________________________________________
> freebsd-fs@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
>



--=20
Olivier Smedts                                                 _
                                        ASCII ribbon campaign ( )
e-mail: olivier@gid0.org        - against HTML email & vCards  X
www: http://www.gid0.org    - against proprietary attachments / \

  "Il y a seulement 10 sortes de gens dans le monde :
  ceux qui comprennent le binaire,
  et ceux qui ne le comprennent pas."



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