From owner-freebsd-questions@freebsd.org Sat Oct 13 13:52:52 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F7C10CAB46 for ; Sat, 13 Oct 2018 13:52:52 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D17767B9B2 for ; Sat, 13 Oct 2018 13:52:51 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wr1-x436.google.com with SMTP id n1-v6so16295437wrt.10 for ; Sat, 13 Oct 2018 06:52:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yWu6+1QnTGHyxO7E1PjxxPLOlugflioCXdiGWF4KPoQ=; b=DSqQ4AtAse15jGpQcEW+JXwjp4oFIgNzJlRA33/yoOGpmcACI5pftvqOhpfGtf1OLo KxUkXVe8wjeVMimVFPHrNjXpu07K9ccvTD+l95UqJZc5lijiKFVFF1//ONTUZE827Qdh 9jz30gBL/DOpu8wTAdzUeTm0hL8tr4ZXjy4PoKm3I+BHc8s2fAgaV+J3fh4POkvokiXn 1+yQSzdKvVcqInTRixgQqQ67F8RDKD9YElu5ewJPhUeTvxLUqi+g7XGK2548oEYZCbeh 1b5WMKvrjUzWjPM1r0zu1o3WE1N/VoCT1FyXEbQalht8uXYuOsym9v2lXTWG3Z8a7huZ /H5A== X-Gm-Message-State: ABuFfohpZwxxresQkFprE3/q9b3O58sNm9umGK5AREEC0Ngq5Sun1NEb SFE+DGa3azRiGFPaMSmV7TwHH4oUOCk= X-Google-Smtp-Source: ACcGV61PekRC+knaAP8W2WWZe/W1Ctz1VKGg2UudTOQhqi9KQGdknlieEol6M/I93veuBzfT40gxrw== X-Received: by 2002:a5d:6309:: with SMTP id i9-v6mr8316292wru.163.1539438770325; Sat, 13 Oct 2018 06:52:50 -0700 (PDT) Received: from gumby.homeunix.com ([90.209.155.76]) by smtp.gmail.com with ESMTPSA id 74-v6sm3868829wmi.23.2018.10.13.06.52.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Oct 2018 06:52:49 -0700 (PDT) Date: Sat, 13 Oct 2018 14:52:47 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: swap to a sparse file Message-ID: <20181013145247.0a4b7f05@gumby.homeunix.com> In-Reply-To: <20181013081118.9e8632405e555c3bf2f9a722@sohara.org> References: <20181011014705.GA17798@admin.sibptus.ru> <20181011085114.bfcdb701b3644728a71eaa38@sohara.org> <20181012193633.7dc32f86@gumby.homeunix.com> <20181013081118.9e8632405e555c3bf2f9a722@sohara.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd11.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 13:52:52 -0000 On Sat, 13 Oct 2018 08:11:18 +0100 Steve O'Hara-Smith wrote: > On Fri, 12 Oct 2018 19:36:33 +0100 > RW via freebsd-questions wrote: > > > On Thu, 11 Oct 2018 08:51:14 +0100 > > Steve O'Hara-Smith wrote: > > > > > On Thu, 11 Oct 2018 08:47:05 +0700 > > > Victor Sudakov wrote: > > > > > > > Is there any good reason I can't just "truncate -s2G /swap0" and > > > > make the swap a sparse file? > > > > > > Just one - if the space isn't there when the system needs > > > it there will be a panic. > > > > Is that really the only reason? I've not paid much attention, but > > the warnings I've heard about this have made it sound a lot worse. > > There's not much worse the system can do than panic, other > than deadlock which might happen if memory needs to be allocated in > order to add blocks to the file. IIRC swap on a zvol can deadlock > that way. Yes, but filling up a drive is relatively avoidable - particularly if there's space reserved for root.