Red Hat ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE Manual page 153

Hide thumbs Also See for ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE:
Table of Contents

Advertisement

7.
Mount the disk on the guest.
# mount -/dev/hdb1 /myfiles
The guest now has an additional virtualized file-based storage device.
Adding hard drives and other block devices to a guest
System administrators use additional hard drives for to provide more storage space or to separate
system data from user data. This procedure,
virtualized
guests", describes how to add a hard drive on the host to a virtualized guest.
The procedure works for all physical block devices, this includes CD-ROM, DVD and floppy devices.
Block device security
The host should not use disk labels to identify file systems in the fstab file, the initrd
file or used by the kernel command line. If less privileged users, especially virtualized
guests, have write access to whole partitions or LVM volumes the host system could be
compromised.
Guest should not be given write access to whole disks or block devices (for example, /
dev/sdb). Virtualized guests with access to block devices may be able to access other
block devices on the system or modify volume labels which can be used to compromise
the host system. Use partitions (for example, /dev/sdb1) or LVM volumes to prevent this
issue.
Procedure 8.1. Adding physical block devices to virtualized guests
1.
Physically attach the hard disk device to the host. Configure the host if the drive is not accessible
by default.
2.
Configure the device with multipath and persistence on the host if required.
3.
Use the virsh attach command. Replace: myguest with your guest's name, /dev/hdb1
with the device to add, and hdc with the location for the device on the guest. The hdc must be an
unused device name. Use the hd* notation for Windows guests as well, the guest will recognize
the device correctly.
Append the --type hdd parameter to the command for CD-ROM or DVD devices.
Append the --type floppy parameter to the command for floppy devices.
# virsh attach-disk myguest
/dev/hdb1
hdc ---driver tap ---mode readonly
4.
The guest now has a new hard disk device called /dev/hdb on Linux or D: drive, or similar,
on Windows. This device may require formatting.
Procedure 8.1, "Adding physical block devices to
Adding storage devices to guests
139

Advertisement

Table of Contents
loading

Table of Contents