URGENT PANIC! new ZFSdataset. overwrite folder of same name?

Status
Not open for further replies.

Andrew Steel

Cadet
Joined
Aug 5, 2012
Messages
6
Hi all. Hopefully someone can help with this rather desperate situation

I am setting up freenas for a friend.

He has a folder called [Images] on a single drive in the nas box (drive A) I did not check what was inside it..

I have created a RAIDZFS over another 3 disks so to make the data much safer (drive B).

SO...

I created a new zfs data set called [Images]..

I created the dataset in the wrong place!!!!!... (I forgot to click drive B) So a zfs data set called [Images] was created on drive A....(where the original folder [Images] was located

I am panicing that this (empty) dataset has replaced and over written whatever was in the original folder!!!!


Could this have happened?

If so can I recover whatever was in the folder?

I am too scared to call my friend and ask if anything was in the folder..

Please help set my mind at rest
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
His stuff is gone. I'm not sure you have any way to recover his data. This is why backups are so good. :)

If the drive was NTFS or FAT you might be able to use a data recovery program or data recovery service(read: lots of $$$$$$$$$$$) and get most of the data back.

This is why I just create the server and generally let my friends do the copying. If they screw it up they can only blame themselves. If you screw it up it can cost you alot of heartache and(if your friends aren't forgiving) your friendship.

I'm not sure of your entire configuration, but if his data is important than ZFS is definitely the way to go. Make sure you either explain to him(or show him this post!) that if his data is important ZFS really is the best way to store the data.

This should also be a good learning experience for both of you if he has no backups that backups of data are worth every penny when the sh*t hits the fan.

Sorry I can't provide a more positive outlook on the situation :(
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
I have a trick that may work. But please only try this if you've exhausted all other options. This assumes that the original file system was FAT or NTFS. Also, have your new NAS ready to accept the files should this work.

1. Plug the drive in to a Windows computer
2. Perform a ->quick format<- using the original file system type. I cannot stress enough, quick format.
3. Once the format is done, plug the drive in to a Linux computer (passing the drive to a VM should work as well)
4. Mount the drive in Linux
5. If luck is with you, you'll just see the files and can start copying them to the newly built NAS.

I've used this a number of times on co-workers who have tried to remove data from a drive. If it works, what will happen is you'll mount the drive in Linux, and you'll see just see the files like nothing ever happened. I have seen it work after the drive has been formatted to another file system. But I've never tried it after a drive has been formatted to ZFS.

Edit:
I'm editing to quote noobsauce in this post because I wholeheartedly agree, and cannot stress enough that this should only be tried on data that you care about ->after all other options have been exhausted<-.

I'm curious how this would work. The NTFS pointers will not link to the old file system. It must be something with how Linux mounts NTFS partitions or something. Before he tries a quick format he should try a data recovery program. Not writing data to the drive is important(and a quick format will write some data).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I'm curious how this would work. The NTFS pointers will not link to the old file system. It must be something with how Linux mounts NTFS partitions or something. Before he tries a quick format he should try a data recovery program. Not writing data to the drive is important(and a quick format will write some data). I'd also expect this would only work if the partition is the exact same size. If it were too small you'd get obvious errors such as trying to access sectors beyond the boundary of the partition.

I might have to try this just to see. ;) Never know when you'll wish you knew a trick like that.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Yeah. I got nothing then. You are probably in deep poo-poo.
 

Andrew Steel

Cadet
Joined
Aug 5, 2012
Messages
6
Thanks. ..
Some seriously horrible conversations going top be had today.


It does surprise me that freenas will just do this without even so much of a warning....
Could the system check if a folder exists before creating the data set. ..


May save a few noobs l Lee me causing disasters
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Well it does turn the screen red and warn you that all data on the selected drives will be lost. With the number of file systems available do you really want to wait while it checks every single drive for all of the file systems available? At some point the system has to trust the administrator. If the OS can't trust the administrator who can it trust?

Most people plug in drives that have been used before, so we'd all get alot of warnings. I have always unplugged all hard drives that have data when I'm going to do things like repartition or format drives. The time lost is time saved as I see it. Not to mention data saved.
 

Andrew Steel

Cadet
Joined
Aug 5, 2012
Messages
6
Ha . You're not a jerk.

I did not my get this warning....

I know the screen you mean. I usually get said red screen when I create a new volume but not when I do a data set

It got asked for the name and then clicked OK
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I've been in your boat. It really sucks to be you right now. But 2 years from now you and your friend will laugh at your stupid mistake. It really does suck, and hopefully he had backups.
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
Take it easy, do not REPEAT NOT write anything more to the drive.

Then get som of the data recovery tools that is avaliable that scans a disk for gif/tif or other filetypes.
This might recover most of the images, the problem is reduced to looking at them and rename
them to something meaningful.

I have used one in freebsd to recover data from a netgear "toaster" ( where vendor support were non-existing)

If needed i'll come back with the siftware i used. ( an example of what i'm talking about is at :
http://www.derescue.com/JPEG-JPG-recovery.html
 

Andrew Steel

Cadet
Joined
Aug 5, 2012
Messages
6
Right.. I have made the dreaded phone call. He was very understanding

AND...

He has BACKUP!!! Phewww!



Thanks for your advice everyone.


Note to self... never do anything on a freenas box without backing it up... even if that takes 48hrs to do a back up!

Thanks again everyone
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Hehe. Lesson learned the 1/2 painful way.
 
Status
Not open for further replies.
Top