[lkml]   [2000]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: mkswap/swapon problems
On Fri, Sep 22, 2000 at 04:59:11PM +0200, Pavel Machek wrote:

> test8 exhibits rather strange behaviour:
> root@bug:~# ls -al /tmp/swap
> -rw-r--r-- 1 root root 27164672 Sep 22 16:58 /tmp/swap
> root@bug:~# mkswap /tmp/swap
> Setting up swapspace, size = 27160576 bytes
> root@bug:~# swapon /tmp/swap
> swapon: /tmp/swap: Invalid argument
> root@bug:~# sync
> root@bug:~# swapon /tmp/swap
> root@bug:~#

For me:

# dd if=/dev/zero of=/b2/tmp/swap bs=1024 count=26528
26528+0 records in
26528+0 records out
# ls -al /b2/tmp/swap
-rw-r--r-- 1 aeb users 27164672 Sep 22 22:37 /b2/tmp/swap
# mkswap /b2/tmp/swap
Setting up swapspace version 1, size = 27160576 bytes
# swapon /b2/tmp/swap

So, first observation: you have an old mkswap.

Second observation: I presume that because of some aliasing,
the swap signature was not seen at first. The present mkswap
source says:

* A subsequent swapon() will fail if the signature
* is not actually on disk. (This is a kernel bug.)
if (fsync(DEV))
die(_("fsync failed"));

that is, current mkswap already does the sync that you did by hand.
It has been required for a long time.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:39    [W:0.125 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site