Skip to contentSkip to conversation

can't cleanup /proc/swaps without rebooting ?

DISCUSSION Jacky Malcles 3 participants 3 messages Jan 11, 2007

lore
Share & tools
lore
#0 lore raw

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,

Signature · 3 lines
 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
#1 lore raw
Quoted 17 lines · Jacky Malcles

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

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#2 lore raw
In reply to Jacky Malcles
Quoted 4 lines · Jacky Malcles

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

I'm in this situation (due to testing errors),

Quoted 14 lines
# 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