Welcome to the Linux Foundation Forum!

Lab 13.1 swapon failed: Invalid argument

I'm sure I'm overlooking something, but I'm getting an "swapon failed: Invalid argument" on this lab.

I'm running CentOS 7 for these labs.

[root@localhost ~]# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 4063228 6972 -1
[root@localhost ~]# dd if=/dev/zero of=swpfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 6.13878 s, 175 MB/s
[root@localhost ~]# mkswap swpfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=55ec2a9f-a003-4031-a4f4-eaf9627d132d
[root@localhost ~]# swapon swpfile
swapon: /root/swpfile: insecure permissions 0644, 0600 suggested.
swapon: swpfile: swapon failed: Invalid argument
[root@localhost ~]# chown root:root swpfile
[root@localhost ~]# chmod 600 swpfile
[root@localhost ~]# swapon swpfile
swapon: swpfile: swapon failed: Invalid argument

I've checked out the man pages and googled the error. Any tips or ideas? Thanks



Upcoming Training