Swap file vs swap partition ? when to use what ? any disadvantages or advantage . . .

AKASH AK:
swap file vs swap partition ?
when to use what ?
any disadvantages or advantage over one another?

Aaron Lockhart:
It’s easier to grow or shrink a swap file than a swap partition in many cases, so a swap file offers flexibility there. You can also move a swap file to a different disk, so it can be placed away from disks that typically see intense I/O operations, which can be a benefit for performance.

A swap partition is easily encrypted with the tools we cover in the course, so any machine that may hibernate (like a laptop) may benefit from this from a security standpoint. If you’re using mechanical storage with a spinning disk, you can create the swap partition closer to the inside of the disk, which marginally increases performance. That’s not so much of a concern these days, but it used to be.

AKASH AK:
@Aaron Lockhart you are the best !!
thank you for the infomation
was google for hh but didn’t find usefull info

Aaron Lockhart:
Again, my pleasure!