From: David Sterba <dsterba@suse.cz>
To: Timofey Titovets <nefelim4ag@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: swapfile on btrfs, temporary solution for wiki
Date: Wed, 30 Oct 2013 16:54:53 +0100 [thread overview]
Message-ID: <20131030155453.GA8516@twin.jikos.cz> (raw)
In-Reply-To: <CAGqmi74F9GurJL73qtU4JG+Fi4RbXE7tiaO1uEQqEY2ym278eA@mail.gmail.com>
On Thu, Oct 24, 2013 at 11:52:01PM +0300, Timofey Titovets wrote:
> Hello, i suggest temporary solution to use swap file under btrfs.
> I test it, and it work good.
>
> I invent simple the way, how create and using swap file, just see
> following sh code:
>
> swapfile=$(losetup -f) #free loop device
> truncate -s 8G /swap #create 8G sparse swap file
I'd suggest to do full dd on that file and make it NOCOW first. That way
it should minimize attempts to actually allocate the file blocks at the
time they're needed for swap out.
Also a bit of stress testing that this actually works is needed.
> losetup $swapfile /swap #mount file to loop
> mkswap $swapfile
> swapon $swapfile
david
next prev parent reply other threads:[~2013-10-30 15:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 20:37 swapfile on btrfs, temporary solution for wiki Тимофей Титовец
2013-10-24 20:52 ` Timofey Titovets
2013-10-25 9:36 ` dima
2013-10-25 10:35 ` Roman Mamedov
2013-10-25 10:44 ` Hugo Mills
2013-10-26 9:28 ` karim.allah.ahmed
2013-10-26 9:30 ` karim.allah.ahmed
2013-10-26 11:50 ` Hugo Mills
2013-10-26 14:11 ` Duncan
2013-10-30 15:54 ` David Sterba [this message]
2013-10-30 20:11 ` Timofey Titovets
2013-10-30 20:12 ` Timofey Titovets
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131030155453.GA8516@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nefelim4ag@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).