Page 1 of 1
Formatting the wrong disk to fat32
Posted: 02 Nov 2019, 20:27
by windcheetah
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
Re: Formatting the wrong disk to fat32
Posted: 03 Nov 2019, 17:49
by cgrenier
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.
Re: Formatting the wrong disk to fat32
Posted: 05 Nov 2019, 19:55
by windcheetah
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
Re: Formatting the wrong disk to fat32
Posted: 05 Nov 2019, 20:38
by recuperation
Use ddrescue instead of dd because it's designed to handle possible read errors.
Re: Formatting the wrong disk to fat32
Posted: 12 Nov 2019, 20:52
by windcheetah
Re: Formatting the wrong disk to fat32
Posted: 13 Nov 2019, 12:22
by recuperation
windcheetah wrote: ↑12 Nov 2019, 20:52
Thanks very much, does it use the same command structure as dd??
I don't know. I either find my cheet sheet with a typical command inside or I reread the manual.
I do not see any use for dd anymore.
Re: Formatting the wrong disk to fat32
Posted: 03 Mar 2020, 20:57
by windcheetah
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!!!
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).
It would appear that the superblocks have been lost/corrupted.
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
which then created this output:
http://www.windcheetah.org.uk/DataRecov ... Output.txt
This then produced superblocks at
Superblock 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
This was created from
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!!!!!
Re: Formatting the wrong disk to fat32
Posted: 03 Mar 2020, 21:23
by recuperation
Which is correct /dev/sdb - the device, the disk, /dev/sdb1 - the partition???
You normally create file systems on partitions.
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."