Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Experiment: Same with a read only LV:
- # make new rw LV
- lvcreate -n testqemudiff -L 10G testvg
- # put some sample files there
- mkfs.ext4 -m 0 /dev/testvg/testqemudiff
- mount /dev/testvg/testqemudiff /mnt/test
- cp ~/archive/software/openSUSE/openSUSE-12.2-KDE-LiveCD-x86_64.iso /mnt/test
- umount /mnt/test
- # make it ro
- lvchange -p r testvg/testqemudiff
- # verify it is read only
- dd if=/dev/zero of=/dev/testvg/testqemudiff bs=1 count=1
- dd: failed to open ‘/dev/testvg/testqemudiff’: Read-only file system
- qemu-img create -b /dev/testvg/testqemudiff -f qcow2 testqemudiff.qcow2
- Formatting 'testqemudiff.qcow2', fmt=qcow2 size=10737418240 backing_file='/dev/testvg/testqemudiff' encryption=off cluster_size=65536 lazy_refcounts=off
- # try using the differential disk
- # start the nbd server (wrong way to do it for qcow2 ... this exports it raw)
- modprobe nbd
- zypper install nbd
- cp /etc/nbd-server/config{.example,}
- vim /etc/nbd-server/config
- [generic]
- # comment out the user and group
- # or create the user and group, and make sure the user can access the exported files
- listenaddr = 127.0.0.1
- [export1]
- exportname = /home/peter/tmp/qemu-base-disk/testqemudiff.qcow2
- /etc/init.d/nbd-server start
- # start the nbd client
- nbd-client localhost -N export1 /dev/nbd0
- # doesn't work ... this doesn't translate the qcow2 file into a raw
- # start using qemu-nbd (the right way to use qcow2)
- qemu-nbd -b 127.0.0.1 testqemudiff.qcow2
- (let it chill or nohup / bg it / whatever)
- nbd-client localhost 10809 /dev/nbd0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement