Date: Fri, 3 Sep 2010 10:41:13 -0500 From: Adam Vande More <amvandemore@gmail.com> To: Martin McCormick <martin@x.it.okstate.edu> Cc: freebsd-questions@freebsd.org Subject: Re: Boot Drive Nomenclature and How to Figure it out Message-ID: <AANLkTi=V7frK-7nExnbQdDFVZE%2BgwXKzrSdPCmuez11A@mail.gmail.com> In-Reply-To: <201009031504.o83F4Hdt097382@x.it.okstate.edu> References: <201009031504.o83F4Hdt097382@x.it.okstate.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 3, 2010 at 10:04 AM, Martin McCormick <martin@x.it.okstate.edu>wrote: > Thank you. I have never heard of gpart before so I gave > it a try and that helps very much if the drive is already > formatted. Most of these drives I plan to encounter will be > formatted so this basically solves the problem but it raises a > new question. If one does > > gpart list as suggested and the disk is formatted, one gets > exactly the information necessary. I believe it is even the > first line of output. It doesn't get better than that. If the > disk is not corrected formatted such as might happen with > corruption or maybe a new drive, gpart list executes silently > and prints nothing on the output. > > As I said, you answered my question so many thanks. The > new question might best be put: > > Okay, if nothing is there, where did gpart look to see nothing? > I believe gpart checks the geom sector which the last one of a particular geom class. The sector is written anytime the geom device is added or updated. This applies only to geom devices which are hardcoded. For example, /dev/ad0 and /dev/ad0p1 would both be seperate geom classes and have their own meta-data sector. FWIW, the only suitable hard disk devices I know of are: /dev/ad{0-9} /dev/ada{0-9} /dev/da{0-9} If you're writing a test, I would probably grep dmesg for the presence of one of them. The first device appearance is probably a prime candidate for installation target. -- Adam Vande More
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=V7frK-7nExnbQdDFVZE%2BgwXKzrSdPCmuez11A>