0

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?

Frederic Close
  • 9,389
  • 6
  • 56
  • 67
user1091968
  • 87
  • 1
  • 3

2 Answers2

2

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.

phlogratos
  • 13,234
  • 1
  • 32
  • 37
1

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.

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61