Tag: Disk

Create a new sparse KVM virtual disk

qemu-img create -f qcow2 imagename.qcow2 400G

This creates a new 400GB sparse disk that is only about 250kb on disk.


Add a disk

Add a disk to RHEL virt

Add the directories, set the contexts and then restore the contexts.

Working on disk that mounts to /mnt/d500

Create the directories I want to use:

mkdir -p /mnt/d500/libvirt/images

Set the context for the libvirt directory:

semanage fcontext -a -t virt_var_lib_t "/mnt/d500/libvirt"

Set the context for the images directory:

semanage fcontext -a -t virt_image_t "/mnt/d500/libvirt(/.*)?"

Then write the contexts:

restorecon -R /mnt/d500/

Then check the contexts:

ls -lZd /mnt/d500/libvirt/images/

 


Copyright © 1996-2013 Xander Harkness. All rights reserved.
iDream theme by Templates Next | Powered by WordPress
loading