Hi, I've just tried to format/erase a SD card, via a USB reader/writer.
Unfortunately, I had not inserted it correctly, so it was not in use. As it has always been the last item in the output from fdisk -l, I used the last entry, but it was no longer the one that I should have formatted.
So, I now have a 8Tb drive, with a 2Tb fat32 partition, and the rest of the drive is marked as 'unallocated'. Before I had this disaster, it was an 8Tb drive, with 1 ext4 partition, full of videos, documents photos and the like.
I don't know if I need to recover the partition first before I can try and recover the files, or do I just try the file recovery??
Equally well, is this the correct forum??
Can someone please hold my hand and lead me through the process??
Thanks loads
Martin
Formatting the wrong disk to fat32
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
- cgrenier
- Site Admin
- Posts: 5432
- Joined: 18 Feb 2012, 15:08
- Location: Le Perreux Sur Marne, France
- Contact:
Re: Formatting the wrong disk to fat32
Your first step should be to recover your Linux partition.
Select your HDD, EFI GPT, Analyze, Quick Search, Stop, Deeper Search, once your ext4 partition is found, you can choose Stop.
Set the Linux partition to P(rimary), on next screen, choose Write, confirm, Quit, restart your computer.
If fsck failed to repair your filesystem, use TestDisk, Advanced, Superblock and use the parameter given by testdisk to use fsck.
Select your HDD, EFI GPT, Analyze, Quick Search, Stop, Deeper Search, once your ext4 partition is found, you can choose Stop.
Set the Linux partition to P(rimary), on next screen, choose Write, confirm, Quit, restart your computer.
If fsck failed to repair your filesystem, use TestDisk, Advanced, Superblock and use the parameter given by testdisk to use fsck.
-
- Posts: 4
- Joined: 02 Nov 2019, 19:57
Re: Formatting the wrong disk to fat32
Hi, thanks for the information.
Being the idiot that I am, of course, the disk is not backed up.
I propose to make a copy of the disk, before I start.
Can you please advise on the linux command to create an image of the drive, if you think that will be best??
dd if=/dev/input/DEVICE-HERE of=/dev/OUTPUT/DEVICE-HERE bs=<something quite large, (10M??)> conv=noerror,sync seems to be the most popular option.
Thanks
Martin
Being the idiot that I am, of course, the disk is not backed up.
I propose to make a copy of the disk, before I start.
Can you please advise on the linux command to create an image of the drive, if you think that will be best??
dd if=/dev/input/DEVICE-HERE of=/dev/OUTPUT/DEVICE-HERE bs=<something quite large, (10M??)> conv=noerror,sync seems to be the most popular option.
Thanks
Martin
-
- Posts: 2729
- Joined: 04 Jan 2019, 09:48
- Location: Hannover, Deutschland (Germany, Allemagne)
Re: Formatting the wrong disk to fat32
Use ddrescue instead of dd because it's designed to handle possible read errors.
-
- Posts: 4
- Joined: 02 Nov 2019, 19:57
Re: Formatting the wrong disk to fat32
Thanks very much, does it use the same command structure as dd??
I've just found dd rescue gui, it look much easier.....
A slight delay, as I ordered the wrong disk as a back up!!!!
I've just found dd rescue gui, it look much easier.....
A slight delay, as I ordered the wrong disk as a back up!!!!
-
- Posts: 2729
- Joined: 04 Jan 2019, 09:48
- Location: Hannover, Deutschland (Germany, Allemagne)
Re: Formatting the wrong disk to fat32
I don't know. I either find my cheet sheet with a typical command inside or I reread the manual.windcheetah wrote: ↑12 Nov 2019, 20:52 Thanks very much, does it use the same command structure as dd??
I do not see any use for dd anymore.
-
- Posts: 4
- Joined: 02 Nov 2019, 19:57
Re: Formatting the wrong disk to fat32
This is what I did, not having seen this web site, but I couldn't remove the drive, unless I get the screw driver out and unplug the cables!!!
Attached is the log file for when I tried to locate the superblocks http://www.windcheetah.org.uk/DataRecov ... rblock.txt
This didn't work too well as the result suggested that I use "To repair the filesystem using alternate superblock, run fsck.ext4 -p -b superblock -B blocksize device"
So I ran which then created this output: http://www.windcheetah.org.uk/DataRecov ... Output.txt
This then produced superblocks at and oddly, the same superblocks were found when I ran
Which is correct /dev/sdb - the device, the disk, /dev/sdb1 - the partition???
Any thoughts would be most useful.
Please note that all this is being done on the copy of the disk that I mangled, so if it does not work, not to worry!!!!!
It would appear that the superblocks have been lost/corrupted.Remove from your computer or laptop any external storage device other than the SD card which will be formatted (USB sticks, external HDDs, etc.)
to avoid the risk of formatting the wrong device (and permanently losing files).
Attached is the log file for when I tried to locate the superblocks http://www.windcheetah.org.uk/DataRecov ... rblock.txt
This didn't work too well as the result suggested that I use "To repair the filesystem using alternate superblock, run fsck.ext4 -p -b superblock -B blocksize device"
So I ran
Code: Select all
sudo fsck.ext4 -p -b 2654208 -B 4096 /dev/sdb
This then produced superblocks at
This was created fromSuperblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544, 1934917632
Code: Select all
sudo mke2fs -n /dev/sdb
Code: Select all
sudo mke2fs -n /dev/sdb1
Any thoughts would be most useful.
Please note that all this is being done on the copy of the disk that I mangled, so if it does not work, not to worry!!!!!
-
- Posts: 2729
- Joined: 04 Jan 2019, 09:48
- Location: Hannover, Deutschland (Germany, Allemagne)
Re: Formatting the wrong disk to fat32
You normally create file systems on partitions.Which is correct /dev/sdb - the device, the disk, /dev/sdb1 - the partition???
I use linux only for recovery purposes - I am not familiar with ext4.
The first google search for "man mkefs" gives me:
https://linux.die.net/man/8/mkfs.ext4
stating "mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition."