swap file vs swap partition

Matt Graham mhgraham at crow202.org
Wed Oct 28 17:08:03 MST 2020


On 2020-10-28 16:24, Steve Litt via PLUG-discuss wrote:
> On Wed, 28 Oct 2020 13:43:22 -0700
> Bob Elzer via PLUG-discuss <plug-discuss at lists.phxlinux.org> wrote:
>> The biggest difference is, files can become fragmented while
>> partitions don't.
> I had no idea there was such a thing as a Linux swap file. I guess
> that's a recent thing.

You could use a file as swap space in the early 2000s.  I remember 
doing that on a few machines then.

> If my partition file becomes fragmented, is there a way for me
> to defragment it?

Probably not.  However, file fragmentation is not generally a problem 
on modern machines because disks and CPUs are much faster than they were 
in 1998.  If you use ext4 and have a disk that's less than 10 years old 
and less than 95% full, you will not notice anything.  /swapfile on my 
laptop has 11 extents and it doesn't seem to have any problems.

-- 
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.


More information about the PLUG-discuss mailing list