Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2013 19:20:52 +0200
From:      Volodymyr Kostyrko <c.kworr@gmail.com>
To:        Don Dugger <dondugger47@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: zfs configuration
Message-ID:  <50FD78F4.7070409@gmail.com>
In-Reply-To: <CANQr=Adi=6xOnZC=M_cKvuUeWAXyf_VxmmKYbthOSX=tiVQpMg@mail.gmail.com>
References:  <CANQr=Adi=6xOnZC=M_cKvuUeWAXyf_VxmmKYbthOSX=tiVQpMg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
21.01.2013 17:50, Don Dugger:
> Hi All,
>
> So I use zfs for the root file system. Works well. However now I want to
> move /tmp to ram-disk (memory disk or what ever). When I try to unmount
> /tmp with the zfs command of course it won't because its busy. With ufs I
> would just edit fstab and reboot what do I don with zfs??

I've been moving a lot of machines from 9.0 to 9.1 with some patches 
this days (like tmpfs-nrbtree). I inject some code inde /etc/rc.d/zfs to 
update this. I'm adding this to /etc/fstab:

     tmpfs /tmp tmpfs rw,nosuid 0 0

After this I'm changing /etc/rc.d/zfs:

@@ -23,6 +23,12 @@

  zfs_start_main()
  {
+       umount /tmp
+       zfs destroy mypool/tmp
+       rm -rf /tmp
+       mkdir -p /tmp
+       chmod ugo+rwxt /tmp
+       mount /tmp
         zfs mount -a
         zfs share -a
         if [ ! -r /etc/zfs/exports ]; then

After reboot zfs filesystem for tmp is gone and tmpfs is in charge.

The code is harmless upon reexecution and just does the job. I haven't 
found easier way of doing this.

-- 
Sphinx of black quartz, judge my vow.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50FD78F4.7070409>