Re: crazy swapping

Mark Gray (markgray@iago.nac.net)
29 Nov 1998 12:02:12 -0500


Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> writes:

>
> When you create a file that have holes (using
> creat();lseek(10000000);write("xxx");close()), and make it swap file,
> system crashes and you get "rw_swap_page: bad swap file" message. Tested
> on 2.0.33 and 2.1.129.
>
> Mikulas Patocka

>From man mkswap:
[snip]
To setup a swap file, it is necessary to create that file
before running mkswap . A sequence of commands similar to
the following is reasonable for this purpose:

# dd if=/dev/zero of=swapfile bs=1024 count=8192
# mkswap swapfile 8192
# sync
# swapon swapfile

Note that a swap file must not contain any holes (so,
using cp(1) to create the file is not acceptable).

[snip]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/