On Sat, Aug 28, 2010 at 05:05:27AM -0400, Olivier Cherrier wrote:
> On Fri, Aug 27, 2010 at 05:04:57PM +0200, we...@weirdnet.nl wrote:
> > Don't. There's no need. Here's how you do it even easier (requires
> > recent snap / source)
> > 
> > [ -f /dev/diskmap ] || ( cd /dev; sudo MAKEDEV diskmap ) 
> > echo wq | disklabel -E YOURDISK
> > UID=`disklabel YOURDISK | grep ^uid: | cut -f2 -d' '`
> > { echo ",s#/dev/YOURDISK#${UID}.#"; echo w; } | ed - /etc/fstab
> > 
> > Do not try this until you understand what it does.  You'll have to
> > edit it to your needs anyway.
> > 
> > This new uid stuff is really cool, thanks jsing@ !
> 
> Yes, it's great... especially with softraid volumes!
> Thanks Joel!
> 
> $ grep '\.' /etc/fstab
> 08552bb5b53ec2df.a /usr ffs rw,nodev 1 2
> 08552bb5b53ec2df.g /usr/X11R6 ffs rw,nodev 1 2
> 08552bb5b53ec2df.b /usr/local ffs rw,nodev 1 2
> 08552bb5b53ec2df.e /usr/obj ffs rw,nodev,nosuid 1 2
> 08552bb5b53ec2df.h /usr/ports ffs rw,nodev,nosuid 1 2
> 08552bb5b53ec2df.d /usr/src ffs rw,nodev,nosuid 1 2
> 08552bb5b53ec2df.f /usr/xenocara ffs rw,nodev,nosuid 1 2
> 08552bb5b53ec2df.i /var ffs rw,nodev,nosuid 1 2
> 08552bb5b53ec2df.j /home ffs rw,nodev,nosuid 1 2
> 482c4eac2228bc96.a /data/tmp     ffs rw,nodev,nosuid 1 2
> 482c4eac2228bc96.b /var/squid    ffs rw,nodev,nosuid 1 2
> c3b17d16762bcaf9.a /data/clients ffs rw 1 2

This is great! I have long been missing this kind of feature,
allthough I anticipated being able to mount by label, but this
might even be better...

<detailed_background>
I solved the problem together with the problem of encrypting
(through softraid) as much of the installation as possible for
example system configuration files under /etc roughly like this:
* USB disk partitions for swap, / and encrypted softraid.
* Encrypted softraid disk partitions for /etc, /altroot, /var, /tmp,
  /usr, /home, ...
* Hard links between /etc/{fstab,login.conf,ttys,rc,boot.conf} and
  /etc.boot/ on the USB disk, to be able to fix these files after
  the upcoming mount over of /etc.
* A new /etc/rc script on the USB key that:
  - Open (decrypt) the softraid encrypted disk.
  - fsck the softraid/etc partition
  - mount the softraid/etc partition over /etc
  - ed the new /etc/fstab to change the disk names into what
    the boot disk and the encrypted softraid disk now are.
    Use mount_mfs to create a writable /tmp in the process.
  - Start a background shell with the new /etc/ directory
    as working directory to protect against accidental umount.
  - exec /bin/sh /etc/rc ${1+"$@"}
* A /etc/rc.shutdown script that updated /etc.boot/boot.conf on
  the USB disk with the content in /etc/boot.conf on the encrypted
  softraid disk.
</detailed_background>

Most of the difficult hazzle of editing /etc/fstab is hereby
unnecessary, so I can think hard about if the encryption of
/etc really is necessary for me.

Thank you very much for this usability improvement!

> 
> -- 
> Olivier Cherrier - Symacx.com
> mailto:o...@symacx.com

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Reply via email to