From owner-freebsd-questions@FreeBSD.ORG Wed May 7 04:20:55 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8185FC3 for ; Wed, 7 May 2014 04:20:55 +0000 (UTC) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E3A9D4A for ; Wed, 7 May 2014 04:20:55 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id n15so544682lbi.5 for ; Tue, 06 May 2014 21:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=MRlVnIZ1mbe8vQm7/l9zpGYksrFnjk96gRVLlgmKUhQ=; b=07el9HmjuUtQf6bi3mYIz+v8hwtVEU99JQn6DuWWeJi3I4IvTC9E3+nydF6zIkQ3hf oHY70dbH3abRRYD2Ot1r6n+pj1s9E+2izptMhId3RI4wo8Dn8N2b3Kus6RgI4o0ygRDV cxud5jGm4d5JtQnUOdppiXVztbMscUbxOpnNSjUovOMLU/0+ZczfOiDkMYAz9jjmb86U LUWrTSS2NV0Dn+Mpyjf+G4z2/+HX4ZjE3wvV+Q2Kc3ZMbx0aJ3acofuBSNI9Nmg3exvm jiOgnTZVIvcQN1Dyni2QvY2esCHbXCFi+3XAbm0T0VwBVICjDgyHS+1yIw9x7yCdq4ru rgIQ== X-Received: by 10.112.26.199 with SMTP id n7mr37125375lbg.27.1399436452421; Tue, 06 May 2014 21:20:52 -0700 (PDT) Received: from lazlar.no-ip.biz (109.58.144.242.bredband.tre.se. [109.58.144.242]) by mx.google.com with ESMTPSA id a2sm15804541lbz.25.2014.05.06.21.20.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 21:20:51 -0700 (PDT) Message-ID: <5369B4A1.40506@gmail.com> Date: Wed, 07 May 2014 06:20:49 +0200 From: Rolf Nielsen User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Swap on ZFS References: <53697D8B.2060906@gmail.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 04:20:55 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-05-07 02:56, Daniel Staal wrote: > --As of May 7, 2014 2:25:47 AM +0200, Rolf Nielsen is alleged to > have said: > >> On 2014-05-06 21:21, David Noel wrote: >>> Is swap on ZFS still ill-advised? All the forum, list, and >>> blog posts I find say it's a no-go. Is this still the case? The >>> idea behind it not working is that ZFS needs memory to write to >>> disk, so when you need to swap (are low on memory) ZFS won't be >>> able to write. >>> >>> I found some talk of having a tunable added as a workaround >>> that would reserve a certain amount of memory for ZFS so this >>> wouldn't be a problem, but have no idea if anyone's made any >>> progress towards implementing it. >> >> Just out of curiosity, why do you want it? >> >> To get swap on ZFS, you first need to create a ZFS filesystem on >> one or more devices, then you create a dedicated volume inside >> that filesystem and use that dedicated volume as swap. To me that >> seems to add unnecessary complexity, similar to using a file >> backed md device as swap. Please don't take this as criticism; >> you may very well have good reasons for wanting to do this. I'm >> just curious about those reasons. > > --As for the rest, it is mine. > > Because it's actually simpler than the alternative, in many cases. > The creating a ZFS filesystem is 'free' in this - you are only > planning on doing this if you are already running a ZFS-based > system, so you're already creating the filesystem. That leaves > creating the dedicated volume inside that and using it as swap - > which is as easy or easier than formatting and using a dedicated > disk as swap. > > So, really using swap on ZFS is no harder or easier than using a > dedicated swap disk, and no more complex. And if you *aren't* > planning on a dedicated swap disk, it starts adding complexity: If > you aren't using a dedicated swap disk, then you're probably > sharing it with a disk that you'll be using in the ZFS filesystem - > which means you now need to format and partition that disk, which > you didn't need to do before. You also have to monitor and > remember that the disk is partitioned, if you ever have to replace > it. (Which otherwise ZFS would make easy - just swap in a new one, > and tell ZFS to use it to replace the failed disk.) > > So your steps are: 1. Create ZFS filesystem. 2. Create swap inside > filesystem. 3. Configure FreeBSD to use swap. > > vs. 1. Partition Disks. 2. Set up Swap partition. 3. Configure > FreeBSD to use swap. 4. Create ZFS filesystem on other partition. > > Note of course that one of the points of using ZFS is the ease and > flexibility of creating volumes inside it - a ZFS user is probably > creating multiple at setup, and the swap volume isn't all that > different to create. And again, you're giving up the ability to use > ZFS to manage the device on the fly, which is one of ZFS's best > benefits. > > Daniel T. Staal > > --------------------------------------------------------------- > This email copyright the author. Unless otherwise noted, you are > expressly allowed to retransmit, quote, or otherwise use the > contents for non-commercial purposes. This copyright will expire 5 > years after the author's death, or in 30 years, whichever is > longer, unless such a period is in excess of local copyright law. > --------------------------------------------------------------- > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions To > unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" I'm not referring to the complexity of doing the setup, but to the added layer (a volume on a filesystem on a disk vs. a partition on a disk). I use ZFS for data storage, but I don't use any zvols. And my / is on UFS on a "dangerously dedicated" 40GB SSD that also has the swap partition. If I want to talk to my mother, I call my mother and talk to her. I don't call my sister and have her call my mother and relay everything. And for the same reason, I don't see why I should put a filesystem or swap on a volume on a filesystem. Rolf -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTabShAAoJEB1OKfQ0M8TguhEQALBrje+g/sTOCADfiFkOz4GO nEAfap3nYcq4ijakcdct5n3rAQQaH2rolCnL2YwYK2BQYqd7rRkdsQeE2A1DeyVI 09wbQsqzDK3JBlQfhP+HajDB0yasuE7DaRONxVYbeTVCkPbTbYES8+YPKvHTxAcK QPp18ParOrKCIpBYZDtIhq/L56f18lHzqvFz3m0kIUJxO3hx2y0MdwvGeojQUviU +pOlB3OJsaHLxoMFOC1EDpATfE9pORgTU6pqoN//JCSJPryPT2KaFIq2vT0FnTU7 pSvSsNf9dqGalyYrD0lkX1z80Q0EQ/xHr/G/+3/o16xgVNjX4ESOuMSeKnPrgbEt KPdJFHv1bHRRb1rJT0NZ4119Mdf8Rfk+VWUD1E14q08a6UFaJG/ji0KeLZZMK2EC dJa4AJH7QVpy0NalofxOl1Q6R9x8IoXCMbWTyRMubVQzefJGvN7UdoC9HpBy+8U8 6UiTkSOIJENgXrrO85ytB+rzRN7yS/SCYV0+UiMmc2u+AXmguUOKd2dwjVJy0K58 E0tsBjXYmNpnekkpJGtygxkBrs1jftEp38rWPjHKo/0CGwvhlz+cuNe1xrMI/tIK f1qOotlPKuPXUp/RosrB1+bTxQD6kA6rRR7AeWYKMRyGrGNWGrNltCeRnJvkqIxs f4hb8quzSUYc3JVq/8Lu =6lhO -----END PGP SIGNATURE-----