You are not logged in.

#1 2020-02-04 18:26:54

Dentrax
Member
Registered: 2018-08-05
Posts: 21

Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

Hello,

During the Arch installation, somehow my default Linux SSD partition (which is `/dev/sdc`) is changed to my internal 1T HDD's. I always check it with `fdisk -l` all the time before i do a any operation. But I forgot to check it out dev id in the setup process somehow. After I typed the format commands and press the Enter, it was too late. I had to watch formatting process. sad

What I did:
1. Forgot the check `fdisk -l`
2. Ran the format commands: `mkfs.fat -F32 /dev/sdc1` and `mkfs.ext4 /dev/sdc2` (Why the F that command did not warn me like `hey, this is your internal HDD and 95% full, would you like to continue the format process? ...)
3. Bad things happened
4. I did not run any recover tools on HDD.
5. In Disk Management, HDD shows as `unallocated`, i can't see HDD in the `Devices and drivers` section either.

So the question is: I want to recover as many files as I can. (projects, texts, images?, movies?) I know that I can't recovery all of them. What do you recommend me to do as the fastest and free method?

`lsblk` output: `sdb vfat 931.5G`

Thanks in advance...

Last edited by Dentrax (2020-02-04 18:39:18)

Offline

#2 2020-02-04 19:29:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,702

Re: Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

I am going to be 'That guy'.
What about your backups?


Edit:  Regardless, if you want any hope, I suggest you create an image of the disk before you do anything else.

Last edited by ewaller (2020-02-04 19:30:32)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2020-02-04 19:57:00

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

Would it not be better to ask on a Windows forum? The members there should know more about NTFS recovery, given that it is a Microsoft filesystem.

A quick interweb search suggests https://www.cgsecurity.org/wiki/Undelet … h_TestDisk but I'm not sure if that will work for an over-written filesystem.

Otherwise:

ewaller wrote:

What about your backups?

^ This.


Jin, Jîyan, Azadî

Offline

#4 2020-02-05 19:15:18

Wild Penguin
Member
Registered: 2015-03-19
Posts: 406

Re: Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

Not much to add; Indeed, ask some Windows forum for tools for NTFS repair.

Another lesson learned (besides importance of backups) is: the names in /dev/sd[a-z] (which, btw., correspond to HDDs, not partitions) are not consistent over reboots (that's the main reason we refer to FSes by UUIDs in fstab and other places!). *Always* check them!

IIRC creating an ext4 fs will write stuff here and there throughout the disk. I'm not that much into filesystems but I think with all likelihood at least some of your data has been overwritten. You might be able to salvage smaller files, but larger files will probably have errors in them (though I'm not certain on this).

Definitely take an image of the partitions you had the file systems on (this is the first step in these kind of situations, since then you can always roll back even after trying to repair the FS in a potentially destructive manner). IIRC parted has a feature (rescue) to look for deleted partitions (actually the filesystems), so you might give that a shot after making the image; but it is unlikely to work in this situation. I've rescued a filesystem a few times, after I made a mistake while editing the partition table, though. (EDIT: and back in the beginning of 2000s, IIRC changed a primary partition into a secondary one, or did something else similar to that, which was not possible directly - i.e. deleted a partition on purpose and re-created it with the rescue command)

Last edited by Wild Penguin (2020-02-05 19:32:44)

Offline

#5 2020-02-05 19:26:49

Wild Penguin
Member
Registered: 2015-03-19
Posts: 406

Re: Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

Did a quick Google search (just in case I or someone close to me is in a similar position - I'm also a bit lazy on backing up *everything* I might need); and I came up with R-Studio. It will cost you 80$, but in case your data is at least that valuable, you might want to give it a shot. I've no idea if free tools exist which can do even remotely the same thing (I've no experience with either R-studio or testdisk) - not to mention the time and effort you are going to need to learn the (possibly existing) tools. 80$ might be a reasonable price, after all (there seems to be a free evaluation version, which is limited to very small files, though)...

EDIT: Were I in OPs shoes, I'd do the following (in this order):

  1. Make image of the partition

  2. Delete partition and see if parted can re-create the partition as ntfs

  3. Alternatively (or if parted does not work or if outcome is garbage), see if testdisk can recover files

  4. Try out free version of R-Studio. If it works, consider if the data is worth 80$ and if yes, pay for it.

Last edited by Wild Penguin (2020-02-05 19:39:17)

Offline

#6 2020-02-05 22:30:41

xerxes_
Member
Registered: 2018-04-29
Posts: 1,073

Re: Accidentally reformatted my HDD from NTFS to Ext4 [How to recover?]

Something about data recovery and comparison of some programs:
https://www.ufsexplorer.com/articles/os … cifics.php
http://data-recovery-software.review/data-recovery.aspx

Last edited by xerxes_ (2020-02-05 22:33:33)

Offline

Board footer

Powered by FluxBB