Hi!
It is possible to remove swapfile in use. Great, but how do you swap
off then? Who is to blame?
root@bug:~# swapoff /tmp/swap
swapoff: /tmp/swap: No such file or directory
root@bug:~# > /tmp/swap
root@bug:~# swapoff /tmp/swap
swapoff: /tmp/swap: Invalid argument
root@bug:~#
How do I get out of this bad situation?
Pavel
On Sat, 9 Dec 2000, Pavel Machek wrote:
> It is possible to remove swapfile in use. Great, but how do you
> swap off then? Who is to blame?
As usual, root is to blame ;)
> root@bug:~# swapoff /tmp/swap
> swapoff: /tmp/swap: No such file or directory
> root@bug:~# > /tmp/swap
> root@bug:~# swapoff /tmp/swap
> swapoff: /tmp/swap: Invalid argument
> root@bug:~#
Don't let your automatic /tmp cleaners remove the swap
file ;)
> How do I get out of this bad situation?
Reboot.
cheers,
Rik
--
Hollywood goes for world dumbination,
Trailer at 11.
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/
> On Sat, 9 Dec 2000, Pavel Machek wrote:
>
> > It is possible to remove swapfile in use. Great, but how do you
> > swap off then? Who is to blame?
>
> As usual, root is to blame ;)
I do not agree. It is too easy to get to situation like this.
> > root@bug:~# swapoff /tmp/swap
> > swapoff: /tmp/swap: No such file or directory
> > root@bug:~# > /tmp/swap
> > root@bug:~# swapoff /tmp/swap
> > swapoff: /tmp/swap: Invalid argument
> > root@bug:~#
>
> Don't let your automatic /tmp cleaners remove the swap
> file ;)
>
> > How do I get out of this bad situation?
>
> Reboot.
I'm afraid even reboot will not work.
I can't swapoff. Therefore filesystem is busy (it must be -- kernel
might be writing to file on it!). And no way to get out of that.
--
The best software in life is free (not shareware)! Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+
At 10:24 PM 12/9/2000 +0100, you wrote:d
>It is possible to remove swapfile in use. Great, but how do you swap
>off then? Who is to blame?
Perhaps it would be good to put a check in unlink to make sure that this is
not the last link to a swapfile. Are there any other sorts of files that
don't belong to any user process and may remain active after unlink?
--
This message has been brought to you by the letter alpha and the number pi.
Open Source: Think locally; act globally.
David Feuer
[email protected]
> I can't swapoff. Therefore filesystem is busy (it must be -- kernel
> might be writing to file on it!). And no way to get out of that.
It's busy because some portion of memory is in use. manually kill things as
best you can. this will clean out the swap. once you've gotten all
applications killed cleanly you can forcibly reboot with little damage. this
is pretty much the only way out. we don't have any method (currently) to
turn off a swap file if it's deleted.
Some ideas for the future, /var/run/swap.inode files, some form of sysctl.
-d
[David Feuer]
> Perhaps it would be good to put a check in unlink to make sure that
> this is not the last link to a swapfile.
Much better to add code to /sbin/swapon and /sbin/swapoff to set and
clear immutable bit. Sure it only works on ext2 but how far do you
want to take this thing?
Peter
At 01:56 AM 12/10/2000 -0600, Peter Samuelson wrote:
>[David Feuer]
> > Perhaps it would be good to put a check in unlink to make sure that
> > this is not the last link to a swapfile.
>
>Much better to add code to /sbin/swapon and /sbin/swapoff to set and
>clear immutable bit. Sure it only works on ext2 but how far do you
>want to take this thing?
In a private email, [email protected] wrote:
>No; we should add some more magic-symlink /proc entries, like
>/proc/<pid>/fd/<n> for swap files. Then they can be accessed
>by swapoff even if they're deleted.
Seems like a good idea to me...
--
This message has been brought to you by the letter alpha and the number pi.
Open Source: Think locally; act globally.
David Feuer
[email protected]
Hi!
> >[David Feuer]
> > > Perhaps it would be good to put a check in unlink to make sure that
> > > this is not the last link to a swapfile.
> >
> >Much better to add code to /sbin/swapon and /sbin/swapoff to set and
> >clear immutable bit. Sure it only works on ext2 but how far do you
> >want to take this thing?
>
> In a private email, [email protected] wrote:
>
> >No; we should add some more magic-symlink /proc entries, like
> >/proc/<pid>/fd/<n> for swap files. Then they can be accessed
> >by swapoff even if they're deleted.
>
> Seems like a good idea to me...
We could make them opened by kswapd.
Pavel
--
I'm [email protected]. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at [email protected]