Cleanup nextcloud sync data after uninstall

I’ve gotten myself into a hole and need help digging myself out.

i installed nextcloud, synced a folder from an external drive that was larger than the drive nextcloud was installed on preventing me from logging into the system. i then deleted nextcloud but the files remain, somewhere, and i still can’t login. need to know where/how to remove the synced files from this external drive and clean up the system.

DETAILS
nextcloud snap was installed on a desktop running ubuntu 22 for local use. that is, only accessible on local wifi for personal cloud use in a home setting syncing files between a few devices and some external drives. i synced a folder from one of these external drives that was larger than the local drive nextcloud was installed on. this severely dragged down the performance of the system from the now lack of resources available. while the system was up i tried removing the synced folder from the nextcloud desktop app to no affect, the files were still on the system. upon restart ubuntu was unable to complete bootup and present the GUI login.

i then ATL-F2 to another terminal to login and see what is going on. root showed 100% full. i was unable to find where the files were located or instructions on how to cleanup - some snap/nextcloud file locations would not respond to sudo ls or cd commands so i had no vision into where the file glut was. so i figured i’d just uninstall the snap. however, that didn’t work either as synced files were backed up, again somewhere. cli showed a huge swapfile so i deleted that. still doesn’t work.

i’m on the cusp of just reinstalling ubuntu but wanted to check in the community to see if someone can help me.

thank you in advance

I don’t remember where snap puts stuff, but you can use this command to see the size of every file and folder in the current folder. Then you can just follow the disk space.

du -sh *

Since you’ve already uninstalled it, I suspect a snapshot is to blame. Try sudo snap remove --purge nextcloud. This assumes that you didn’t change the data directory to a non-default place.

1 Like

that did it.

no, i did not change the data directory.

so nextcloud must have not uninstalled with sudo snap remove nextcloud otherwise sudo snap remove --purge nextcloud shouldn’t have worked right?

in the future, what is the correct way to reclaim diskspace from a large (or any) folder sync? pointing me in an RTFM direction would be an equally good response.

thank you again! :pray:

It actually has nothing to do with the Nextcloud snap itself (it uninstalled just fine). Snapd, the daemon that runs snaps, tries to be helpful and takes snapshots of your data when a snap is removed. It does this as a disaster recovery mechanism that, when a snap contains a lot of data, is tremendously annoying (it makes the removal take forever, too). When you remove with --purge it asks snapd to drop any of the snapshots it has.

1 Like

ok. i figured it was some automagical gobbledygook. i suppose it makes sense for those who don’t have a backup regime. one more question for the sage, then. if i had reinstalled nextcloud without the purging would the data and file syncs have been reinitiated?

UPDATE: looks like sudo snap restore 30 is the path for restoration

PPS: would forget have been another option than purge?

thank you again.
Peace

I don’t believe that would have happened automatically.

Both are spot on.

1 Like