Restoring deleted file from ZFS file system

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Restoring deleted file from ZFS file system

Postby churchi » 08 Jul 2010, 02:53

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.
churchi
Junior Member
 
Posts: 58
Joined: 09 Apr 2010, 14:14

Postby phoenix » 08 Jul 2010, 15:26

Check the output of [cmd=$]zfs list -t snapshot poolname/filesystem[/cmd] to see if there are any snapshots of the filesystem. If there are, you can copy the file from [file]/path/to/filesystem/.zfs/snapshot/snapshotname/path/to/file/[/file] (replace /path/to/filesystem and /path/to/file).

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

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
User avatar
phoenix
MFC'd
 
Posts: 3349
Joined: 17 Nov 2008, 05:43
Location: Kamloops, BC, Canada

Postby churchi » 08 Jul 2010, 23:52

Thanks Freddie,

Here is the output:
Code: Select all
[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 :(
churchi
Junior Member
 
Posts: 58
Joined: 09 Apr 2010, 14:14


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests