You are not logged in.

#1 2021-10-26 22:34:07

anthanor2
Member
Registered: 2021-09-24
Posts: 18

[SOLVED] dd Overwrite

Hi! I was trying to backup my hard drive and I screwed up and wrote

dd if=/dev/sda of=/mnt/usbmnt/backup bs=1024

. My external hard drive (/dev/sdb2) is a 10 TB drive and as soon as I realized my mistake I killed it after about 3GB were written. However when I mounted the drive and ls'd it, all my original data was missing.  I've been reading online that it is possible to recover files that weren't overwritten. How can I fix this? Thanks in advance!

Last edited by anthanor2 (2021-11-01 23:39:47)

Offline

#2 2021-10-26 22:45:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: [SOLVED] dd Overwrite

Please adjust your title and drop the caps and urgency.

If that is the command you ran then I don't assume anything happened? Or was /backup an important existing file/directory? The reverse would be a problem.

Offline

#3 2021-10-27 01:04:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,496
Website

Re: [SOLVED] dd Overwrite

And when you say "this is a 10 TB drive" what does "this" refer to, /dev/sda, or whatever is mounted under /mnt?  What is it you intended to do?  However, for the question as written, there is very little (read nothing) that can be done if important files really were over-written.  There's a reason 'dd' is called "disk destroyer".

Last edited by Trilby (2021-10-27 01:06:22)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2021-10-27 09:24:38

anthanor2
Member
Registered: 2021-09-24
Posts: 18

Re: [SOLVED] dd Overwrite

My apologies to both of you. I was in a rushed panic at the moment and I have fixed my original post. I was able to fix it by running

fsck -y /dev/sdb2

. My post was of poor etiquette and it wont happen again.

Offline

#5 2021-10-27 09:42:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: [SOLVED] dd Overwrite

Still doesn't really explain what ultimately happened. If /mnt/usbmnt was your mounted /dev/sdb2 then running that command will have just create a large "backup" image file you can just normally delete. If it isn't as problematic as you initially thought and the issue resolved, please mark it as such by editing the title and prepending [SOLVED] or so. https://wiki.archlinux.org/title/Genera … ow_to_post

Offline

Board footer

Powered by FluxBB