sample_bmap_tools.sh 446 B

12345678910111213141516
  1. #!/bin/sh
  2. # simple test which creates a dummy file system image, then use bmaptool create
  3. # and bmaptool copy to copy it to another file
  4. set -xeu
  5. # create the necessary test files
  6. dd if=/dev/zero of=disk.img bs=2M count=1
  7. mkfs.ext4 disk.img
  8. fallocate -d disk.img
  9. dd if=/dev/zero of=copy.img bs=2M count=1
  10. # do a test copy of the file system image
  11. bmaptool create -o disk.img.bmap disk.img
  12. bmaptool copy disk.img copy.img
  13. cmp disk.img copy.img