LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-19-2013, 10:10 AM   #1
karthikeyan111192
LQ Newbie
 
Registered: Sep 2013
Posts: 2

Rep: Reputation: Disabled
dd if=/dev/zero of=/dev/sda count=1 && reboot -f


Hi frnds,
I have given the below command in my linux box
dd if=/dev/zero of=/dev/sda count=1 && reboot -f
do anyone know how to recover from this ??

Thanks in advance..
 
Old 09-19-2013, 10:19 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,461

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
http://www.linuxquestions.org/questi...h-noes-642006/
 
Old 09-19-2013, 10:21 AM   #3
NGIB
Member
 
Registered: Sep 2013
Location: Sumter SC, USA
Distribution: MX, Lubuntu
Posts: 449

Rep: Reputation: Disabled
I'm not an expert by any means but that command overwrites /dev/sda with /dev/zero so what was on /dev/sda could now be gone. The blacksize was not specified and I don't know what the default blocksize is...

Last edited by NGIB; 09-19-2013 at 10:23 AM.
 
Old 09-19-2013, 10:23 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,461

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
Quote:
Originally Posted by NGIB View Post
I'm not an expert by any means but that command overwrites /dev/sda with /dev/zero so what was on /dev/sda is now gone...
The use of "count=1" would indicate that only 1 block has been over-written, the MBR, rather than the whole disk.
 
Old 09-19-2013, 05:14 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Strictly speaking it over-wrote the MBR (i.e. the boot record) and the partition table. This would make it seem that the disk had been "deleted".

testdisk is the usual best answer to recover the partition table (and hence access to data), so that the bootloader can then be re-installed.
 
Old 09-19-2013, 05:32 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by karthikeyan111192 View Post
Hi frnds
Use whole words please.
 
Old 09-20-2013, 12:31 AM   #7
karthikeyan111192
LQ Newbie
 
Registered: Sep 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
I booted using live cd but unable to mount the disk..

it says disk no disk found...
 
Old 09-20-2013, 02:36 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
You never (normally) mount disks - you mount partitions/LVs/images that contain filesystems.
You need a liveCD that has testdisk installed - use testdisk on the (unmounted) disk to recover your partitions. Then you can mount them. There are hundreds of threads here on using testdisk. Then re-install your bootloader.
 
Old 09-20-2013, 02:36 AM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,622

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the data is GONE , and gone for good

now
you might be able to recover the date using a "scanning tunneling electron microscope "
for about $50,000 USD yes 50 GEES

reinstall the operating system

you "zeroed out " the drive , it is now a blank unformatted disk
it can not be mounted , there is NOTHING to mount

use the live cd " Gparted" and format the drive
 
Old 09-20-2013, 03:11 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by John VV View Post
the data is GONE , and gone for good
Rubbish. Stop making uninformed, inflammatory posts.

Read the entire thread.
 
Old 09-20-2013, 03:14 AM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
count=1
so only the first 512 bytes have been zeroed

testdisk should be able to recover this

I have an old drive somewhere, I can replicate this situation and 'test'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Terminal Emulation & /dev/pts and /dev/shm Issues on Kernel 3.4.3 unassailable Gentoo 8 10-27-2012 11:03 PM
[SOLVED] Issues with /dev/pts & /dev/shm, when LFS boots zer0signal Linux From Scratch 2 12-21-2010 07:14 AM
openSUSE Multimedia Optical Devices /dev/dvd & /dev/cdrom Configuration jdmcdaniel3 SUSE / openSUSE 2 10-31-2010 01:06 PM
dd if=/dev/zero of=/dev/sda bs=512 count=1...oh noes!!! CoffeeKing!!! Linux - General 14 05-14-2008 08:44 PM
/dev/sda & /dev/sdb keeps swapping name sinister1 Linux - Hardware 4 02-18-2008 01:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration