As I was checking the /etc/fstab I noticed that the swap space has attr pass=0, which means its filesystem is not checked at boot time.
Can anyone please tell me why is this behavior for?
Fstab – Why Swap Space Doesn’t Get Filesystem Check at Boot Time?
fsckfstabswap
Best Answer
At boot time, swap doesn’t contain any data which would need to be recovered, so there’s no point in writing a tool to repair swap. If a swap partition or file is corrupted in such a way that
swapon
can’t make use of it, the fix is tomkswap
it again — there’s no need for a separatefsck.swap
tool, so there isn’t one and/etc/fstab
isn’t set up to use one.It might then seem nice for
swapon
to automaticallymkswap
if necessary, but that would mean that any mistake in the arguments toswapon
would be instantly fatal to the data stored in the given volume or file.