Skip to content

Rage Against the Shell

Linux tips and other things…

  • Home
  • Contact
  • Privacy Policy

Clone disks

Posted on September 5, 2015 - May 31, 2016 by Mr. Reboot

To clone a entire disk you can use the dd command:

~ $ dd if=/dev/sda of=/dev/sdb bs=10240k conv=noerror,sync

Or dd_rescue, more reliable than dd:

~ $ dd_rescue -v /dev/sda /dev/sdb

Also you can use pv to watch the progress:

~ $ dd if=/dev/sda bs=10240k conv=noerror,sync | pv -c -b -r -t > /dev/sdb

About a partition table you can copy it from a disk to another:

~ $ sfdisk -d /dev/sda | sfdisk /dev/sdb

Or save to a file:

~ $ sfdisk -d /dev/sda > partition-table.output 

And restore then:

~ $ sfdisk /dev/sda < partition-table.output 
Posted in File systems

Post navigation

Extract info from a SSL cert
Generate SSH key

Search

Calendar

September 2015
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  
« Aug   Oct »

Categories

  • Apache
  • Cisco
  • Command line
  • Distros
  • Dovecot
  • File systems
  • Gadgets
  • GlusterFS
  • MySQL
  • Nginx
  • NTP
  • Opendkim
  • Pacemaker + Corosync
  • Postfix
  • Raspberrypi
  • SSH
  • SSL
  • Varnish

RSS RSS

  • Using qrencode January 16, 2022
  • Compile varnish module vmod_vsthrottle April 22, 2020
  • SSH vpn with sshuttle April 9, 2020
  • Disable swap in systemd December 16, 2019
  • Getting the parent process pid October 12, 2018
Proudly powered by WordPress | Theme: micro, developed by DevriX.