[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: swapon command error



On 09.09.21 19:46, lin dimitri wrote:
I am trying to increase my swap memory, below is the commands I used:-
$ sudo swapon --show
$ sudo swapoff -a
$ sudo fallocate -l 4G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
swapon failed: Function not implemented

i got above error.

I have CONFIG_SWAP=y in /proc/config.gz.

i don't know how this can be solved

from mkswap man page:

      Note  that a swap file must not contain any holes.  Using cp(1) to cre‐
      ate the file is not acceptable.  Neither is use of fallocate(1) on file
      systems  that  support  preallocated  files, such as XFS or ext4, or on
      copy-on-write filesystems like btrfs.  It is recommended to  use  dd(1)
      and  /dev/zero in these cases.  Please read notes from swapon(8) before
      adding a swap file to copy-on-write filesystems.


--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Posli tento mail 100 svojim znamim - nech vidia aky si idiot
Send this email to 100 your friends - let them see what an idiot you are


Reply to: