Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2014 08:28:04 +0100 (CET)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        David Christensen <dpchrist@holgerdanske.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 10 installer and ZFS root
Message-ID:  <alpine.BSF.2.00.1403110814250.720@mail.fig.ol.no>
In-Reply-To: <531E0287.6060907@holgerdanske.com>
References:  <53197EF6.4070902@holgerdanske.com> <5319913D.4040207@infracaninophile.co.uk> <10334f5b74b05d9445d071bd08f73a24@dweimer.net> <531A0A0B.3010902@holgerdanske.com> <eca03739afb425884241ed23c4202a7b@dweimer.net> <531D51EF.1080804@holgerdanske.com> <531D6737.4020708@infracaninophile.co.uk> <531E0287.6060907@holgerdanske.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Mar 2014 11:20-0700, David Christensen wrote:

> On 03/10/2014 12:18 AM, Matthew Seaman wrote:
> > On 10/03/2014 05:47, David Christensen wrote:
> > > Question -- do I need to make swap size equal to or larger than RAM?
> > No.  You don't /need/ to do this, especially nowadays with machines
> > having large amounts of RAM (by which I mean much more than just 4GB,
> > which is a fairly routine amount nowadays). In your case I'd advise a
> > swap size of something between RAM+delta or 2 x RAM.  4GB is about the
> > minimum you can run a serious ZFS based server with, although for light
> > duties or experimental purposes you can manage ZFS with much less RAM.
> 
> Thanks for the reply. :-)
> 
> 
> Okay.  That's the old-school swap size calculation -- I'm surprised the
> installer defaulted to 2g.
> 
> 
> > I wouldn't make ada0s1a a ZFS partition if all it is intended to do is
> > hold an unencrypted /boot -- UFS gives you everything you need for that
> > use case, and all the extra ZFS goodness isn't really relevant there.
> 
> The installer made that decision.
> 
> 
> > >      ada0 is the raw block device.
> > >      ada0s1 is a primary partition table entry pointing to an extended
> > > partition table.
> > >      The extended partition table contains partitions ada0s1a, ada0s1b,
> > > and ada0s1d.
> > Yes, that is correct.
> 
> Okay.
> 
> 
> > >      Question -- can I adjust the size of ada0s1a and ada0s1d during
> > > installation?
> > I take it you mean 'can I install using different partition sizes?'
> > rather than 'can I change the sizes of the partitions after the fact?'
> 
> Yes.
> 
> 
> > The installer contains a pretty reasonable partition editor, or it is
> > entirely possible to boot the install media to a live FS and set up your
> > drives from the command line, and then continue the installation using
> > the installer.
> 
> I assume that the installer is a collection of shell scripts driving
> statically-compiled utility programs (everything in BusyBox?), and that the
> various command sequences and options are encoded in the scripts. Some options
> are made visible through the UI (swap size, boot encryption, 4K alignment of
> pools, etc.).  I was hoping for a simple way to adjust other options,
> especially boot partition size.
> 
> 
> Looking at the amount of work the installer ZFS partitioning sub-system does,
> I'd rather not attempt to do all that by hand.  Scripts are good at that kind
> of thing.
> 
> 
> If the installer boot loader creates a RAM disk, copies the installer suite to
> there, and then lights it off, I might be able to choose Shell early on, edit
> the right script, and then re-launch the installer.
> 
> 
> Another trick I've read about is to use a USB flash disk -- put the installer
> image on it, add another partition, copy more stuff into the extra partition,
> boot the flash disk, get to a shell, mount the extra partition, and then use
> the added stuff.
> 
> 
> > If you're asking about changing the size of existing partitions, then
> > the answer is 'maybe'.  You can't shrink the size of a partition with a
> > ZFS or UFS filesystem on it easily, and you can't move the beginning of
> > such a partition.  You can add space to the end of a partition with a FS
> > on it, and you can do pretty much whatever you want to a swap area.
> 
> The installer allocates ~2 GB for the boot partition, whatever size the user
> picked for the swap partition, and then the rest of the disk for the root
> partition.  There is no room left to grow into.
> 
> 
> And, I'm looking for the opposite -- I prefer to keep my system drive small
> and put all my data on other drives.  That way I can quickly and easily take,
> archive, and restore images of the system drive.  (My Debian images are
> currently ~11 GB, and that's over-sized.)
> 
> 
> Another consideration is that different make and/or model drives with the same
> nominal size rarely have the same number of blocks.  So, an image that exactly
> fills one drive might not fit on another drive of the same nominal size.  For
> this reason, I prefer to leave some unallocated space at the end of the system
> drive when partitioning.
> 
> 
> > >      Question -- can I arrange for swap to be encrypted during
> > > installation?
> > Set this up after installation
> 
> Okay.
> 
> 
> > >      geli_swap_flags="-e blowfish -l 128 -s 4096 -d"
> > Yes -- this is the way to go.
> 
> Okay.
> 
> 
> > >      Question -- can I set ZFS pool options for bootpool and zroot during
> > > installation?
> > 
> > No, but the installer sets the options you'ld want already.
> 
> Looking at the ZFS pool settings chosen by the installer:
> 
> 	root@p43200:~ # zfs get all bootpool
> 	...
> 	root@p43200:~ # zpool get all zroot
> 	...
> 
> I don't see anything that I would change right now.  But, that might change in
> the future.
> 
> 
> > Hint: you
> > do *not* want dedup -- it sounds attractive, but really it's only useful
> > in some quite limited circumstances and it needs a system with a very
> > much larger quantity of RAM than you have.
> > You can easily change zpool or ZFS properties after installation, but
> > generally this leaves anything already written with the original settings.
> 
> Agreed.
> 
> 
> > >      Question -- can I set ZFS file system options for bootpool during
> > > installation?
> > No, not unless you go down the route of setting up your pools etc.
> > manually. Set the options once you've got the machine up and running.
> 
> Looking at the ZFS file system settings chosen by the installer:

I'm just nitpicking. If that were truly the case, then the properties 
would have local specified as its source, not default. Default means 
untouched.

> 
> 	root@p43200:~ # zfs get all bootpool
> 	NAME      PROPERTY              VALUE                  SOURCE
> 	...
> 	bootpool  compression           off                    default
> 	...
> 	bootpool  copies                1                      default
> 
> 
> 	root@p43200:~ # zfs get all zroot
> 	NAME   PROPERTY              VALUE                  SOURCE
> 	...
> 	zroot  compression           off                    default
> 	...
> 	zroot  copies                1                      default
> 
> I would like to set compression=on and copies=2.  The installer is the correct
> place to do that.
> 
> 
> > >      Question -- can I set encryption options for ada0s1d.eli during
> > > installation?
> > Not sure.  Unless you know exactly what you're doing with crypto stuff,
> > I'd advise taking the defaults the installer gives you, or you could
> > accidentally end up with something less secure than you intended.
> 
> It sounds like I'm making feature requests for the FreeBSD installer.

+1.

Re the above: It would be nice if the installer could be told to pause 
between creating the pools and creating the filesystem layout, and 
between creating the filesystem layout and extracting the system. Make 
that two separate toggles to maximize flexibility. That way we could 
switch to another vty and set the zpool/zfs properties ourselves 
before proceeding.

> The Debian Wheezy installer has a lot of functionality for drives under the
> "manual" option -- it provides a curses (?) UI that allows the operator to
> work on multiple drives, partitioning, LUKS/dm-crypt, LVM, file systems, mount
> points, etc..  I use this every time I install from scratch.  It meets all my
> needs except for ZFS.  It would be nice if the FreeBSD installer had something
> comparable.
> 
> 
> David

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+



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