You are not logged in.

#1 2020-06-15 20:02:41

fistrosan
Member
Registered: 2020-04-01
Posts: 171

[SOLVED] Swap has holes in it

Hi all,

I just updated my system and right after that I have started to have problems with my swap fle. Already during boot systemd says that it failed to activate the swapfile. When I try manually "sudo swapon /swapfile" I get:

swapon: /swapfile: swapon failed: Invalid argument

My /etc/fstab looks normal to me (and in fact its last modification date was weeks ago so this cannot be the problem)

/swapfile none swap defaults 0 0.

A simple search in journalctl with "journalctl | grep 'swapfile'" tells me that my swapfile has "holes" in it:

Jun 15 21:54:07 archx1 sudo[5950]:  borrero : TTY=pts/1 ; PWD=/home/borrero ; USER=root ; COMMAND=/usr/bin/swapon /swapfile
Jun 15 21:54:07 archx1 kernel: swapon: swapfile has holes

No idea what it means to have holes and why this has just appeared.

The swapfile exists in my root path and it has the right size (I just think it is not active).

Should I remove it and create a new swapfile or is there a way to repair the existing one ?

Last edited by fistrosan (2020-06-17 14:27:48)

Offline

#2 2020-06-15 20:04:55

loqs
Member
Registered: 2014-03-06
Posts: 17,860

Offline

#3 2020-06-16 07:50:42

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: [SOLVED] Swap has holes in it

I see. Ok thanks !  I deleted it and create a new swapfile using dd (https://wiki.archlinux.org/index.php/Swap). The only question left for me is:

When I punched mkswap /swapfile I got an UUID for the swapfile. Regardless I should still not use this in /etc/fstab and stick to the old "/swapfile none swap defaults 0 0". Correct ?

Offline

#4 2020-06-16 09:45:18

tpfkanep
Member
From: South Africa
Registered: 2009-12-15
Posts: 122

Re: [SOLVED] Swap has holes in it

Regardless I should still not use this in /etc/fstab and stick to the old "/swapfile none swap defaults 0 0". Correct ?

I went through the whole recreate-swapfile-because-of-holes procedure, and left my fstab as is:

/swapfile none swap defaults 0 0

Offline

Board footer

Powered by FluxBB