This bug report leads to this discussion
So "Invalid argument" should be read as "Your filesystem do not support swap file"
O que há de errado com esta seqüência de operação, rodando em um sistema Debian Squeeze com um sistema de arquivos Btrfs?
$ dd if=/dev/zero of=swapfile2 bs=1024 count=524288
$ sudo mkswap swapfile2
$ sudo chown root:root swapfile2
$ sudo chmod 0600 swapfile2
$ sudo swapon -v -f swapfile2
swapon on swapfile2
swapon: /home/mathieu/swapfile2: found swap signature: version 1, page-size 4, same byte order
swapon: /home/mathieu/swapfile2: pagesize=4096, swapsize=536870912, devsize=536870912
swapon: swapfile2: swapon failed: Invalid argument
Meu sistema de arquivos é:
$ mount
/dev/mapper/voxbox-root on / type btrfs (rw)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/mapper/voxbox-boot on /boot type ext2 (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
This bug report leads to this discussion
So "Invalid argument" should be read as "Your filesystem do not support swap file"
Se você quiser trocar um arquivo de qualquer maneira, basta usar btrfs-swapon
Invalid argument
diz que algo está errado nos argumentos do comando swapon
.
Primeiro, leia man swapon
.
Experimente sudo swapon swapfile2
. No meu caso, funciona.
Tags swap btrfs linux filesystems