2007-01-11 14:59:33

by Jacky Malcles

[permalink] [raw]
Subject: can't cleanup /proc/swaps without rebooting ?

hi All,

Please could you cc me because I'm not subscribed.


is there a way, other than rebooting, to clean up /proc/swaps ?

I'm in this situation (due to testing errors),
# cat /proc/swaps
Filename Type Size Used Priority
/dev/sdc1 partition 2040064 0 -1
/tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
/tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
#
# swapon -s
Filename Type Size Used Priority
/dev/sdc1 partition 2040064 0 -1
/tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
/tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
#

many thanks,

--
Jacky Malcles B1-403 Email : [email protected]
Bull SA, 1 rue de Provence, B.P 208, 38432 Echirolles CEDEX, FRANCE
Tel : 04.76.29.73.14


2007-01-11 15:15:12

by Erik Mouw

[permalink] [raw]
Subject: Re: can't cleanup /proc/swaps without rebooting ?

On Thu, Jan 11, 2007 at 03:59:30PM +0100, Jacky Malcles wrote:
> is there a way, other than rebooting, to clean up /proc/swaps ?
>
> I'm in this situation (due to testing errors),
> # cat /proc/swaps
> Filename Type Size Used
> Priority
> /dev/sdc1 partition 2040064 0 -1
> /tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
> /tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
> #
> # swapon -s
> Filename Type Size Used
> Priority
> /dev/sdc1 partition 2040064 0 -1
> /tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
> /tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
> #

"swapoff /dev/sdc1" or "swapoff /tmp/swa5TlBva/swapfilenext". Don't
know if the latter works when the file is unlinked, just try.


Erik

--
+-- Erik Mouw -- http://www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

2007-01-11 16:09:28

by Hugh Dickins

[permalink] [raw]
Subject: Re: can't cleanup /proc/swaps without rebooting ?

On Thu, 11 Jan 2007, Jacky Malcles wrote:
>
> is there a way, other than rebooting, to clean up /proc/swaps ?
>
> I'm in this situation (due to testing errors),
> # cat /proc/swaps
> Filename Type Size Used
> Priority
> /dev/sdc1 partition 2040064 0 -1
> /tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
> /tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
> #
> #swapon -s
> Filename Type Size Used
> Priority
> /dev/sdc1 partition 2040064 0 -1
> /tmp/swaH4mvTI/swapfilenext\040(deleted) file 48960 0 -31
> /tmp/swa5TlBva/swapfilenext\040(deleted) file 49088 0 -118
> #

Good question. Sorry, I don't see another way than rebooting.
Next time you're testing, best keep a link to those swapfiles.
Not an answer to be proud of, but it looks like a better answer
would need a whole new syscall (or perhaps some /proc trickery).

Hugh