From mboxrd@z Thu Jan 1 00:00:00 1970 From: david.larsson@selfhosted.xyz Subject: bug#34255: wishlist: Add guix-y way to create swapfile Date: Sun, 3 Feb 2019 16:59:14 +0100 (CET) Message-ID: References: <85f0c642-8f24-3b33-ded8-dee9e191f567@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([209.51.188.92]:53511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqKBh-0003IG-Kw for bug-guix@gnu.org; Sun, 03 Feb 2019 11:00:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqKBg-0003Cy-NP for bug-guix@gnu.org; Sun, 03 Feb 2019 11:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58442) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqKBe-00039k-OG for bug-guix@gnu.org; Sun, 03 Feb 2019 11:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gqKBe-0005Qp-Gf for bug-guix@gnu.org; Sun, 03 Feb 2019 11:00:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <85f0c642-8f24-3b33-ded8-dee9e191f567@riseup.net> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: swedebugia Cc: 34255@debbugs.gnu.org > Hi > > I specified a swapfile in my config without creating it on disk manually. > > (swap-devices '("/swapfile")) > > Then I predictably got this error: > > guix system: error: exception caught while executing 'start' on service > 'swap-/swapfile': > In procedure swapon: "/swapfile": No such file or directory > > I think we should let guix do all the dirty work of generating the swapfile > so we can do something like: > > (swap-file > (file "/swapfile")) > (size "1G")) > > And then guix will invoke the relevant file tools to create and enable the > swap file. > > We could add a check to see if the file exist and if yes try to use it as is. Hi, I just want to give a little warning or tip regarding swapfiles on btrfs. Generally you can't use swapfiles on btrfs - swapon will throw an error and btrfs-balance will corrupt the filesystem but with a few tricks swapfiles actually can be used on btrfs: https://github.com/sebastian-philipp/btrfs-swapon Best regards, David L