1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restoring deleted file from ZFS file system

Discussion in 'General' started by churchi, Jul 8, 2010.

  1. churchi

    churchi New Member

    Messages:
    58
    Thanks Received:
    2
    Hi All,

    This morning i have accidentally deleted some files in a certain directory on my ZFS storage system. I am wondering if there is a way to get these back? i didn't have an off line backup of these files, so i am wondering if i can use some file system restore tools?

    I am not sure if i had auto snapshots setup, however is there a way to check and if i didn't have snapshots setup can i recover the files from the zfs file system?

    Thanks.
     
  2. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,478
    Thanks Received:
    784
    Check the output of $ zfs list -t snapshot poolname/filesystem to see if there are any snapshots of the filesystem. If there are, you can copy the file from /path/to/filesystem/.zfs/snapshot/snapshotname/path/to/file/ (replace /path/to/filesystem and /path/to/file).

    If you do not have snapshots, the file is gone.
     
  3. churchi

    churchi New Member

    Messages:
    58
    Thanks Received:
    2
    Thanks Freddie,

    Here is the output:
    Code:
    [root@server-01]# zfs list -t snapshot
    no datasets available
    [root@server-01]#


    i guess i am out of luck as i had no snapshots setup on my system :(