Score:-4

Remotely recover file from rm

EDIT

List of unique (some evidently truncated) values in column 1: bash dbus-daem evolution gnome-she goa-daemo goa-ident grep gsd-disk- gvfs-afc- gvfs-goa- gvfs-gpho gvfs-mtp- gvfs-udis gvfsd gvfsd-fus gvfsd-met gvfsd-net lsof

List of unique (some evidently truncated) values in column 4: dconf\x20 evolution gdbus gmain gnome-she gvfs-afc- gvfs-fuse gvfsd-fus pool-evol pool-gnom


While in an ssh session, I have accidentally removed many files. I want to recover just one of them. I need to first unmount /home, which is separate from /. But

$ sudo mount -o remount,ro /dev/sda3
[sudo] password for user1:
mount: /home: mount point is busy.

and

$ lsof | grep /home
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /home/user2/.cache/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1003/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /home/user3/.cache/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/121/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse file system /home/user2/.cache/doc
      Output information may be incomplete.
...
dbus-daem  61124                          user1     cwd       DIR                8,3     4096     393217 /home/user1   
gvfs-udis  61146                          user1     DEL       REG                8,3              539050 /home/user1   /.config/dconf/user
goa-daemo  61179  61180 gmain             user1     DEL       REG                8,3              539050 /home/user1   /.config/dconf/user
gvfsd-met  61289                          user1     mem       REG                8,3       64     563191 /home/user1   /.local/share/gvfs-metadata/root
gnome-she  61553                          user1     DEL       REG                8,3              540052 /home/user1   /.cache/dconf/user
evolution  61563  61566 dconf\x20         user1     DEL       REG                8,3              539050 /home/user1   /.config/dconf/user
...

The list is (arbitrarily) abbreviated, with the intention of showing representative values. I will soon collect unique values for the 1st and 4th columns.

$ fuser -v -m /home/user1   
                     USER        PID ACCESS COMMAND
/home/user1   :      root     kernel mount /home
                     user1     61124 ..c.. dbus-daemon
                     user1     61139 ..c.. gvfsd
                     user1     61144 ..c.. gvfsd-fuse
                     user1     61146 ..c.m gvfs-udisks2-vo
                     user1     61158 ..c.. gvfs-afc-volume
                     user1     61163 ..c.. gvfs-gphoto2-vo
                     user1     61167 ..c.. gvfs-mtp-volume
                     user1     61175 ..c.. gvfs-goa-volume
                     user1     61179 ..c.m goa-daemon
                     user1     61186 ..c.. goa-identity-se
                     user1     61289 F.c.m gvfsd-metadata
                     user1     61553 ....m gnome-shell-cal
                     user1     61563 ....m evolution-sourc
                     user1     61572 ....m goa-daemon
                     user1     61576 ....m evolution-calen
                     user1     61604 F...m evolution-addre
                     user1     61612 ....m gvfs-udisks2-vo
                     user1     61800 ..c.. gsd-disk-utilit
                     user1     61879 F...m gvfsd-metadata
                     user1     140553 ....m gvfsd-network
                     user1     747684 ..c.. bash

What is the best way (if possible at all) to stop the processes shown, so I can unmount? E.g., evolution-... (and I only mean to stop it once, not to remove it).

Do I have any chance of doing this via ssh in a terminal? Or there will be processes needed by ssh which will block the unmounting? I was using a Remote Desktop session (xRDP) from Win 10, but I already closed my remote gnome session from that xRDP session.

sancho.s ReinstateMonicaCellio avatar
Downvoter... would you care for leaving a comment on what qualifies the OP for that? What could be improved?
sancho.s ReinstateMonicaCellio avatar
... and [Bandwagon effect](https://en.wikipedia.org/wiki/Bandwagon_effect)? This OP is curiously not getting feedback on how to improve, even if I researched before posting, and it doesn't seem to be out of scope.
waltinator avatar
it flag
Questioner wants a solution to a near impossible problem, and has started stirring his system with a `root` stick, remotely, with no understanding of how things work. We're too polite/lazy to respond with "Don't do that. Restore from backup."
waltinator avatar
it flag
I don't downvote for "Bandwith Effect". I downvote because I think it's appropriate.
waltinator avatar
it flag
You must reboot into a disk recovery system. Stop using the disk at once to increase recovery chances.
sancho.s ReinstateMonicaCellio avatar
@waltinator - Thanks for the feedback. Given a "tight" case I tried balancing not-too-delayed actions, with (presumably) innocuous only informative actions, to come up with as many details as possible. If I had a backup, I would have saved the time for looking for a solution and posting/formatting the OP. And I have no access to the physical system, it is 100km away. I mean to recover a file that I created 1 hour ago. So, still I don't see why knowledgeable people (as I know you are) would not consider the OP worth answering, if specific knowledge (and a short time) is available for that.
waltinator avatar
it flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/134146/discussion-between-waltinator-and-sancho-s-reinstatemonicacellio).
sancho.s ReinstateMonicaCellio avatar
@waltinator - In line with comment above, I tried to put together specific questions to frame the problem, and jointly with the help of others try moving forward. Whether this will be successful, I don't know. I am often on the other side...
Jeff avatar
mx flag
Try using `rsync` instead of rm, as rm moves files/directories to another place.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.