Can't edit, delete my external storage

I saw someone mention a similar issue, except they couldn’t even access their storage. I can access them fine, but I just can’t edit or delete them.

I created a duplicate of the same external storage, with the settings I wanted, but then I couldn’t remove the first. This is true on two different instances of nextcloud: one on my LAN, and one on a VPS. The LAN uses an external USB hard drive, and the VPS uses AWS-compatible object storage and the result is the same.

I have a solution for this:

sudo -u www-data php occ files_external:list

Use this to get the ID of the storage you want to unmount. Then run:

sudo -u www-data php occ files_external:delete <id>

And that will remove the storage.