ubuntu-users at list-post.mks-mail.de
Wed Jun 3 15:03:00 UTC 2009
>> Markus Schönhaber wrote:
>>> Derek Broughton:
>>>> I don't think so - when you create a swap file, it _has_ to be
>>> Really? Where is that documented? BTW: How does one create a file
>>> that's guaranteed to be contiguous - regardless of it's size or the
>>> file system used?
> I _did_ say I don't think so. I'm sure I read that, but not sure where.
Then whoever wrote what you read wherever was wrong:
| ~$ export LANG=C
| ~$ sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048
| 2048+0 records in
| 2048+0 records out
| 2147483648 bytes (2.1 GB) copied, 44.2086 s, 48.6 MB/s
| ~$ sudo filefrag /mnt/swapfile
| /mnt/swapfile: 206 extents found, perfection would be 17 extents
| ~$ sudo mkswap /mnt/swapfile
| Setting up swapspace version 1, size = 2097148 KiB
| no label, UUID=7eb5d59d-fb7a-4f9b-9778-690e4a084e10
| ~$ sudo swapon /mnt/swapfile
| ~$ sudo swapon -s
| Filename Type Size Used Priority
| /dev/mapper/jaunty-swap partition 3903480 24784 -1
| /mnt/swapfile file 2097144 0 -2
> very much doubt you _can_ guarantee a file to be contiguous "regardless of
> file system".
I very strongly doubt that too. I took that as an indication that your
claim that a swap file _has_ to be contiguous is wrong. Otherwise it
would be extremely difficult to use swap files at all.
More information about the ubuntu-users