Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Duplicating disks with the Unix dd command - help

  • 05-02-2008 06:45PM
    #1
    Registered Users, Registered Users 2 Posts: 256 ✭✭


    I bought an old IBM Risc6000 box running AIX recently to practice my poor unix skills.
    Before I wreak havoc on it I thought I would backup the boot disk onto an extra disk I added.
    After research I decided to use the dd command.
    dd if=/dev/hdisk0 of=/dev/hdisk2

    I have heard that this can take a long time to run but mine has been running for 24hrs+ now and still not finished.
    The disks are similar sizes: 9GB SCSI.

    Does anyone have experience to relate of using dd in unix/Linux/AIX??
    Thanks in advance..


Comments

  • Registered Users, Registered Users 2 Posts: 354 ✭✭AndrewMc


    That should be all you need, and 9GB isn't much, but you do say it's a slow box. You might consider the "bs", or blocksize option. dd reads a block from "if" and then writes it to "of" before going back to "if" again, but when the blocks are small (and by default it's only 512 bytes, I think) all this switching from one to the other is not very efficient. If you add an option like bs=32768 it'll read 32kB at a time, which is more efficient for the drives and the OS.

    If you hunt, you'll find some documents on the performance of dd, and increasing the blocksize gave a significant boost, but going beyond 32k or 64k wasn't of much benefit (or may have been worse).


  • Registered Users, Registered Users 2 Posts: 256 ✭✭patto_chan


    Thanks for the suggestion.
    But my dd command actually completed a little while ago - almost 2 days after I started it!
    It didn't give any errors - just said 17,7xx,xxx records copied.
    How can there be 17 million records if it's only a 9GB disk? (remember I'm a Unix noob.)

    Tomorrow I will swap out hdisk0 and replace it with its new clone, hdisk2 (setting the SCSI ID to 0) and see if the machine boots from the clone.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    patto_chan wrote: »
    How can there be 17 million records if it's only a 9GB disk? (remember I'm a Unix noob.)

    It's not unix specific really. 17,000,000 x (512 bytes) = roughly 9GB.

    I've used dd for exactly what you're doing. Should work perfectly tbh.


Advertisement