Backup Optware USB drive with dd

Discussion in 'Tomato Firmware' started by gawd0wns, Sep 3, 2012.

  1. gawd0wns

    gawd0wns Network Guru Member

    I want to make a backup image of my usb drive running optware, with partitions and all (MBR and boot sector) so I can restore the image quickly in case the drive fails. Is this the correct way to do it?

    Make the image:
    dd if=/dev/sdb of=/path/to/destination/image.dd conv=notrunc

    Restore the image with:
    dd if=/path/to/image.dd of=/dev/sdb conv=notrunc

    Is there anything else I will need to modify on my router/the cloned drive to have it recognize or boot off of cloned drive? I have the following in my INIT script, to have the drive auto mount based on the label, and not UUID, so I am guessing any cloned usb drive should work ok?:

    echo "LABEL=optware /opt ext2 defaults 1 1" >> /etc/fstab

  2. ryzhov_al

    ryzhov_al Addicted to LI Member

    Please note, that you are copying disk geometry too. This image will be usefull only on new HDD with exactly the same size. Why you want to backup MBR? Are you using this drive to boot PC? If no, then just backup files from /opt partition:
    $ cat /opt/usr/sbin/
    timestamp=`date +%Y%m%d.%H%M%S`
    opkg list_installed | awk "{print \$1}" > $backup_path/opt.$timestamp.installed.txt
    tar -cvzf $backup_path/opt.$timestamp.tgz /opt
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice