2013-01-30 09:06:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# http://tracker.ceph.com/issues/3964
|
|
|
|
|
2013-02-15 21:57:47 +00:00
|
|
|
[ -d /sys/bus/rbd ] || sudo modprobe rbd
|
|
|
|
sudo chown ubuntu /sys/bus/rbd/add
|
|
|
|
sudo chown ubuntu /sys/bus/rbd/remove
|
|
|
|
|
2013-01-30 09:06:03 +00:00
|
|
|
rbd create image -s 100
|
|
|
|
rbd map image
|
|
|
|
udevadm settle # note: newer versions of rbd do this for you.
|
|
|
|
dd if=/dev/zero of=/dev/rbd/rbd/image oflag=direct count=10
|
|
|
|
rbd snap create image@s1
|
|
|
|
dd if=/dev/zero of=/dev/rbd/rbd/image oflag=direct count=10 # used to fail
|
|
|
|
rbd snap rm image@s1
|
|
|
|
dd if=/dev/zero of=/dev/rbd/rbd/image oflag=direct count=10
|
2013-02-16 00:26:16 +00:00
|
|
|
rbd unmap /dev/rbd/rbd/image
|
2013-02-18 19:24:46 +00:00
|
|
|
rbd rm image
|
2013-01-30 09:06:03 +00:00
|
|
|
|
|
|
|
echo OK
|
2013-02-16 00:26:16 +00:00
|
|
|
|