Backup MBR to Image File
Make a copy of MBR (Master Boot Record) to a file.
dd if=/dev/hda of=mbr.img bs=512 count=1
dd if=mbr.img of=/dev/hda bs=512 count=1 #restore the MBR
Make a copy of MBR (Master Boot Record) to a file.
dd if=/dev/hda of=mbr.img bs=512 count=1
dd if=mbr.img of=/dev/hda bs=512 count=1 #restore the MBR
Make a backup of a local hard disk on remote host via ssh
dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz'
Check bad blocks in disk hda1
badblocks -v /dev/hda1
Linux Command to search the Harddisk for bad sectors
sudo badblocks -v /dev/sda
<p class=”intro”>If you have many IDE harddisks connected to the system(but not mounted), this command will find it. This will work for sata HDD as well if you use ‘sd’ instead of ‘hd'</p>
<pre><code class=”cli”>
ls /dev/hd*
</code></pre>
<p>Simple, is it not? To find the mounted drives just use the command ‘dh’.</p>
[tags]hda,harddisk,ide,sata,linux,command,hdd,partition[/tags]