From owner-freebsd-questions@FreeBSD.ORG Mon Jan 21 17:20:56 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B67A7B9 for ; Mon, 21 Jan 2013 17:20:56 +0000 (UTC) (envelope-from c.kworr@gmail.com) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx1.freebsd.org (Postfix) with ESMTP id 27D7270 for ; Mon, 21 Jan 2013 17:20:55 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fr10so251232lab.26 for ; Mon, 21 Jan 2013 09:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=x67CpYCl1vl69mCBgkhxeG79tfCVxFuiKC4L8RSoLXQ=; b=sVwxv2m1XkfLEQcGuqQDRMJh/Jciq9qtofbntBhMak9VTGMrCHhtSuiaGpvUBj4iBg iU5lWlmHPP4rcPcc4/TBbyOFl2MKtzZeEnl8wTgqwjYyglQvlIP7EGjnAw71v3Hh633l RorNhkVpkSnUl8wvh+5pgp/ojZNeUSNe+p4YdgIr1Fx9OkqsACDaGsr4Qfh2mOyHWdKg RPqBrdNniJF/uzwUwzTSWuidqiPjOmxhCag61XTs6Plm3cgb69NCJoDCKrkprxrTWU4d INCAi+LGGAuaY9bcPkVLuz8HMXS6k2v5/LvxQL78TtWrq3vDTiU8rXDb6Io/+Bki1rMl 1jzA== X-Received: by 10.112.49.97 with SMTP id t1mr7825707lbn.58.1358788854796; Mon, 21 Jan 2013 09:20:54 -0800 (PST) Received: from [192.168.1.130] (mau.donbass.com. [92.242.127.250]) by mx.google.com with ESMTPS id er8sm5874103lbb.9.2013.01.21.09.20.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 09:20:53 -0800 (PST) Message-ID: <50FD78F4.7070409@gmail.com> Date: Mon, 21 Jan 2013 19:20:52 +0200 From: Volodymyr Kostyrko User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15 MIME-Version: 1.0 To: Don Dugger Subject: Re: zfs configuration References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2013 17:20:56 -0000 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.