Clone IDE Hard Disk

sudo dd if=/dev/hda1 of=/dev/hdb2
This command clone the first partition of the primary master IDE drive to the second partition of the primary slave IDE drive (!!! back up all data before trying anything like this !!!)

5
By: 0disse0
2009-09-05 09:16:52

These Might Interest You

  • Change /dev/sda with the Disk or partition you want to back-up To restore use: dd if=~/backup-disk-YY-MM-DD.img of=/dev/sda Once again change /dev/sda accordingly Source: http://www.go2linux.org/linux/2010/09/small-tip-back-disks-clone-hard-disk-773


    -4
    dd if=/dev/sda of=~/backup-disk-YY-MM-DD.img
    unixmonkey12135 · 2010-09-14 11:14:14 0
  • Get the hard disk information with out shutting down and opening the system. It gives information on model no., serial no., cylinders/heads/sectors, and the supported features of the hard disk. Show Sample Output


    9
    hdparm -i[I] /dev/sda
    rockon · 2009-03-01 10:00:28 0
  • The command is useful when, e.g., booting an existing system with a rescue or installation CD where you need to chroot into the hard-disk and be able to do stuff which accesses kernel info (e.g. when installing Ubuntu desktop with LVM2 you need to mount and chroot the hard disk from a shell window in order to install packages and run initramfs inside chroot). The command assumes that /mnt/xxx is where the chroot'ed environment's root file system on the hard disk is mounted.


    3
    for i in sys dev proc; do sudo mount --bind /$i /mnt/xxx/$i; done
    amosshapira · 2009-04-20 16:52:14 1
  • This is to pull all the saved S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) information from a hard drive. This can give you an idea of the nature and extent of an issue on a failing hard drive. Show Sample Output


    1
    smartctl --attributes /dev/sda
    ShadowCat8 · 2011-10-13 20:21:03 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: