I stupidly used
dd if=/dev/zero of=/dev/sdb bs=512 intending to do /dev/sdc.
I have a 1 terabyte USB drive on /dev/sdb. It is/was formated exfat.
The two partitions are showing in /proc/partitions as:
8 17 131072 sdb1 8 18 976629760 sdb2
I haven't rebooted or removed the drive.
Can I somehow re-invent the boot sector's 512 bytes?
What tools/methods might I use to do it? As it's exfat it presents weird linux issues.
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) /dev/sdb2 on /media/keith/tera type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Am I toast? Can testdisk or gparted help? Gee it's just a measly 512 bytes right?
I just realized there was no count=1 so it kept writing till I hit Ctrl-C. Which for me was immediate but for a processor...well...OUCH!
I also just found this in a terminal history:
Disk /dev/sdb: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: F3A19FB9-E01F-40BC-ADFE-4F97133EA6CF Device Start End Sectors Size Type /dev/sdb1 34 262177 262144 128M Microsoft reserved /dev/sdb2 264192 1953523711 1953259520 931.4G Microsoft basic data
Can I use this through testdisk to recontstruct the partions? Testdisk has come up with the following:
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63 Partition Start End Size in sectors >D MS Data 63 1953520127 1953520065 D MS Data 1387348323 1387351202 2880 [SPINRITE V6] D MS Data 1387643135 1387646014 2880 [SPINRITE V6] Structure: Ok. Use Up/Down Arrow keys to select partition. Use Left/Right Arrow keys to CHANGE partition characteristics: P=Primary D=Deleted Keys A: add partition, L: load backup, T: change type, P: list files, Enter: to continue NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
But can Linux recreate the correct partition types? I seem to remember originally formatting this drive on a Windows box.