Results 1 to 4 of 4

Thread: How to copy an entire drive more efficiently than using dd

  1. #1
    Member registered user
    Join Date
    Dec 2006
    Posts
    50

    How to copy an entire drive more efficiently than using dd

    I have a 250G drive dual-booting Windows and Linux and beautifully partitioned to allow swap partitions, FAT32 drives for two versions of Cygwin, and others (from /dev/sda1 to /dev/sda10). The architecture has been polished and refined over time and I would hate to have to reproduce it after a fault or loss.

    The back up procedure is not to back up new/ changed files drive by drive, or even to copy drive to drive, but to copy an image of the entire device /dev/sda to a remote drive, using dd. Of course, the entire 250059350016 byte device is copied to a 250059350016 copy, this way.

    It's worth it to do it this way and not to get into the vocabulary of chasing new/ changed files, mimicking the same gymnastics from drive to drive, etc. AND the boot partition is also backed up should there be a requirement to use it. The down side is that it takes 2h20m to achieve and if I wanted to look for just one file within the backup, this is of course impossible, the back up just consisting as it does of a single 250G binary file (with lots of zeroes).

    Needless to say, all the initial partitioning and subsequent routine backup is achieved with Knoppix.

    Question 1. Is there something like partimage (but not actually partimage) that will back up _an_entire_device_ /dev/sda rather than individual partitions /dev/sda[1-10] but that would work faster and more efficiently using some kind of internal zipping protocol (as I assume partimage does, reducing say a 16G partition to a 5G image). Possibly reduce the 250G image to dunno? 80G or something and all in an hour or less.

    Question 2. Could dd_rescue be implemented at all usefully? (I have no bad sectors, but maybe dd_rescue skates efficiently over swathes of 00s or something, I dunno?)

    Fergus

  2. #2
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    512
    Do you use a USB hdd? Then I don't think that it is only an issue with the program dd because you have a transfer speed of 28 MB/s. I think this is a good value if it is a USB hdd. If you want to reach higher speeds then you must use an eSATA hdd.

    Quote Originally Posted by fergus
    if I wanted to look for just one file within the backup, this is of course impossible, the back up just consisting as it does of a single 250G binary file
    There exists a program called kpartx in the debian repository (part of the linux multipath-tools) which helps to use disk images created by dd as loop back devices. Maybe this program can be installed and used inside Knoppix.

  3. #3
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    1,516
    actually you can mount that image just like it was a hdd with addition of -o loop at end and using image as a hdd.
    like this,
    first "I" created an image with random caracters and formated it EXT3 so I could show you how, ignore this part.
    dd if=/dev/urandom of=/home/knoppix/a.img bs=1M count=1024
    sudo mkfs.ext3 /home//knoppix/a.img
    i get a message that it is not a block unit and am asked if i want to continue, i answer Y.

    now to part that YOU want. I simply mount it with option -o loop.

    Code:
    sudo mount -t ext3 /home/knoppix/a.img /media/testing -o loop
    you have to use separate image for each partition but i think it is still fairly easy.
    do not forget to umount it before deleting or some such (to prevent common mistake, umount without n) when you are finished with it.
    Code:
    sudo umount  /media/testing
    also another thing, you can use "gzip -9" to compress the image as you go, this will "remove" most of the unwritten areas and some of the others from the final image size.
    first how to clone with gzip.
    Code:
    dd if=/dev/disk_to_be_cloned |gzip -9 >/mnt/disk_where_clone_is_saved/image.dd.gz
    now to restoring the image.
    gzip -cd image.dd.gz > /dev/cloned_disk

    was this helpful?
    I am now on knoppix5.1.1 (on the road and it was in my computer bag) but it should be same on most Linux versions with gzip, dd and kernel loop abilities.

    keep at it and keep asking.

  4. #4
    Senior Member registered user
    Join Date
    Jun 2005
    Posts
    348
    Do a search for "CloneZilla". It is a disk clone/imaging tool that seems to work well. There are other solutions, but I have used this one extensively with excellent results. It has networking capabilities and can backup to remote shares as well.

Similar Threads

  1. Using Live CD to copy entire C drive to a NAS box
    By chrislynch8 in forum Networking
    Replies: 2
    Last Post: 01-13-2010, 06:53 PM
  2. Replies: 15
    Last Post: 06-29-2007, 05:05 AM
  3. Copy files from NTFS drive to another drive
    By Kehart25 in forum MS Windows & New to Linux
    Replies: 2
    Last Post: 12-03-2006, 06:19 PM
  4. Copy file from hard drive to usb flash drive
    By PaulKraemer in forum General Support
    Replies: 1
    Last Post: 05-08-2006, 04:49 PM
  5. Any way to mount and chroot a entire hard drive?
    By sk545 in forum General Support
    Replies: 3
    Last Post: 02-24-2004, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Samsung SCXSTP000, SCX-STP000 (Swingline Staple Cartridge - 3 Refills) picture

Samsung SCXSTP000, SCX-STP000 (Swingline Staple Cartridge - 3 Refills)

$57.99



Samsung Galaxy S10 10.9

Samsung Galaxy S10 10.9" FE 128GB WiFi Tablet SM-X520NZACXAR S-Pen Keyboard 2025

$299.99



CR2032 CMOS Battery for Notebook Computers 2-pin 2 wire picture

CR2032 CMOS Battery for Notebook Computers 2-pin 2 wire

$3.55



USB C to Type C Cable Fast Charger For Samsung Galaxy S8 S9 S10 Plus Note 10 12 picture

USB C to Type C Cable Fast Charger For Samsung Galaxy S8 S9 S10 Plus Note 10 12

$5.00



Kids Case for Samsung Galaxy Tab A9+/A9 plus 11 Inch 2023 Case, with Strap, Shoc picture

Kids Case for Samsung Galaxy Tab A9+/A9 plus 11 Inch 2023 Case, with Strap, Shoc

$27.99



SAMSUNG CD-RW DRIVE MODEL SW-224 AMAZING CONDITION+ORIGINAL BOX    NEVER USED picture

SAMSUNG CD-RW DRIVE MODEL SW-224 AMAZING CONDITION+ORIGINAL BOX NEVER USED

$30.00



Samsung 850 Pro Series 2TB 2.5inch SATA3 6Gbp Internal SSD MZ-7KE2T0 5 Available picture

Samsung 850 Pro Series 2TB 2.5inch SATA3 6Gbp Internal SSD MZ-7KE2T0 5 Available

$189.00



Samsung DVI to DVI Cable 6 ft Digital Video Interface Audio Video NEW picture

Samsung DVI to DVI Cable 6 ft Digital Video Interface Audio Video NEW

$30.89



Samsung Galaxy Tab S9 S9+Plus S9 Ultra Black Touch Sceen Pen Stylus S Pen Pencil picture

Samsung Galaxy Tab S9 S9+Plus S9 Ultra Black Touch Sceen Pen Stylus S Pen Pencil

$15.99



Original for Samsung NP950QCG-K01US LCD Screen Touch Full Top Assembly FHD Blue picture

Original for Samsung NP950QCG-K01US LCD Screen Touch Full Top Assembly FHD Blue

$299.00