Kleine full-disk backup met dd

Eerst de USB-stick opvullen met een file vol nullen:

time dd if=/dev/zero of=/media/USB_2G/delete bs=1M
dd: schrijven van 'delete': Geen ruimte meer over op apparaat
1890+0 records in
1889+0 records uit
1981267968 bytes (2,0 GB) gekopieerd, 1121,06 s, 1,8 MB/s
 
real    18m41.067s
user    0m0.020s
sys     0m8.357s

Dan deze file weer wissen:

rm /media/USB_2G/delete

USB-stick unmounten:

umount /dev/sde1

Stick dumpen met dd en gzip:

time dd if=/dev/sde | gzip -c9 > USB_2G_ext2.gz
3941375+0 records in
3941375+0 records uit
2017984000 bytes (2,0 GB) gekopieerd, 198,682 s, 10,2 MB/s
 
real    3m18.687s
user    0m37.058s
sys     0m32.902s

De grootte van de backup valt echt héél goed mee! Wink Nose

ls -hl USB_2G_ext2.gz
-rw-r--r-- 1 amedee users 2,7M feb  7 15:40 USB_2G_ext2.gz

Achteraf de backup weer restoren:

time gunzip -c USB_2G_ext2.gz | dd of=/dev/sde
3941375+0 records in
3941375+0 records uit
2017984000 bytes (2,0 GB) gekopieerd, 461,316 s, 4,4 MB/s
 
real    7m41.322s
user    0m16.009s
sys     0m25.070s

Nieuwe reactie inzenden

  • Textual smileys will be replaced with graphical ones.
  • Toegelaten HTML-tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <strike>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo], [[foo]].
  • Adressen van webpagina's en e-mailadressen worden automatisch naar links omgezet.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.
  • You may quote other posts using [quote] tags.
  • Regels en paragrafen worden automatisch gesplitst.