Restoring deleted file from ZFS file system

VMS used a purge command to prune old versions. Great. Now I have been mugged strolling down memory lane... ;)
 
I remember there was a file system without a delete: the bullet server in amoeba. That one was aimed at WORM media for storage. Another research OS with interesting concepts.
Thank you for reminding me of that! I had completely forgotten about Amoeba, in spite of the fact that I had to present it in our departments "journal club" once. By the way, the principal father of Amoeba (Sape Mullender) has also written a really nice textbook about distributed systems, which I have upstairs on the bookshelf. Good reading material.

And the "purge" command on VMS is exactly a symptom of the problem that one gets in a file system that has too many snapshots: space management becomes a terrible chore. VMS dumped the problem on users, which means people had to run "purge" manually whenever the sys admin told them that we're about to run out of disk space. Later VMS versions added the ability to automatically delete older versions, and limit the number of versions per file to a fixed number. Today, the problem of taking automatic snapshots, and decimating or deleting them as a space management technique, tends to be integrated into HSM; that's a big and complex field in and of itself (not my specialty).

And by coincidence, by going through some older paperwork today I discovered that I actually hold two patents on how to implement snapshot in file systems.
 
  • Thanks
Reactions: Oko
I now feel I understand better why all Windows versions since 4 have that trash can like Macs. (Imho the advice to use 3.11 is wrong insofar)
(At least they offer shift-delete to bypass the annoying trashcan :D)

But I really think FreeBSD should make more clear that desktop usage is not officially supported, but instead volunteer work.
It's like concentrating on core businesses - drop things that gain little and focus on a few things to make good.

So people like me who are whining because things like suspend/resume fail (even though they were implemented because the foundation sponsored this) know it has no use to whine.

The suggestion to drop stuff more aggressively has its good sides. There were recently a few people that honestly expected bluetooth to work on FreeBSD.
Dropping this for example would be not bad.

Dropping KDE, Gnome, Xfce, Cinnamon etc too would be helpful probably, too.
Better 3000 well-running packages than boasting 30000 packages of which 27000 are crap...
 
Another thing I just saw in another thread... there are people using sudo.
Is there a particular reason why to use sudo, in the light that one can do sudo rm -rf / ?
(Even with sudo one needs to turn on ones' brain...)
 
I don't understand your question. One needs to be root to do many system administration tasks.

If one is logged in as a normal, non-privileged user, one has to use sudo to do that. That seems to be safer than the alternatives, which is is to outright su and become root, or even log in directly as root.
 
1.
And I insist it's a bad attitude trying to teach people, who were not asking any one to teach them!!!
Is it so difficult to understand? Reading this forum or Stack Exchange/Overflow I am always wondering where those people come from?

I feel for you, but this is nothing to do with either ZFS or FreeBSD or computers but the apes you called people.

For example, if you open a topic in which you ask whether you have the right to refuse to visit your apartment to your landlord on a certain date not suitable for you, and what the legal/financial consequences can be, and you state in your OP that letting they come in on the specific date is not an option, in the first 20 responses, about 15 people will either ask you what your mental problem is, or offer you ideas how to let the landlord come in (by giving keys to someone else), or explaining it to you how impossible it is that you could have any reason to refuse the visit.

Maybe one person of twenty will tell you a helpful hint.

Considering the average habitants of this planet, I find the FreeBSD forum helpful in cases. (The case when I asked how to encrypt a production server is not included.)

I believe the psychological reasons might be jealousy or self-justification or something similar. If they prove you were wrong or you have less values than you think, they feel better about their lives.

You are also right about how the 99.9% of deletions happen.

I don’t like snapshots. I do have backups. I usually have backups on multiple machines, but I just deleted a backup of something temporary but needed. I figured it out one minute later. That’s why I found this thread.

I have another backup but that’s not the last version. As you see, although I had multiple backups, I still lost data.

Yeah, it sucks.
 
I don't understand your question. One needs to be root to do many system administration tasks.

If one is logged in as a normal, non-privileged user, one has to use sudo to do that. That seems to be safer than the alternatives, which is is to outright su and become root, or even log in directly as root.

False security is worse than no security. When sudo is used in a script, you may end up running things as the root you don’t want to run as the root.

It was probably implemented due to people who would have a PTSD after logging in even once as a non-root user or running a web application with any other user than the root.

For me, it works well to have a red (ASCII) prompt for the root, and some blueish prompt for the normal user, no sudo, not running around as root unless it’s needed.
 
Very very very important thread !!!

Please, let me the possibility to reply .... I need to correctly plan it first.

Bye bye !!!
 
I too am unimpressed with the "Holier than thou" attitude of many people in this thread and on the internet in general, data recovery programs have existed for almost every filesystem, and many people don't explore that avenue until after disaster strikes, they google/ask in a forum for support. The saying "If you don't have anything good (productive) to say, don't say anything at all" comes to mind.... Regarding all this ZFS recovery I'd like to say I have had success recovery files using UFS Explorer to recover files from ZFS partitions. I highly recommend the software, you can tell it's well written and it worked great for me!
 
Which version of UFS Explorer did you use? And what type of ZFS volume were you recovering from? Sadly I find myself in need of some data recovery on ZFS volumes after accidentally deleting a VM that removed to VMDKs that were associated with other VMs...One of my ZFS volumes is a simple mirror (SSD 512gb x2) and the other is a RAIDZ1 (4x 8tb). UFS Explorer Raid Recovery v8.10 was able to read and see both deleted VMDKs, and upon inspection said there were 0 errors on either file, and both were recoverable. Unfortunately after purchasing a license, the VMDK on the simple mirror volume started to recover but then errored out 50% of the way thru for "insufficient system resources to complete the operation". The VMDK file on the RAIDZ1 volume won't even start recovering, and says "unable to read source file". I'm hoping this is something to do with the new v8.10 version they just released with a rewrite of their ZFS code. I hate to start all over again with another scan from scratch since it took nearly 3 days on the RAIDZ1 volume....

Any tips/tricks or other utility suggestions would be greatly appreciated. (please don't be another one of those, you should have had snapshots and proper backups people, I get it, I screwed up, I will set this up going forward, but I'm looking for help here and now with my current situation)...

I've also been reading a little about ZFS transaction rollback, is that a possible avenue too?
 
Transaction rollbacks are internal to the ZFS implementation. AFAIK, transactions are super short lived (across a handful of IOs), and are committed within a few dozen milliseconds, so there won't be any rollback opportunity once committed. For details, Kirk McKusick's book (Design and Implementation of FreeBSD) has lots of explanations; or go take his class on ZFS internals.

I have zero experience with "UFS explorer". No idea who these people are. Judging by their address, I suspect that they are the former ReiserFS implementation group, which became unemployed after Hans Reiser's unfortunate little legal accident (he murdered his wife, and got caught, oops, hate it when that happens). If you bought a license, you should contact them for technical support, since the tool is clearly not working correctly.

All recovery tools are voodoo. They usually barely work or don't work. With expert hand-holding (you get someone who knows ZFS internals to go through each step), the probability of succeeding will be much higher. Consider the cost of that: An expert who can do that will costs hundreds per hour (dollars, euros), and it will probably be many hours of work to do this. I've had to do this for file systems that I was a developer on a few times, and typically a large data recovery operation is several days of work (I remember a particular incident that took 3 days, working 18 hours per day, including a weekend ... but the customer was very big and important). Do you think the data is worth that much to you?

Instead of being obnoxious and giving you advice, I will tell you a joke. There are two kinds of computer users: those who religiously do backups (and use snapshots), and those who haven't lost data yet. And: Happy Holidays!
 
Guess I'm a third user from that joke; I don't religiously do backups and have lost data (backups or not, still lost it). Backups can die and can become corrupted. Backups don't matter if you haven't tested that you know how to get into that data; document that process because you don't want to fumble on old memory or lack of knowledge when it is time to put things back because you are probably distracted by bad things having already happened. I did a rm as root once on this very computer; the damage done was basically equivalent to ~/.* in part of the command from my normal user's directory so damage was not controllable form not being root. I got back what little I wanted successfully from grepping an offline post-delete copy of the drive and moved on with my life; don't remember if I had a relevant backup back then or care but it was fun to 'try' to get my data rather than important.
In this thread there were a few utilities mentioned: grep works if uncompressed+unencrypted+unfragmented+content is known. photorec can help automate an attempt if it can detect the desired content type in the same circumstances. There is at least one utility claiming undelete for zfs though it ran under Windows and when I head of it Windows doesn't use zfs itself; may be worth it to some people if it gets the data though. Didn't notice zdb being mentioned but it is supposed to be the tool to be able to walk a zfs dataset. Transaction rollback 'may' get somewhere with it depending on the changes the pool has undergone; thought it was 256 versions before the structure blocks reuse (can't recall proper names currently) at a given level (but doesn't guarantee your file's contents blocks weren't already reused). I tried to browse some of that data a little bit once but I think it was a large write on a drive without much space left so likely wouldn't mean much and yes multiple structure versions were getting used up on the one large file's write if I recall.
 
Back
Top