News for hackers. Stuff that matters.
Re:Undeleting a file overwritten with mv by marcan_42 on Sunday November 29, 2020 @02:36AM (#25243601)
Better answer: have backups. Fancy filesystems may save you if you use their features properly, but are also hell to do deep data recovery on when something does go wrong. And they are also buggier simply by being more complex.
Re:Undeleting a file overwritten with mv by bestboy on Sunday November 29, 2020 @04:42AM (#25244074)
Using ZFS is no replacement for backups.

Still, this would have been a non-issue on a ZFS system:

  /var/recordings $ ll .zfs/snapshot/
  total 72
  drwxr-x---+ 7 root  root  7 Apr  9  2019 0003/
  drwxr-x---+ 7 root  root  7 Apr  9  2019 auto-2020-11-26_00-00/
  drwxr-x---+ 7 root  root  7 Apr  9  2019 auto-2020-11-27_00-00/
  drwxr-x---+ 7 root  root  7 Apr  9  2019 auto-2020-11-28_00-00/
  drwxr-x---+ 7 root  root  7 Apr  9  2019 auto-2020-11-29_00-00/
  drwxr-x---+ 7 root  root  7 Apr  9  2019 manual-2020-10-05/

  /var/recordings $ cp .zfs/snapshot/auto-2020-11-28_00-00/recording-16679.flv recording-16679.flv

(every directory/dataset contains an invisible .zfs directory "mounting" the snapshots of the dataset)
Re:Undeleting a file overwritten with mv by fuzxi on Sunday November 29, 2020 @05:04AM (#25244141)
The file he overwrote was the backup, haha.

>Given that we already consider it to just be a backup, we currently don’t make any further backups of this data.

Re:Undeleting a file overwritten with mv by wizzwizz4 on Sunday November 29, 2020 @06:24AM (#25244494)
Never mount a backup writeable.
Re:Undeleting a file overwritten with mv by sgerenser on Sunday November 29, 2020 @08:43AM (#25245061)
How do you make the backups then?
Re:Undeleting a file overwritten with mv by wizzwizz4 on Sunday November 29, 2020 @09:43AM (#25245343)
Well, you can make the backup, but then set the read-only flag on the tarball and never touch it again.
Re:Undeleting a file overwritten with mv by mrighele on Sunday November 29, 2020 @03:23AM (#25243771)
You should always have backups, but for this specific issue I think that snapshots are much better since you can run them more often (I do a snapshot of my system every hour) and it is probably easier/faster to recover a file from a snapshot than a backup
Re:Undeleting a file overwritten with mv by lmm on Sunday November 29, 2020 @03:59AM (#25243915)
You might be right in the general case, but ZFS is extremely mature and reliable; frankly I trust it more than ext4 at this point.