You are not logged in.
Pages: 1
A few questions I have:
1) What are swap files?
2) What are their advantages compared to swap partitions?
3) How would I use them?
Offline
AFAIK:
1) same as swap partitions, just instead of being a partition its a file
2) no advantage, as its still limited by disk I/O
3) this might be what you're looking for
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Offline
it means swap file is slower than swap partitions?
Offline
A bit. But with modern RAM volumes swapping becomes a bit of rare emergency... So swap files instead of swap partitions can be a good idea.
Offline
I've been wondering though, would there be security risks for swap files? They're just like other files residing on the hard disk, and it would be possible to exploit it since it holds RAM information. Don't quite know for sure.
I need real, proper pen and paper for this.
Offline
If I want to hibernate, I guess that I'd have to use swap partition.... But because of that I've already partitioned my hard disk without using a swap partition, I may use a swap file.. But in this situation, initrd wouldn't read that swap file and can't wake the computer from hibernate, right ?
Quis custodiet ipsos custodiet?
Offline
You are right if you talking about standard kernelspace hibernate. But there are ways to use swap files.
From the wiki:
tuxonice allows you to suspend on a regular file if you have not a swap partition, while uswsusp give this possibility only if you run an experimental and unstable mm kernel.
Offline
it means swap file is slower than swap partitions?
A bit, probably not noticeable unless your swap file is heavily fragmented
I've been wondering though, would there be security risks for swap files? They're just like other files residing on the hard disk, and it would be possible to exploit it since it holds RAM information. Don't quite know for sure.
The swap file should be owned by root.
Offline
schivmeister wrote:I've been wondering though, would there be security risks for swap files? They're just like other files residing on the hard disk, and it would be possible to exploit it since it holds RAM information. Don't quite know for sure.
The swap file should be owned by root.
Note that the fact that it's on a separate partition does *not* provide any security. Anyone with a read permission on /dev/<thatpartition> can read the swap. By the way, just try 'strings /dev/<swappartition> | grep <your root password>' and see how many times it's there [And note that your root password gets written to ~/.bash_history so you want to be careful with that command as well ]
Last edited by bender02 (2008-06-02 17:39:51)
Offline
Zepp wrote:schivmeister wrote:I've been wondering though, would there be security risks for swap files? They're just like other files residing on the hard disk, and it would be possible to exploit it since it holds RAM information. Don't quite know for sure.
The swap file should be owned by root.
Note that the fact that it's on a separate partition does *not* provide any security. Anyone with a read permission on /dev/<thatpartition> can read the swap. By the way, just try 'strings /dev/<swappartition> | grep <your root password>' and see how many times it's there [And note that your root password gets written to ~/.bash_history so you want to be careful with that command as well ]
Yes, the swap partition should also be owned by root for the same reason.
Offline
Yes, the swap partition should also be owned by root for the same reason.
I didn't mean to contradict you, I was just trying to give some perspective on the problem. I'd say, not only owned by root, but also chmodded to 600. On the side, the standard permissions on /dev/<block device> are "brw-rw---- root disk", so anyone in the 'disk' group can read the swap partition.
Offline
Zepp wrote:Yes, the swap partition should also be owned by root for the same reason.
I didn't mean to contradict you, I was just trying to give some perspective on the problem. I'd say, not only owned by root, but also chmodded to 600. On the side, the standard permissions on /dev/<block device> are "brw-rw---- root disk", so anyone in the 'disk' group can read the swap partition.
Yes, you are absolutely correct on the permissions, and ya no it was good that you elaborated on my point I didn't really explain what I was getting at originally .
Offline
Pages: 1