Copy On Write Loop Block Driver
I am running on the CentOS 6.5 x86_64 boot disk.
# uname -a Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
I have been running ddrescue for a while and now it is time to check the progress.
I want to take the oldhd.img output from ddrescue and load it to satrt performing recovery (LVM, then filesystem) but I want to do a copy on write with that.
I fetched http://www.atcomputing.nl/Tools/cowloop/packages/cowloop-3.2.0.1.tar.gz, built it
root@localhost ~/cowloop-3.2.0.1
# cowdev -a /root/oldhd.img /root/oldhd.cow Cannot open /dev/cow/ctl: No such device or address
So I:
root@localhost /dev
# mkdir cow
root@localhost /dev
# cd cow/
root@localhost /dev/cow
# mknod /dev/cow/ctl b 241 255
But I still get a
root@localhost ~
# cowdev -a /root/oldhd.img /root/oldhd.cow Cannot open /dev/cow/ctl: No such device or address
Listing /proc/devices I do not see 241.
What am I doing wrong here?
-Jason
4 thoughts on - Copy On Write Loop Block Driver
A) you don’t create anything in /dev, the driver should be using devfs to create its own devnodes on the fly as needed.
B) you apparently never loaded the driver. see http://www.atcomputing.nl/Tools/cowloop/loadunload.html
I assumed such, but it did not work.
3.2.0.1 says:
root@localhost ~/cowloop-3.2.0.1
# cat RELEASENOTES.3.2.0
This is version 3.2 of the Copy on Write loop driver ‘cowloop’
by ATComputing in Nijmegen, The Netherlands. Release date: September 2009.
—
Per http://en.wikipedia.org/wiki/Cowloop
Cowloop (copy-on-write loop driver) was a Linux kernel driver … Cowloop is now largely deprecated in favor of the device-mapper snapshot target which provides the same functionality.
On to learning device mapper, https://www.kernel.org/doc/Documentation/device-mapper/snapshot.txt
Solved!
IMGLOOP=$(losetup -fr –show /root/oldhd.img)
dd if=/dev/zero of=/root/oldhd.cow bs=1 count=0 seek=$(wc -c < /root/oldhd.img) COWLOOP=$(losetup -f --show /root/oldhd.cow) echo 0 `blockdev --getsz $IMGLOOP` snapshot $IMGLOOP $COWLOOP p 4 | dmsetup create cowimg kpartx -av /dev/mapper/cowimg