-->

2012-12-02

memo: ddの/dev/urandomとrsync,ssh

ddで/dev/urandom以外。
http://infobsession.net/wiki/index.php?Linux%2FOpenSSL%A4%C7%A5%C7%A5%A3%A5%B9%A5%AF%BE%C3%B5%EE

export erace_target_dev=/dev/erace_target_dev
badblocks -c 1024 -o /tmp/bb_out.txt -s -v -w $erace_target_dev
dd if=/dev/zero bs=1M | openssl enc -aes-256-ofb -k "`dd if=/dev/urandom count=2 2> /dev/null | hexdump `" | dd_rescue -w - $erace_target_dev
dd if=/dev/urandom count=1 of=$erace_target_dev
dd if=/dev/random count=16 bs=1 of=$erace_target_dev

rsyncが無いがsshがある場合のバックアップ。
http://www.linuxquestions.org/questions/linux-general-1/recursive-scp-w-o-following-links-658857/

cd /destination/directory
ssh user@remote.host "cd /original/directory; tar cf - ./" | tar xvf -

export erace_target_dev=/dev/sdb
dd if=/dev/zero bs=1M | openssl enc -aes-128-ofb -k "`dd if=/dev/urandom count=2 2> /dev/null | hexdump `" | dd_rescue -w - $erace_target_dev
dd if=/dev/urandom count=1 of=$erace_target_dev
dd if=/dev/random count=16 bs=1 of=$erace_target_dev

ssh root@192.168.0.230 "cd /mnt/gentoo; tar cf - ./" | tar xvf -

0 件のコメント: