How to safely remove a stuck "ghost" USB folder via SSH

Hi everyone!

If you unplugged a USB drive from your ZimaOS / CasaOS device but the “ghost folder” is still showing up in the system and you want to get rid of it, you can safely delete it via SSH.

Here are the step-by-step instructions:

  1. Connect to your ZimaOS device via SSH.

  2. Run the following command to list the folders and find the exact name of the stuck USB drive:

    bash

    ls -la /media/
    
    
  3. Delete ONLY that specific stuck folder (make sure to replace YOUR_USB_NAME with the actual folder name you found in the previous step):

    bash

    sudo rm -rf /media/YOUR_USB_NAME
    
    
  4. Finally, restart your system to clear everything up:

    bash

    sudo reboot
    
    

(Note: Never use * at the end of the rm command, as it could accidentally wipe your other connected drives or data inside the media folder!)

Hope this helps the community!

1 Like