From owner-freebsd-questions@FreeBSD.ORG Thu Nov 15 04:27:11 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BA452D5 for ; Thu, 15 Nov 2012 04:27:11 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 076E88FC08 for ; Thu, 15 Nov 2012 04:27:10 +0000 (UTC) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id 1954050821 for ; Wed, 14 Nov 2012 20:27:10 -0800 (PST) To: freebsd-questions@freebsd.org Subject: Re: Advanced Format Drive ? In-Reply-To: Date: Wed, 14 Nov 2012 20:27:10 -0800 Message-ID: <17388.1352953630@tristatelogic.com> From: "Ronald F. Guilmette" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 04:27:11 -0000 In message , Warren Block wrote: >On Tue, 13 Nov 2012, Ronald F. Guilmette wrote: > >> OK. I think that I always was doing that anyway. But I want to be sure >> that I understand... If the size of the BSD partition is a multiple of, >> say, !MB, then the _alignment_ of that partition will likewise (auto- >> magically) be at least 1MB also? > >No. If you start with $0.63, and only add full dollars or tens, you >will still never have an integer amount of dollars. OK. I understand. However in my personal opinion, what this indicates to me is that the ``guided'' partitioning GUI stuff that is (nowadays) presented to the user who is installing FreeBSD 9.x could perhaps be called "mis-guided", given that there is no place that I have seen within this ``guided'' process where the user is even allowed to specify partition alignment. (And I gather from everything that has been said so far in this thread that if the alignment is set wrong, then the user is likely to pay a Big Price in terms of performance, right?) ... and I am almost tempted to file a formal PR about this, i.e. the fact that ``guided'' partitioning doesn't allow the user to specify the alignment of _anything_. >> Or do I need to set the alignment separately, e.g. my manually running >> bsdlabel? (Normally, I've just been using what noadays is being >> called "guided" partitioning, you know, with the friendly curses-based >> GUI. So As with fdisk, I have no real experience using bsdlabee from >> teh command line. But I guess it is time that i learned how.) > >I don't know of a way to make fdisk and bsdlabel do the correct >alignment. That also is rather entirely perplexing to me, especially given all else that I have learned already from and within this conversation. For example, I've learned that when one is using modern "Advanced Format) (4KB blocksize) hard disks, it is Bad (capital `B') to allow any partition to be aligned to anything other than (at least) a 4KB boundary, _and_ that newfs has already, apparently been modified/updated so that it's minimum default fragment size is 4KB. Given these facts, I am more than a little surpised to learn (or rather just to realize) that the good old traditional fdisk and bsdlabel tools do not have ways to explicitly specify minimum alignment _and_ that these tools are still being distributed with FreeBSD. Do the most recent versions of fdisk and bsdlabel that are now shipping with FreeBSD at least mirror the change that has been introduced into newfs? I mean do they also always round everything to (minimum) 4KB boundaries? If not, then I can see the possibility of a lot of people using these tools and then ending up with some quite perplexing problems. And as long as we are on the subject... I'm now looking through the fdisk man page (in far more detail than I ever have before) and I am seeing some comments about alignment, but for me at least, they are all cryptic at best. (Not that they wern't already, long before now. I confess that I've never really dregded into this stuff very much, but on the rare occasions when I have tried to do so in the past, it was, as I remember, already rather befuddling.) For example, here are some excerpts from the fdisk man page: If you hand craft your disk layout, please make sure that the FreeBSD slice starts on a cylinder boundary. ... Note: the start offset will be rounded upwards to a head boundary if necessary, and the end offset will be rounded downwards to a cylinder boundary if necessary. These passages didn't make any sense to me even the first time I read them, years ago, and they appear to make even less now... now that we are in an age when disks have these 4KB physical read/write units (rather than the old standard of 512B), and also when, as I understand it, "disk geometry" has long ago become largely if not entirely just a convenient fiction, told by disk drives to their controllers in order to make ancient legacy BIOSes and other ancient legacy software happy. Why was it ever of any special value to start something on a ``cylinder'' boundary? And more to the point, is it_still_ of any actual value to do so? And of course I have the same question for the ends of things... Why was it ever of any value to *end* things on a ``cylinder'' boundary, and does doing that still have any value at all in the modern era? And of course, I have all the same questions regarding ``head'' boundaries. What in God's name was ever beneficial about starting a partition (or anything else for that matter) on a ``head'' boundary? And is this at all relevant for any hardware that's been manufactured within the last 10 years? (And by the way, I am an old geezer, and I _do_ remember the ancient times when disk drives actually told the real unvarnished truth, and when OSes actually did go to some lengths to try to implement optimized disk usage strategies, e.g. to try to keep the heads as close to the centers of their ranges as possible, and so forth. But I gather that all this stuff went the way of the dinosaurs long long ago, and thus, my questions.) >But that's okay, because gpart(8) does everything they do, >and more. Creating MBRs and bsdlabels is more work, but gpart can do >it, and do the juggling to get the bsdlabel partitions to line up. Reading the gpart(8) man page, I see that you are (of course) 100% correct. It can do all I might need and more. But I also have a number of questions about gpart. (See below.) >Again, I suggest that GPT is the much easier and more versatile way. OK, I'm conservative in my approach to technology generally, and I've learned the hard way not to try most new ``innovations'' until at least v2.0, by which time, hopefully, all of the kinks have been worked out. But GPT has been around for awhile now and I'm willing to take a crack at this new way of partitioning. And I've already put a fresh blank disk in one of my machines that I'm ready to try it on, but... I'm looking at the examples section of the gpart(8) man page. May I assume that if I just want to merely ``try out'' GPT... you know... taking it out on the road for a first time test run... that I can just do the first five (5) commands listed under EXAMPLES and then that will be enough to go ahead and try installing FreeBSD into the created freebsd-ufs partition? Even assuming that the answer is yes, I have still more questions... Where are these magic numbers coming from?? I am specifically talking about the number "34" in the "-b 34" option and also the number "162" in the "-b 162" option. Tha man page just tosses those into the example command lines without saying a word about them. And you can probably guess what it is that is especially troubling to me about them... neither one of them is divisible by 8 (i.e. 4KB/512B). So would the examples in the current gpart(8) man page produce an Epic Fail when and if they were used with a modern "Advanced Format" drive? >But if you insist on MBR/bsdlabel... No, actually, now I am motivated to make the leap to using GPT... *if* I can just manage to make heads or tails of it, that is. But this whole alignment issue is now making me go back (e.g. to the older tools fdisk and bsdlabel) and question whether I even ever properly understood what _that stuff_ was doing (and more importantly *why* it was doing it) with respect to alignment. Regards, rfg