#!/bin/csh -f # C-shell script to run part A of test 02 but using the _LINEAR_ target. echo 'creating new pv file' dd if=/dev/zero of=dev01 bs=512 count=2105344 echo '' echo 'setting up lv' losetup /dev/loop0 dev01 pvcreate /dev/loop0 vgcreate vg1 /dev/loop0 lvcreate -L 1024M -n lv1 vg1 echo 'setting up linear mapping' dmsetup create fred01 --table '0 2097152 linear /dev/vg1/lv1 0' echo 'writing the whole thing' sleep 3 dd if=/dev/urandom of=/dev/mapper/fred01 bs=8192 echo '' echo 'making a copy' sleep 3 cp -i /dev/vg1/lv1 zz.file echo '' echo 'doing a first diff' sleep 3 diff /dev/vg1/lv1 zz.file echo first diff status was $status echo '' echo 'showing the first contents' od -A x -xc /dev/vg1/lv1 | head echo '' echo 'removing the linear mapping so the changes can be seen' sleep 3 dmsetup remove fred01 echo '' echo 'showing the second contents' od -A x -xc /dev/vg1/lv1 | head echo '' echo 'doing a second diff' sleep 3 diff /dev/vg1/lv1 zz.file echo second diff status was $status echo ''