Wednesday, October 11, 2017

Clone Harddisk Pada Linux

berikut cara clone hardisk pada linux menggunakan perintah "dd". Admin sendiri mencoba pada linux "Centos 6.9" dimana server linux yg admin gunakan, hdd nya terkena bad SMART.

1. dd, The Native Linux Cloning Tool

Perhaps the most powerful Linux tool of them all, dd (sometimes referred to as “disk destroyer”) can clone an entire HDD or disk partition to another. But if misused, it can delete the contents of your disk.

As such, you should use with extreme care. You’ll find dd built into most Linux operating systems. If not, install it from the package manager. To clone your computer’s hard disk, use the command:

dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

Here, sdX is the source disk, while sdY is the destination. The numerical value 64K, corresponds to the block size command, bs. The default value is 512 bytes, which is very small, so it’s best to include 64K or the larger 128K as a condition. However: while a larger block size makes transfer quicker, a smaller block size makes the transfer more reliable.

If you only want to clone a partition of your drive, use

dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync

As you can see, the partition sda1 (that is, partition 1 on device sda) will be cloned to sdb1 (a newly created partition 1 on device sdb), for instance a secondary, or external, HDD attached to your computer.

Tap Enter to run the command. How long it takes will depend on the size of the disk or partition. Just make sure that destination volume is large enough to store it!


tambahkan "status=progress oflag=dsync" di paling akhir perintah "dd" (Belum di coba) agar proses cloning terlihat sudah berapa persen

atau jika perintah dd sudah berjalan, ketikan "watch -n30 'kill -USR1 $(pgrep ^dd)'" pada terminal baru (bukan terminal putty, tapi terminal server langsung), dimana "-n30" adalah refresh time untuk mengirim perintah didalam kitp satu.

NB: Maaf karna masih menggunakan bahasa inggis, sengaja ga admin translate agar tidak miss comunucation.



Referensi:
http://www.makeuseof.com/tag/2-methods-to-clone-your-linux-hard-drive/
https://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd

No comments:

Post a Comment