Code Sample |
# create two 20M files to use as an ecrypted and unencrypted loop dd if=/dev/zero of=secret.img bs=20M count=1 dd if=/dev/zero of=unsecret.img bs=20M count=1 # change to root and setup the two loops for use sudo su losetup -e aes256 -S "damnsmalllinux" /dev/loop1 secret.img ## used password=onetwothreeonetwothree ## not really secure, but this is just for timing mke2fs -j /dev/loop1 mke2fs unsecret.img ## said y to prompt, it's OK mkdir /mnt/efs mkdir /mnt/uefs mount /dev/loop1 /mnt/efs mount unsecret.img /mnt/efs -o loop # create a test directory and script to copy, move and delete files mkdir test dd if=/dev/random of=test/1Mtest bs=1M count=1 mkdir test/temp # create the test.sh script below and make it executable vi test/test.sh chmod 777 test/test.sh cp -r /home/dsl/test /mnt/efs cp -r /home/dsl/test /mnt/uefs # run the tests cd test time ./test.sh cd /mnt/uefs/test time ./test.sh cd /mnt/efs/test time ./test.sh |
Code Sample |
#!/bin/bash #test.sh # # copies, moves, and deletes to check loop performance i=0 while [ $i -lt 6000 ] do i=`expr $i + 1` cp -f 1Mtest temp/1Mtest1 cp -f 1Mtest temp/1Mtest2 cp -f 1Mtest temp/1Mtest3 cp -f 1Mtest temp/1Mtest4 mv -f temp/1Mtest1 temp/1Mtest1a mv -f temp/1Mtest2 temp/1Mtest2a mv -f temp/1Mtest3 temp/1Mtest3a mv -f temp/1Mtest4 temp/1Mtest4a rm -f temp/1Mtest1a rm -f temp/1Mtest2a rm -f temp/1Mtest3a rm -f temp/1Mtest4a done |