It will be cloned and be guestmounted for modify(copy file,change config file,eg.)
But md5sum check mismatch after copy file into qcow2 and boot up.
Here is my test script:
# mount zfs block device and guestmount os.qcow2 inside.
zfs clone qbackup/redhat-6.7@test qbackup/sun_3;sleep 3;
mount /dev/qbackup/sun_3 /tmp/1;
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2;
# copy testfile(14M) into qcow2
cp /root/testfile /tmp/2/usr/local/bin/;
# guestmount again ,and check md5
umount /tmp/2/;
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2;
md5sum /tmp/2/usr/local/bin/testfile
umount /tmp/2
# guestmount agagin ,and check md5
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2
md5sum /tmp/2/usr/local/bin/testfile
umount /tmp/2
result
14b80a29535342a242ef9b61e4883472 /tmp/2/usr/local/bin/testfile # Wrong md5 result
1fd08ffc62181a31068dbde11aacd60f /tmp/2/usr/local/bin/testfile # Right md5 result
Then I copy os.qcow2 out of zfs ,use normal filesystem instead.
new test script
# copy an new os.qcow2
rm /tmp/1/os.qcow2 ; #/tmp/1/ based lvm and xfs now.
cp os.qcow2 /tmp/1/ ;
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2;
cp /root/testfile /tmp/2/usr/local/bin/;
umount /tmp/2/;
# guestmount os.qcow2 and check md5
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2;
md5sum /tmp/2/usr/local/bin/testfile
umount /tmp/2
# guestmount again and check md5
guestmount -a /tmp/1/os.qcow2 -w -i /tmp/2
md5sum /tmp/2/usr/local/bin/testfile
umount /tmp/2
result
1fd08ffc62181a31068dbde11aacd60f /tmp/2/usr/local/bin/testfile # Right value
1fd08ffc62181a31068dbde11aacd60f /tmp/2/usr/local/bin/testfile # Right value
System information
Describe the problem you're observing
There is an os qcow2 file in zfs.
It will be cloned and be guestmounted for modify(copy file,change config file,eg.)
But md5sum check mismatch after copy file into qcow2 and boot up.
Here is my test script:
result
Then I copy os.qcow2 out of zfs ,use normal filesystem instead.
new test script
result
I tried
zfs set sync=always
, did not work....Describe how to reproduce the problem
Include any warning/errors/backtraces from the system logs