Results 1 to 3 of 3

Thread: recovering files after executing sudo rm -Rfv command

  1. #1
    Join Date
    Mar 2015
    Beans
    1

    Unhappy recovering files after executing sudo rm -Rfv command

    Hi,

    I accidentally deleted the files from an nfs mount point, before I execute the rm -Rfv, I unmount the mount point by running sudo umount -av. My mistake was only verifying if the 2 mount points are already unmounted. We have 2 mount point usadata0 and USA_DB. what I need to recover is the USA_DB which is being mounted from the server. By the way we are using xfs filesystem for that mount point. Is there anyway we can recover it? I already tried testdisk and Raise Data Recovery, but no luck .

    thank you very much.

  2. #2
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: recovering files after executing sudo rm -Rfv command

    Sorry to tell you this, but you shouldn't expect a happy ending to this story. Have not worked with XFS, but a quick Google search provides little cause for optimism. Is it a RAID array? If so, then you have an orders-of-magnitude harder problem since the data is striped across multiple disks. I am not remotely qualified to help you with this―hoping oldfred or some other guru will step in here―but until they do, at least unplug the NAS (or whatever machine is serving the data) so that as little as possible is written to its HDD. If it's just a single disk, then your chances improve from "all but impossible" to "highly improbable". Have a look at this old thread (it's five years old, but still relevant) and also consider trying PhotoRec which I understand will work with XFS. You might also consider imaging the HDD as per post #15 of aforementioned thread.

    Aside from above, I'm not qualified to help you any further.

    P.S. I know that it is closing the barn door after the horses have bolted, but any form of
    Code:
    sudo rm -rf
    is juggling a live hand grenade. I don't see the point in the -v flag when you invoke such a nuclear option except you get to actually see the train wreck as it unfolds before your eyes. At least the -i or -I flag will give you the chance to limit the damage.

  3. #3
    Join Date
    Nov 2009
    Location
    Rhode Island
    Beans
    23
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: recovering files after executing sudo rm -Rfv command

    I'm going to have to agree with DuckHook. Those files are probably gone.

    Pro Tip: alias rm='rm -i'
    Last edited by sandyd; March 20th, 2015 at 03:32 AM. Reason: font
    "Talk is cheap, show me the code." ~ Linus Torvalds

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •