Results 1 to 7 of 7

Thread: Recover deleted folder on btrfs

  1. #1

    Default Recover deleted folder on btrfs

    I have an opensuse server where a user of mine accidentally deleted an important folder of his using rm-r before i had setup any syncs, backups and snapper to work with home directory. The entire / and all folders use btrfs but i noticed that the snapshots only record settings rather than file. How do i recover that deleted folder? Currently the server is physically off.

    How do i set up snapper to work with files sort of like dropbox and microsoft does with file versioning?
    I've recovered deleted files before but only on windows based filesystems.

  2. #2
    Join Date
    Feb 2016
    Location
    Berlin
    Posts
    357

    Default Re: Recover deleted folder on btrfs

    the snapshots contain the contents not settings (COW). as a start you can go to yast->snapper to browse and restore file changes from their. you should generally either not keep home on btrfs (or turn off cow).

  3. #3

    Default Re: Recover deleted folder on btrfs

    Quote Originally Posted by ndc33 View Post
    the snapshots contain the contents not settings (COW). as a start you can go to yast->snapper to browse and restore file changes from their. you should generally either not keep home on btrfs (or turn off cow).
    This is the sort of arrogant behaviour that made me ditch ubuntu. OPENSUSE DOES NOT BY DEFAULT SET UP SNAPPER TO VERSION YOUR FILES. I would not be asking here if it did.

    Even the btrfs tutorials on file recovery done work on opensuse because the commands arent there or are different that i cant identify the blocks i need in order to run the right commands that work.

  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,590

    Unhappy Re: Recover deleted folder on btrfs

    We seem to have left this request hanging, which is IMHO not good . . .
    Quote Originally Posted by System_Error_Message View Post
    The entire / and all folders use btrfs but i noticed that the snapshots only record settings rather than file. How do i recover that deleted folder?
    Unfortunately, for Btrfs there doesn't seem to be very much out there; there is "debugfs" but, it's only for "ext2/3/4" file systems.
    The only Btrfs tools which are installed by default, seem to attempt to repair damaged files systems but, the file system is not "damaged" when someone deletes a file.
    I have found this StackExchange article related to general file system "undelete" -- whether or not a Btrfs file system will behave properly with these methods is AFAIK unknown: <https://unix.stackexchange.com/quest...-deleted-files>.

    I have absolutely no knowledge as to whether "Test Disk" supports Btrfs file systems: <https://itsfoss.com/recover-deleted-files-linux/>.

    Quote Originally Posted by System_Error_Message View Post
    How do i set up snapper to work with files sort of like dropbox and microsoft does with file versioning?
    The simple answer is: the openSUSE Reference Guide: <https://doc.opensuse.org/documentati...a.snapper.html>.
    Quote Originally Posted by System_Error_Message View Post
    I've recovered deleted files before but only on windows based filesystems.
    Yes, the Redmond world has some "block-level-on-the-disk" tools but, they weren't the first to have this technology.
    • Many years ago, there was a company in Augsburg, southern Germany, who offered a service to recover "deleted" files from disks -- hard and floppy . . .
    • As far as I can remember, they began with disks written by DEC operating systems (the plural is correct!!) . . .

  5. #5
    Join Date
    Feb 2016
    Location
    Berlin
    Posts
    357

    Default Re: Recover deleted folder on btrfs

    no need to call me arrogant for misreading a confusing post. After originally focusing on:
    "The entire / and all folders use btrfs but i noticed that the snapshots only record settings rather than file. How do i recover that deleted folder?"

    Have just reread you, actually say:
    snapshots where not setup, but you then say there are snapshots but they contain settings not files? (i dont understand this)
    you then you go on to ask how to use snapper like dropbox.

    so your asking about 3rd party file recovery? (case 1)
    and how to setup snapper for use like dropbox? (case 2) [if you want file reversion, thats easy but i have never used dropbox and you dont say what aspect of dropbox youd like to reproduce]

    your second message is even more opaque.
    - what btrfs commands/tutorials? (are you just venting here?).
    - i assumed snapper is setup by default if the root FS is large enough (unless things have changed).

  6. #6
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,317

    Default Re: Recover deleted folder on btrfs

    On Mon, 05 Feb 2018 09:36:01 +0000, System Error Message wrote:

    > ndc33;2853463 Wrote:
    >> the snapshots contain the contents not settings (COW). as a start you
    >> can go to yast->snapper to browse and restore file changes from their.
    >> you should generally either not keep home on btrfs (or turn off cow).

    > This is the sort of arrogant behaviour that made me ditch ubuntu.
    > OPENSUSE DOES NOT BY DEFAULT SET UP SNAPPER TO VERSION YOUR FILES. I
    > would not be asking here if it did.
    >
    > Even the btrfs tutorials on file recovery done work on opensuse because
    > the commands arent there or are different that i cant identify the
    > blocks i need in order to run the right commands that work.


    Chill out - there's no need to go on the attack against someone who is
    attempting to help you.

    Nobody here knows anything about your situation, knowledge/experience, or
    setup that you haven't told us - we're not mind readers, we're a
    community who tries our best to help people who have issues.

    Jim
    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  7. #7
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Recover deleted folder on btrfs

    @OP,

    Here are a couple links to do what you want

    http://www.kossboss.com/?p=2017
    https://btrfs.wiki.kernel.org/index.php/Restore

    I haven't read this stuff for several months, IIRC
    - Historically, there have been a couple BTRFS undelete utilities, the most recent one should already be installed and available for you.
    - Should work great.
    - IIRC last time I read the BTRFS MAN pages, there wasn't a lot written about this feature

    I don't think we've discussed this BTRFS feature much if any in thse openSUSE forums before, but it's an important thing to know about.
    You don't use snapper, and it's a feature built into BTRFS even if snapshots isn't enabled.

    If you run into issues recovering,
    Post again and I or someone else can look more deeply into this.

    Good Luck,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

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