Linux/Backup: Difference between revisions
< Linux
No edit summary |
(→DD) |
||
Line 27: | Line 27: | ||
fdisk -lu | fdisk -lu | ||
dd if=/dev/sda of=mbr.img bs=512? count=1? 63? | dd if=/dev/sda of=mbr.img bs=512? count=1? 63? | ||
</pre> | |||
</blockquote> | |||
=== Backup over network === | |||
* Target | |||
<blockquote> | |||
<pre> | |||
netcat -l 5555 | dd of=image.dd.gz | |||
</pre> | |||
</blockquote> | |||
* Source | |||
<blockquote> | |||
<pre> | |||
dd if=/dev/sda | pv| pigz | netcat $TargetIP 5555 | |||
</pre> | </pre> | ||
</blockquote> | </blockquote> |
Revision as of 15:06, 29 November 2012
DD
Backup
- simple backup to image file
dd if=/dev/sda | gzip > image.dd.gz
- gzip image without dd
gzip -c < /dev/hda1 > /tmp/partition_image.gz
- bootloader
dd if=/dev/sda of=bootloader.img bs=446 count=1
- MBR + partitiontable
fdisk -lu dd if=/dev/sda of=mbr.img bs=512? count=1? 63?
Backup over network
- Target
netcat -l 5555 | dd of=image.dd.gz
- Source
dd if=/dev/sda | pv| pigz | netcat $TargetIP 5555
Status
- dd status
while /bin/true; do sleep 5; kill -USR1 `pidof dd`; done oder watch -n N kill -USR1 `pidof dd`
Loop
- mount image as loop
mkdir /mnt/loop mount -o loop image.dd /mnt/loop umount /mnt/loop
other
- dd random
dd if=/dev/random bs=1M count=256 | gzip >./256-MB-random-data.bin
Links
- http://www.merval.org/2012/03/bash-scripts/
- https://help.ubuntu.com/8.04/serverguide/backups-shellscripts-rotation.html
- http://tobias.schroepf.de/doku/doku.php?id=linux:backup
- http://ubuntuforums.org/archive/index.php/t-1675093.html
- http://hardforum.com/archive/index.php/t-1711020.html
- http://forums.veeam.com/viewtopic.php?p=51838
- http://www.mattcutts.com/blog/backup-gmail-in-linux-with-getmail/ (Backup pop/imap account)