Efficient Create Swap File?

Mikkel L. Ellertson mikkel at infinity-ltd.com
Fri Mar 27 22:44:19 UTC 2009


Todd Denniston wrote:
> 
> This brings up a question for me...
> If using the first method, while in use or during the mkswap command,
> does the  bits written to the file end up at the same physical locations
> as the 0s they are replacing?
Yes - you are saving back to the same file. Not like a work
processor that makes a new file, and then renames it to the name of
the original file.
> if they do, then the first method on a disk that is not fragmented,
> would give you a contiguous swap space.
> if they don't, then like you say, what is the point of writing all the
> 0s to disk?
> 
> So then do we have to think about our file systems?
> msdos/vfat would write to the same locations I think.
> ext2 would write to the same locations I think.
> ext3 without journaling, would write to the same locations I think.???
This is the same as ext2. (ext3 is ext2 with journaling.)
> ext3 with journaling, pathology???
> ext4 with/without journaling, I have not used or read about.???
> riser???
> others???
> 
Journaling should not make a difference. It is still reading/writing
the same file on the disk.

I am not sure how to explain this. You are accessing the file just
like you would access a hard drive. You are doing the equivalent of
accessing the track and sector of a hard drive. (Note: hard drives
are accessed as files under Linux/UNIX.) So if you read one block
from the file, modify it, and write it back to the same place, it is
also on the same place on the hard drive as the old block was.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20090327/79abdb21/attachment-0001.bin 


More information about the users mailing list