From owner-freebsd-questions@FreeBSD.ORG Mon Nov 16 06:48:45 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BEB7106568F for ; Mon, 16 Nov 2009 06:48:45 +0000 (UTC) (envelope-from the.real.david.allen@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 5F14B8FC1E for ; Mon, 16 Nov 2009 06:48:45 +0000 (UTC) Received: by pzk15 with SMTP id 15so3486303pzk.3 for ; Sun, 15 Nov 2009 22:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=fUWkqCbW8szNNlxyvp6fesSIQqijEHkgt7b4s0xq2LI=; b=BLK1T/vA21Y8jehkQyXfKvUAtvABJwU1eyBdvUzHHYN0oylLG3qDOfOLFtKXpi/PFT B1J9Sle7JChAzjXeeVAn2d4xMc0PDlxtadMAyuzk1J1Pjn7lP2EfNQaKyCiBBI9tiqJX Lqg0uNUPrdR5jx3NWWwIywXqWC6d0b1SFXDMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=f8UfN4bV0qO4Iguy6KIS89Pc7uJNY/K9K2h0cof6U6LKwOBjRjybJoPhZS2l3mdzyO SgzWf2julCqbDSfEBCTp0Zo0A4ZTC7RgixJnlXEXUthjsoJon8c5hkRKkMf1X3hDb6IX BYb3cpTSheIJMM8KkG3EQBNkiKSltnmuZij+I= MIME-Version: 1.0 Received: by 10.142.56.18 with SMTP id e18mr672135wfa.40.1258354125085; Sun, 15 Nov 2009 22:48:45 -0800 (PST) In-Reply-To: <20091116042131.d522b7f6.freebsd@edvax.de> References: <2daa8b4e0911151823sd98f726ma4b8eebf05b16dd0@mail.gmail.com> <20091116042131.d522b7f6.freebsd@edvax.de> Date: Sun, 15 Nov 2009 22:48:45 -0800 Message-ID: <2daa8b4e0911152248l228e6bd2va78853defdf40009@mail.gmail.com> From: David Allen To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org Subject: Re: Partition naming, fstab, and geli X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2009 06:48:45 -0000 On 11/15/09, Polytropon wrote: > On Sun, 15 Nov 2009 19:23:15 -0700, David Allen wrote: >> 1. The Handbook suggests there is a convention that when partitioning >> a a drive that's been added, to label the first new partition on that >> drive as 'e' as opposed to 'a' (which is reserved for the /root >> partition). Does the following satisfy that convention, or would >> starting with 'a' in each case make more sense? >> >> /dev/ad1e /foo1 ufs rw 2 2 >> /dev/ad1f /bar1 ufs rw 2 2 >> /dev/ad1g /baz1 ufs rw 2 2 >> >> /dev/ad2e /foo2 ufs rw 2 2 >> /dev/ad2f /bar2 ufs rw 2 2 >> >> /dev/ad3e /foo3 ufs rw 2 2 >> /dev/ad3f /bar3 ufs rw 2 2 > > The Handbook says in 18.3.1 sub 3: > > A disk can have up to eight partitions, labeled a-h. > A few of the partition labels have special uses. > The a partition is used for the root partition (/). > Thus only your system disk (e.g, the disk you boot > from) should have an a partition. The b partition > is used for swap partitions, and you may have many > disks with swap partitions. The c partition addresses > the entire disk in dedicated mode, or the entire > FreeBSD slice in slice mode. The other partitions > are for general use. > > Note the last sentence. Due to this statement, I think the > usage of 'e' is arbitrary, 'd' could be okay, too, but when > the Handbook says 'e' in the example (maybe with the intention > of 'e' like in 'example'?), you can use 'e', too, especially > when you want to use more than one partition. Well, you and I seem to be on the same page, but I was referring to the following: 2.6.5 Creating Partitions Using Disklabel Table 2-3. Partition Layout for Subsequent Disks The rest of the disk is taken up with one big partition. This could easily be put on the a partition, instead of the e partition. However, convention says that the a partition on a slice is reserved for the filesystem that will be the root (/) filesystem. You do not have to follow this convention, but sysinstall does, so following it yourself makes the installation slightly cleaner. You can choose to mount this filesystem anywhere; this example suggests that you mount them as directories /diskn, where n is a number that changes for each disk. But you can use another scheme if you prefer. The 'e' partition is again used in the Handbook section 18.3 Adding Disks. I guess I'm looking for the pedantic answer, but I'll settle for less. > I have to admit that I never put slices on extra hard disks, > I'm always using the whole disk, so > > # newfs /dev/ad3 > > would give me /dev/ad3 (which is the same as /dev/ad3c), and > the entry > > /dev/ad3 /foo ufs rw 2 2 > > would go into fstab. > > I'm sure you already know this because it seems that you read > up until 18.3.2.2 - you're omitting slices, "dedicated" mode. :-) I'd prefer the same with the "first" disk, but sysinstall won't accomodate it, and on most installations, it's more work trying to work around sysinstall than it is using it. So non-dedicated it is. > Bottom line: The naming convention mentioned in the Handbook > and your examples are completely okay. Great. >> 2. My second question is in regards to using the 'xx' fstype to have >> the system ignore that device. >> >> Consider, for example, a geli encrypted partition. The .eli device >> doesn't exist at boot time. I discovered by accident that the system >> won't boot with an fstab entry for a device that doesn't exist. > > That's completely intended. :-) LOL. Surprised me. I figured a 'noauto' for a non-existent device would be acceptable. >> So if I was to record an entry in fstab, I couldn't use >> >> /dev/ad1e.eli /home/david/private ufs rw 0 0 >> >> Does that mean that the following is what's typically to record fstab >> entries for ignored devices? >> >> /dev/ad1e.eli /home/david/private xx rw 0 0 >> /dev/ad3e /fake xx rw 0 0 >> /dev/ad3f /reserved xx rw 0 0 > > I would say: No. The entry for those partitions should rather be: > > /dev/ad1e.eli /home/david/private ufs rw,noauto 0 0 > /dev/ad3e /fake ufs rw,noauto 0 0 > /dev/ad3f /reserved ufs rw,noauto 0 0 But the eli device doesn't exist until after it's attached, which, in my case, will happen manually and on-demand after boot. > The "ufs" in the FS field tells the system which FS to use when > later mounting (e. g. with requiring a pass phrase from the > operator), and "noauto" in the options field that prohibits > mounting the file system at startup. A pass phrase from the operator? Not likely. It's not a desktop. Each of the following will result in the system not booting: # there is no ad4 /dev/ad4a /foo ufs rw,noauto 0 0 # ad1e is encrypted so ufs is not a valid fstype /dev/ad1e /foo ufs rw,noauto 0 0 # the eli device doesn't exist at boot time /dev/ad1e.eli /foo ufs rw,noauto 0 0 > If you used "xx" in the FS field, you could not easily > > # mount /reserved > > because the mount command wouldn't know which FS to use (allthough > I think UFS might be a default here). I can live with that (the encrypted partition has to be attached manually anyways). But I do want to use fstab to record what goes where. I end up with two devices, right? So what two entries should I make in fstab? The following won't work. /dev/ad1e /foo ufs rw,noauto 0 0 /dev/ad1.eli /foo ufs rw,noauto 0 0