0

I just made my USB an additional swap and after all done I did not know how could I take the USB off my computer properly, so I just pulled it off. When I open htop the swap space that the USB provided stayed there and when I made another additional swap space with the same USB it got even bigger.

How do I update my swap space and how can I take the USB off properly?
Also is there a way to make the pendrive a storage thing again?

I'm using Ubuntu 19.04.

1 Answers1

0

I assume the entire pendrive (e.g. /dev/sdx) was used as swap.

How do I update my swap space and how can I take the USB off properly?

You enable/disable devices and files for paging and swapping with swapon/swapoff. I guess you had used mkswap and swapon. You should have run swapoff /dev/sdx before unplugging the device.

Now sole swapon probably shows something like /dev/sdx (deleted). Unfortunately swapoff /dev/sdx will yield No such file or directory. I have found no way to overcome this (compare this old topic and this answer).

A reboot should solve the issue. In case you have added the now unwanted swap to your /etc/fstab, you probably want to remove the entry.


Is there a way to make the pendrive a storage thing again?

To "clear" the pendrive use wipefs, e.g. wipefs -a /dev/sdy. Then there should be no problem with creating partitions (fdisk, gdisk, …) or a filesystem (mkfs, but mind this).