I had a swap partition on a hard drive (/dev/sdb3), which eventually failed. The drive was removed and replaced. A new swap was created, fstab updated, and turned on (/dev/sdc3), but the old swap still is listed in /proc/swaps, but with (deleted)
.
[root@server01 ~]# cat /proc/swaps
Filename Type Size Used Priority
/dev/sdc3 partition 4194300 0 -2
/dev/sdb3\040(deleted) partition 4194300 0 -1
/dev/sda3 partition 4194300 0 -3
I have tried to remove the swap. swapoff /dev/sdb3
fails with No such file or directory. swapoff -a and swapon -a seem to work without any errors, but /proc/swaps still lists the deleted swap.
How do I remove the swap that doesn't really exist? If needed, will the system still try to use this chunk of swap space? What will happen then?
Additional background: The server can not be rebooted, and the drive was replaced via hotplug interface. The drives are AHCI SATA drives, and do not go through a RAID controller, HBA, or any other special interface. Although /dev/sdb failed and no longer exists, the new drive, when inserted in the same port, became /dev/sdc. /dev/sda exists and works fine throughout this process.
Reference: Another user asked what causes the swap to show as deleted, but I know the cause, just not how to remove it.