[opensuse-factory] swapoff does swapon instead ...

This is probably an operator fault, but I simply can't see it - On a Factory system, kernel 3.1.0-rc9-1-desktop 32bit, I'm using swapspace over iscsi, it is added via udevd when iscsid is started. I create a link /dev/swapspace pointing to the scsi device, and swap is added, works very well. However, when I try to turn swap off, it only gets added (again). This is what is looks like (same list: http://files.jessen.ch/stork1.txt) A newly booted system: per@stork1:~> uptime 08:50 up 0:03, 1 user, load average: 0.05, 0.09, 0.05 per@stork1:~> swapon -s Absolute path to 'swapon' is '/sbin/swapon', so running it may require superuser privileges (eg. root). per@stork1:~> su - Password: stork1:~ # swapon -s Filename Type Size Used Priority /dev/sde partition 4194300 0 -1 stork1:~ # dmesg | grep swap [ 30.179826] Adding 4194300k swap on /dev/sde. Priority:-1 extents:1 across:4194300k stork1:~ # ls -l /dev/swapspace lrwxrwxrwx 1 root root 3 Oct 28 08:48 /dev/swapspace -> sde I have listed /dev/swapspace in /etc/fstab as it otherwise seemed to cause a problem at shutdown. /etc/fstab: /dev/swapspace swap swap defaults 0 0 Here we go: stork1:~ # swapoff /dev/sde stork1:~ # swapon -s Filename Type Size Used Priority /dev/sde partition 4194300 0 -1 stork1:~ # swapoff /dev/swapspace || echo didnt work stork1:~ # swapon -s Filename Type Size Used Priority /dev/sde partition 4194300 0 -1 stork1:~ # dmesg | grep swap [ 30.179826] Adding 4194300k swap on /dev/sde. Priority:-1 extents:1 across:4194300k [ 361.718216] Adding 4194300k swap on /dev/sde. Priority:-1 extents:1 across:4194300k [ 401.246789] Adding 4194300k swap on /dev/sde. Priority:-1 extents:1 across:4194300k So I straced it: (excerpt) open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=256356, ...}) = 0 mmap2(NULL, 256356, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7670000 close(3) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=26242, ...}) = 0 mmap2(NULL, 26242, PROT_READ, MAP_SHARED, 3, 0) = 0xb7669000 close(3) = 0 readlink("/dev", 0xbfdd2f6b, 4096) = -1 EINVAL (Invalid argument) readlink("/dev/swapspace", "sde", 4096) = 3 readlink("/dev/sde", 0xbfdd2f6b, 4096) = -1 EINVAL (Invalid argument) swapoff("/dev/sde") = 0 exit_group(0) = ? As far as I can tell, the last swapoff() calls works except when I check. What am I missing?? -- Per Jessen, Zürich (6.4°C) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On 28.10.2011 09:13, Per Jessen wrote:
As far as I can tell, the last swapoff() calls works except when I check. What am I missing??
check with "udevadm monitor" if there is a udev event coming in triggering the re-adding or somehting like that. swapoff / swapon works for me (but with /dev/sda5 on local disk, no fancy link etc. -- Stefan Seyfried "Dispatch war rocket Ajax to bring back his body!" -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (2)
-
Per Jessen
-
Stefan Seyfried