Hi, I have just recently installed Debian squeeze with a root filesystem on btrfs [1]. I have noticed however that I cannot set up a swap file stored on the btrfs volume: dd if=/dev/zero of=/var/swap bs=16M count=4 mkswap /var/swap chmod 0 /var/swap swapon /var/swap [ 01751.879759] swapon: swapfile has holes swapon: /var/swap: swapon failed: Invalid argument For now I''ve set up a swap file under /boot (ext4), but is swap on btrfs expected to work? I''m using the stock Debian linux kernel 2.6.32-5-amd64. 1: This took a little bit of work - http://lists.debian.org/debian-user/2011/01/msg00217.html -- Paul Richards @pauldoo -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Domingo, 9 de Enero de 2011 18:21:02 Paul Richards escribió:> For now I''ve set up a swap file under /boot (ext4), but is swap on > btrfs expected to work? I''m using the stock Debian linux kernel > 2.6.32-5-amd64.AFAIK swapfiles are not supported, at least for now. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Gour-Gadadhara Dasa
2011-Aug-23 15:29 UTC
Re: Swap file on btrfs fails ("swapfile has holes")
On Sun, 9 Jan 2011 19:19:44 +0100 Diego Calleja <diegocg@gmail.com> wrote: Hello,> AFAIK swapfiles are not supported, at least for now.At the moment I use FreeBSD with zfs (two disks in mirror) and plan to return back to (Arch)linux. Considering that with zfs I''ve everything in one (z)pool - root, swap - I''d like to have similar setup with btrfs on Linux and wonder is there any work done to provide swap space? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
it seems to me that the swap file interface doesn''t make sense; to "eliminate the middleman" and provide a direct swap tree type would be the way to go, so a btrfs can hold swapped pages. Doing this would AIUI require: 1) direct interface to btrfs trees, not via file-system interface 2) modifying swapping to use (1) instead of essentially the swap-to-a-partition mechanisms to the "swap file" presented as a loop device I also wonder if you explicitly create a loop device for your swap file and mount that as swap, will that work and if so how poorly. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html