What are the advantages of Linux storing its page file in a separate partition?

1.6k Views Asked by At

Linux stores its page file on a separate partition on the hard drive versus how Windows stores it on the same partitions... what is the advantage and disadvantage to this? My professor mentioned that it's to delete the page file in this case if it gets infected... but there has to be more than that.

Long story short, why does Linux do this and are there negative consequences?

2

There are 2 best solutions below

0
phlogratos On

Swapping on a raw block device is faster because no file system driver has to be invoked. Besides this linux can also swap on regular files in a file system.

0
Kevin Panko On

Swapping to a partition is faster because it does not have to manage a file system, but this speed difference is probably not the real reason. Another reason is it's easier to configure a system this way because you do not need a file system to exist in order to have swap, and if your drive is failing you might not have one.

Your prof might be just making things up -- if anything were to be "infected" you can just reboot and the swap info will be cleared, regardless of being a file or a partition.