You are not logged in.

#1 2019-11-13 01:24:11

beardoof
Member
Registered: 2019-11-13
Posts: 14

[SOLVED] Can I recover a video file that was overwritten by tar?

Basically, I had 3 mkv files. I wanted to make a copy of them using tar and then xzipping it up, but I used the wrong tar syntax. I should've used:

tar -cf backup.tar vid1.mkv vid2.mkv vid3.mkv

But, instead, I used:

tar -cf vid1.mkv vid2.mkv vid3.mkv backup.tar

Which showed me an error saying backup.tar doesn't exist, but archieved vids 2 and 3 inside vid1. I've tested with

file vid1.mkv

and it says it's a POSIX tar archieve (GNU).

So, appearently, it's overwritten now. Is there any way to recover the original file?

Software versions:
Linux 5.3.10-arch1-1 #1 SMP PREEMPT Sun, 10 Nov 2019 11:29:38 +0000 x86_64 GNU/Linux
tar (GNU tar) 1.32

And also the software I used to record the videos:
ffmpeg version n4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
OBS Studio - 24.0.3-1 (linux)

So, can I recover it somehow?

Last edited by beardoof (2019-11-15 00:35:01)

Offline

#2 2019-11-13 02:43:21

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: [SOLVED] Can I recover a video file that was overwritten by tar?

Probably not.   What is the file system?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2019-11-13 02:45:19

beardoof
Member
Registered: 2019-11-13
Posts: 14

Re: [SOLVED] Can I recover a video file that was overwritten by tar?

ewaller wrote:

Probably not.   What is the file system?

ext4

Offline

#4 2019-11-13 07:51:04

seth
Member
Registered: 2012-09-03
Posts: 51,033

Re: [SOLVED] Can I recover a video file that was overwritten by tar?

Stop using the filesystem (use a live distro like eg. grml) and read
https://wiki.archlinux.org/index.php/File_recovery
https://wiki.archlinux.org/index.php/Fi … #Ext4Magic
and pray.

There's no direct way to "undo" your action - how that inode got relinked really doesn't matter. But if there's enough™ free space on the drive, the inodes of the video might not have been overridden - yet.

Online

#5 2019-11-14 03:13:31

beardoof
Member
Registered: 2019-11-13
Posts: 14

Re: [SOLVED] Can I recover a video file that was overwritten by tar?

seth wrote:

Stop using the filesystem (use a live distro like eg. grml) and read
https://wiki.archlinux.org/index.php/File_recovery
https://wiki.archlinux.org/index.php/Fi … #Ext4Magic
and pray.

There's no direct way to "undo" your action - how that inode got relinked really doesn't matter. But if there's enough™ free space on the drive, the inodes of the video might not have been overridden - yet.

Thank you! This worked for many deleted files, but not for the one I needed. I used the file system for 2 days straight until I realised I had done this mistake, and even then I didn't know this could hurt the deleted file so I kept using it. I really do appreciate the tips for next time I mess up, though. I've decided to just re-record the video since 40 mins recording is much less than a couple days trying to recover it. The hard part is getting through my camera phobia, but I've come to terms with it.

Admins, please feel free to close this topic. Thanks for the help!

Offline

#6 2019-11-14 07:32:28

seth
Member
Registered: 2012-09-03
Posts: 51,033

Re: [SOLVED] Can I recover a video file that was overwritten by tar?

You can either mark threads  resolved by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Or you can report it for deletion.

Online

Board footer

Powered by FluxBB