0

As I was running low on space I tried to move my snap to another disk following the answer from Muhammad here: Move snap packages to another location/directory

It broke everything and I cant get it back... I tried running several times the steps to revert but nothing works. Please help me, I am new to Ubuntu and it feels like my system is broken...

This is what I ran initially:

#Stop auto-updating (will *not* crash snaps already open)
sudo systemctl mask snapd.service
sudo systemctl stop snapd.service
sudo systemctl disable snapd.service

#Copy the data sudo rsync -avzP /var/lib/snapd/ /mnt/EC89002B88FFF246/Ubuntu/snap/snapd/

#Do backups sudo mv /var/lib/snapd /var/lib/snapd.bak sudo cp /etc/fstab /etc/fstab.bak

#Change fstab (Change $USER with your name or change the path totally) echo "/mnt/EC89002B88FFF246/Ubuntu/snap /var/lib/snapd none bind 0 0" | sudo tee -a /etc/fstab

#remount fstab Or reboot. sudo mkdir /var/lib/snapd sudo mount -a

if ls /var/lib/snapd/ | grep snaps then echo "Re-mounting snapd folder is done successfully. !!!!" sudo rm -rf /var/lib/snapd.bak else echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! " echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! " echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! " echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! " echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! "

# Trying to revert automatically
sudo cp /etc/fstab.bak /etc/fstab

sudo mount -a
sudo umount /var/lib/snapd

sudo mv /var/lib/snapd.bak /var/lib/snapd

echo "Files located at ~/snap/snapd should be removed, but are kept for
recovery until you, manually reboot the system and make sure the service
is running correctly. Then you can manually remove the folder ~/snap/snapd
!!!!!!!!!!!!!!, you should do that manually."

fi

#Restart auto-updating sudo systemctl unmask snapd.service sudo systemctl start snapd.service sudo systemctl reenable snapd.service

I am not expert but it seems like it did not restore properly var/lib/snap: Disk Analyzer output

Please help me

Jechos
  • 1

0 Answers0