Did I accidentally delete files? How can I recover them?
7
votes
1
answer
1772
views
I’m a new PhD student and I’m dealing with a serious issue. I tried to map a directory from Server A (/home/lab/Desktop) to Server B (/home/usr/labDesktop) because Server B has better computing power. While working, all the data in the directory on Server A disappeared.
Here’s a part of the sequence of commands I ran, which might have caused the problem:
$ sudo sshfs lab@ipaddress:/home/lab/Desktop /home/usr/labDesktop
[sudo] password for usr:
The authenticity of host 'ipaddress (ipaddress)' can't be established.
XXX key fingerprint is XXX.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
lab@ipaddress's password:
$ ls
labDesktop examples.desktop
$ cd labDesktop
-sh: 44: cd: can't cd to labDesktop
$ ls
labDesktop examples.desktop
$ sudo sshfs lab@ipaddress:/home/lab/Desktop /home/usr/labDesktop
lab@ipaddress's password:
read: Interrupted system call
$ fusermount -u /home/usr/labDesktop
fusermount: entry for /home/usr/labDesktop not found in /etc/mtab
$ ls
labDesktop examples.desktop
$ cd labDesktop
-sh: 49: cd: can't cd to labDesktop
$ rm -r labDesktop
rm: cannot remove 'labDesktop': Permission denied
$ sudo rm -r labDesktop
rm: cannot remove 'labDesktop': Device or resource busy
$ mount | grep /home/usr/labDesktop
lab@ipaddress:/home/lab/Desktop on /home/usr/labDesktop type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
$ fusermount -u /home/usr/labDesktop
fusermount: entry for /home/usr/labDesktop not found in /etc/mtab
$ fusermount -uz /home/usr/labDesktop
fusermount: entry for /home/usr/labDesktop not found in /etc/mtab
$ sudo umount /home/usr/labDesktop
$ mount | grep /home/usr/labDesktop
$ rm -r /home/usr/labDesktop
$ ls
examples.desktop
As you can see, "sudo rm -r" threw an error message, "rm: cannot remove". So I don't believe this actually deleted the data. Moreover, I tried to unmount using "fusermount -u" before running "sudo rm -r". If "fusermount -u" failed with an error message, shouldn’t "sudo rm -r" have also failed with an error message?
1. Could this sequence of commands have caused the files on Server A to be deleted? Or is it likely something else caused the data loss?
2. How to recover them?
Asked by Andy Junghyun Kim
(81 rep)
Dec 28, 2024, 12:58 PM
Last activity: Dec 31, 2024, 06:06 AM
Last activity: Dec 31, 2024, 06:06 AM