Welcome to the new 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.

[[email protected] ~]# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 4063228 6972 -1
[[email protected] ~]# 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
[[email protected] ~]# mkswap swpfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=55ec2a9f-a003-4031-a4f4-eaf9627d132d
[[email protected] ~]# swapon swpfile
swapon: /root/swpfile: insecure permissions 0644, 0600 suggested.
swapon: swpfile: swapon failed: Invalid argument
[[email protected] ~]# chown root:root swpfile
[[email protected] ~]# chmod 600 swpfile
[[email protected] ~]# swapon swpfile
swapon: swpfile: swapon failed: Invalid argument

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

Comments

Sign In or Register to comment.