Used "DD" Command - Wrong HDD!

4 replies [Last post]
Richie
Offline
Joined: 05/10/2017

I'm in a bit of a pickle, and it's entirely of my own making. What I'm experiencing is not a terribly serious problem, but it is annoying and I want to fix it.

I was copying an .iso onto a bootable USB drive using the "DD" command... or so I intended. In actuality, I accidentially copied it to my internal hard drive. Thus, I now have an extra volume available to mount that I cannot get rid of to save my life. The volume is named the same name as the file I was "DDing," which was a version of Debian Testing. Here's what I've done to try and fix this so far:

1. I have tried, numerous times and through numerous means, deleting every partition and formatting the drive. At the moment, fdisk (which I will post the output of below) is saying I have no partitions - and yet, I can still access the volume and even mount it and browse files on it. I'm currently in a fresh reboot of a Trisquel live-USB.

2. I have tried clearing the MBR, with the following command:

dd if=/dev/zero of=/dev/sda bs=512 count=1

The following is the output of fdisk -l.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

Disk /dev/sdb: 2048 MB, 2048729600 bytes
255 heads, 63 sectors/track, 249 cylinders, total 4001425 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
Disk identifier: 0x06fdad3d

Device Boot Start End Blocks Id System
/dev/sdb1 * 128 4001407 2000640 c W95 FAT32 (LBA)

jules_verne
Offline
Joined: 01/02/2017

Wouldn't be better for you to use gparted or Gnome disk utility? But if you really want to use dd, at least try to format the disk with gparted, and try again.

libreleah
Offline
Joined: 04/03/2017

i once lost 3TiB of data for the same reason. I did'd 2 drives in my RAID 5 volume, consisting of 3 drives. no backups

look into setting up rsync cronjob for regular backups, onto another system.

ADFENO
Offline
Joined: 12/31/2012

As an example, I have an Rsync cron job that, once per month, asks to
backup some predefined locations and turn the result into a .tar.gz
file. It currently does only whole backups (because I don't want to care
for dead or moved files once I restore some backup) but it does what I
want for now. :)

--
- [[https://libreplanet.org/wiki/User:Adfeno]]
- Palestrante e consultor sobre /software/ livre (não confundir com
gratis).
- "WhatsApp"? Ele não é livre, por isso não uso. Iguais a ele prefiro
GNU Ring, ou Tox. Quer outras formas de contato? Adicione o vCard
que está no endereço acima aos teus contatos.
- Pretende me enviar arquivos .doc, .ppt, .cdr, ou .mp3? OK, eu
aceito, mas não repasso. Entrego apenas em formatos favoráveis ao
/software/ livre. Favor entrar em contato em caso de dúvida.

davidnotcoulthard (not verified)
davidnotcoulthard

Testdisk can always help on a rainy day though. http://www.cgsecurity.org/wiki/TestDisk