Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: mount a compressed qcow2 file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Sat Sep 06, 2014 6:50 pm    Post subject: HOWTO: mount a compressed qcow2 file Reply with quote

Task: change the file /etc/conf.d/hostname of a cloned qemu KVM qcow2 file, if / is the 4th partition, from "n22kvm" to "n22kvmclone":
Code:

$> cd /var/lib/libvirt/images/
$> qemu-img convert -c -f qcow2 -O qcow2 -o cluster_size=2M Gentoo.qcow2 Gentoo-clone.qcow2
$> modprobe nbd
$> qemu-nbd -c /dev/nbd4 -P 4 /var/lib/libvirt/images/Gentoo-clone.qcow2
$> mkdir /mnt/ramdisk/p4
$> mount /dev/nbd4 /mnt/ramdisk/p4
$> sed -i -e 's/n22kvm/n22kvmclone/' /mnt/ramdisk/p4/etc/conf.d/hostname
$> umount /mnt/ramdisk/p4
:-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum