Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

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

 



On Wed, 23 Mar 2022 at 08:41, <bradbell@xxxxxxxxxx> wrote:
I am trying to create a swapfile on my fedora 35 system and do not know what I am doing wrong:
trash>uname -a
Linux fedora 5.16.15-201.fc35.x86_64 #1 SMP PREEMPT Thu Mar 17 05:45:13 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Why do you need to create a swapfile?  Such details are normally handled by the installer in a way that works for
the majority of users.   Is your F35 a fresh install or upgrade?
 
If I follow the swapfile instructions on
https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html

It is unwise to apply Fedora 14 documentation on Fedora 35 -- a lot has changed.  Are you using the default brtfs
filesystem?   On my F35 system with btrfs (and 16GB RAM):

 % swapon -s
Filename                                Type            Size            Used            Priority
/dev/zram0                              partition       8388604         30208           100
 


I get the following result:

step 1:
trash>sudo dd if=/dev/zero of=/swapfile bs=1024 count=65536
65536+0 records in
65536+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.147119 s, 456 MB/s

step 2:
trash>sudo mkswap /swapfile
mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600 /swapfile
Setting up swapspace version 1, size = 64 MiB (67104768 bytes)
no label, UUID=f1402a6a-c64c-4f84-9d47-4f8822d2f1d2

step 3:
sudo  chmod 0600 /swapfile

step 4:
trash>sudo swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument


--
George N. White III

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux