Monday, September 20, 2010

1

ලිනක්ස් Terminal Command වලින් Back up Disks - clone hard disk

  • Monday, September 20, 2010
  • Damith Marathunga
  • Share
  • මෙම කේතනය භාවිත කරල Hard Disk එකේ Data Back up කර ගැනීම හා Disk එකේ Copy එකක් ගැනීම කරන්න පුලුවන්. මට මෙය ලැබුනේ English Blog අඩවියක තිබිල.

    Clone a Hard disk before making changes to it is a great way to be sure you can go back to the previous state.

    I usually do that before a major Linux upgrade on my servers, if something brokes during the update I can easily go back.

    And the command is as easy as:

    dd if=/dev/hda of=/dev/hdb

    Where if is the input media and of is the output media, be sure to avoid mistakes, as you can ruin your hard disk.

    Backup to an image

    If you prefer you can also save to an image, instead of using a whole disk as the target.

    dd if=/dev/sda of=~/backup-disk-YY-MM-DD.img

    If you want to store it on a CD or DVD, just follow this way.

    First compress it

    gzip ~/backup-disk-YY-MM-DD.img

    Burn the image on the CD/DVD

    cdrecord -v speed=8 dev=0,0,0 name_of_iso_file.iso

    Restore backups

    To restore the images, just exchange the if and of targets.

    Example:

    dd if=~/backup-disk-YY-MM-DD.img of=/dev/sda

    Note:

    Be sure to, not mess with

    /dev/sda, /dev/hda, /dev/sda1.. etc... you can check the mounted points using the command df. It may have an output like this:

    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/hda3 74786624 57024748 13962908 81% /
    /dev/hda1 101086 36808 59059 39% /boot
    none 513256 0 513256 0% /dev/shm

    Or maybe like this:

    /dev/disk/by-uuid/fc8f5296-7bd8-463a-87af-87c6d2215ff9
    42034200 15579204 24319972 40% /

    1 Responses to “ලිනක්ස් Terminal Command වලින් Back up Disks - clone hard disk”

    Dilnuwan දිල්නුවන්ගේ බ්ලොග් ලොව said...
    October 6, 2010 at 11:51 PM

    ස්තුතියි මමත් හොය හොයා හිටපු එක්ක....!!


    Post a Comment

    ඔබට සිතෙන දේ සටහන් තබන්න...

    Receive Free Updates

    Subscribe