From owner-freebsd-hackers Thu Jul 19 14:29:21 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id C1EF337B403 for ; Thu, 19 Jul 2001 14:29:12 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f6JLTBe05328; Thu, 19 Jul 2001 17:29:11 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <59063B5B4D98D311BC0D0001FA7E452205FD9D73@l04.research.kpn.com> References: <59063B5B4D98D311BC0D0001FA7E452205FD9D73@l04.research.kpn.com> Date: Thu, 19 Jul 2001 17:29:10 -0400 To: freebsd-hackers@FreeBSD.ORG From: Garance A Drosihn Subject: RE: Suggestions for sysinstall / disklabel Cc: Bill Moran Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Here's an example where the current behavior of sysinstall and/or disklabel got in the way of what I intended to do. Once I figured out what exactly was happening, I understand why it happens and how to get around it. Certainly I was doing a non-standard setup, but it "seemed simple enough", and the installer made it much more confusing. I have a large disk. I want to break it up into DOS-style slices of: s0: 1.87 gig - "not freebsd" s1: 1.25 gig - "not freebsd" s2: 2.75 gig - for booting into freebsd-stable s3: 17.x gig - for booting into freebsd-current, & holding home directories and the cvs repository. The disk was initially formatted to be a freebsd disk, and after I ran fdisk to pick new slice-sizes, every time freebsd boots it complains that the partition table in slice 0 is larger than the slice. (I have not actually installed anything in that slice yet). While that's true, whatever is complaining about that should not care about that because that partition IS NOT A FREEBSD SLICE, and nothing in my fstab refers to it... Anyway, back to the install. So I want to break up the two freebsd slices to be: s3: 2.75 gig - fbsd 4 2816m a: 96 M = 4.3 / e: 96 M = 5.x /x5/xRoot b: 256 M = /swap f: 96 M = 4.3 /xRoot g: 128 M = 4.3 /var h: 2.1 G = 4.3 /usr s4: 17.x gig - fbsd 5 a: 96 M = 5.x /x5 f: 128 M = /tmp g: 128 M = 5.x /x5/var h: 2.0 G = 5.x /x5/usr e: 512 M = /usr/home b: 10.1 G = /usr/cvs "/x5" is meant to be "/ for release 5", "/x5/var" is meant to be "/var for release 5", and "/x5/usr" is meant to be "/usr for release 5". Note that I do want to initialize both partitions at once, because both my "stable" and "current" systems will reference partitions which are in both slices. The "/xRoot" and "/x5/xRoot" partitions aren't particularly interesting for this discussion. other than those are extra partitions I do want to create there... During the disklabel step in the install process (an install I'm doing off the 4.3-release CD's), I go thru and create all the partitions on slice 3 with no trouble. So far so good. I go to create a "/x5" partition in slice 4, but it creates it as "partition e" instead of "partition a". I don't want it as partition e. Now, remember that during the boot-up process, the "boot0" code requires that the "partition to boot from" be the first partition in the slice. The "boot1" code assumes that the "partition to boot from" is labelled "partition a". So, that partition which I will want to be "/ for release 5" needs to be both the first partition in the slice, and it needs to be labelled "partition a". (Mind you, I only know this due to 20/20 hindsight. I couldn't have described it that clearly when I was trying to do this...). Why does disklabel make it "partition e"? Because it knows that it should use "partition a" for the partition which will be mounted as "/". Since I want to call this partition "/x5", it decides it must make it partition 'e' so that the 'a' label will still be available when (it assumes) I will later define that partition. Okay, so I go to trick disklabel. I rename the "a" partition in slice 3 to be something else, and go to create "/" is slice 4 (just so it will be partition a). But of course, disklabel knows it's utterly bogus to create "/" in slice 4 if the first freebsd slice is slice 3, so it won't let me do it. On the other hand, it only tells me "you aren't permitted to do that", and I'm in too stupid a mood to notice the obvious... I keep thinking that maybe slice 4 is too far into the disk, and maybe there is still a limit where you can only boot off the first 2 gig or 4 gig of a disk. Eventually I give up and create /x5 in slice 3 (as partition 'e' there). For awhile I stumble along by always booting up from slice 3, and then interrupting that boot process and typing in the commands to boot from slice 3 partition e when I want freebsd-current. This was interesting actually, as I learned a lot about what the new loader can do and how it works. Pretty nice stuff there. I tried booting from the first partition on slice 4 several times, but initially it didn't occur to me that since the slice was still labelled partition e, 'boot1' would not be able to work right. I finally realized that, and ran 'disklabel -r -e ad0s4c' to just rename partition 'a' to 'e' and visa-versa. I reboot into stable, fix the /etc/fstab for current (slice 4), and now it's working the way I wanted it. I can have slice 3 boot into release 4 and slice 4 boot into release 5. The problem for me here were all minor issues in disklabel during the install process, but they ended up causing a lot of run-around and man-page-reading before I sorted them out. Pretty much all of what it was doing was "sensible" once I understood it, it just happened to get in the way of what I personally wanted to do. And when you're sitting there with an empty 20-gig disk and no operating systems, you're not in much of a mood to go exploring into esoteric details of how all these pieces fit together. Perhaps this is the most frustrating thing about sysinstall, because when you run into a problem you can't just do a "half-assed job now, and fix it later". You have to figure it out right then or you're simply stuck. Anyway, the above is a long-winded justification for the following suggestions: 1) if disklabel has already been told about '/', then it should not try and reserve partition 'a' of OTHER SLICES to also be '/'. The first partition created in those other slices should just be labelled partition 'a'. 2) similarly, if it already has swap space defined, then it should not try to reserve partition 'b' of other slices to be swap. The second partition defined in those other slices should be labelled partition 'b'. [I don't feel quite as strongly about that, though] 3) somewhat more informative error messages might be nice, although I realize we also have the need to keep all of this code as small as possible, so an install can still be done via floppies. It would have been nice if it had said "You can't put '/' in slice 4 when booting from slice 3", for instance, instead of "You are not permitted to do that" (without mentioning the reason you're not permitted to do it). I came close to redoing the fdisk-step just to get slice 4 under the 4-gig mark, because I was guessing wrong as to the reason I was not permitted to create '/' there. Thinking about what people said about alpha installs, perhaps the following is another strategy disklabel could take. On the other hand, this may cause as many problems as it tries to solve. 4) never reserve 'a' or 'b'. Always create partitions in the order people typed them in, except that WHEN someone says they want to create '/', THEN both move that partition to the front of the slice and name it 'a' (renaming other partitions as needed). WHEN someone asks for swap, THEN name that partition 'b' and rename other partitions to match. I realize none of this is a crisis. I'm just trying to think up suggestions of how the initial disk-partitioning steps could be made a bit more user-friendly, even for deranged users like me. I would also note that I have been doing installs since 2.2.7, and I do also appreciate that this whole process has been getting better and better with each release. I just think there are still ways it could be made more flexible and "friendly", without getting into the way of people who really do know what they are doing. [btw, what is partition 'd' reserved for? why is it skipped over? certainly that's not an important question, I was just curious...] -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message