My disk was accidentally erased

My disk was accidentally erased using
mkfs.ext4 /dev/sdb1 command.

sudo mkfs.ext4 /dev/sdb1                                                             1 ✘ 

[sudo] password for a: 
mke2fs 1.47.0 (5-Feb-2023)
/dev/sdb1 contains a ntfs file system labelled 'New Volume'
Proceed anyway? (y,N) y
Creating filesystem with 115951872 4k blocks and 28991488 inodes
Filesystem UUID: 9523c36f-facd-49d9-9893-aaf51b49548d
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): 
Writing superblocks and filesystem accounting information: done 

Can I recover these files? :smiling_face_with_tear:

Hello @mman,

from my point of view I think there’s not many hope. Because you formated your ntfs-partition with ext-file system. But perhaps I’m wrong (what I hope for you).

At all I would recommend to install the package ‘testdisk’ from the repos. This package includes the applications ‘testdisk’ and ‘photorec’, which are good software to recover deleted files.

Good luck! :face_with_diagonal_mouth:

1 Like

I don’t give you much hope. ext4 set sectors to zero thus overwrite it on creation. Partially you could recover it, but must of it would be just junk. So a simple “undelete” will not work here.

1 Like

Noting that the drive is NTFS, your best hope would be to connect the disk to a Windows environment, and use native tools to recover files. That said, it’s unlikely the entire filesystem can be recovered; but at least there’s a fair chance of revovering the files you wanted to keep.

If you do not have a Windows installation, this could also be achieved via a VirtualBox Windows Installation; albeit likely to take much longer.

In a Windows environment Recuva is a capable free recovery tool. Cheers.

Update:- I missed the most important part of your question; that you have formatted as ext4 – therefore, please ignore the above content. I’m in agreement with Megavolt; recovery is unlikely.

However there are Linux Recovery Tools available for the purpose.

Good luck.

No, the drive isn’t NTFS at now, it’s ext4 already. So a ‘normal’ windows environment would not be able to read the disk. :face_with_diagonal_mouth: