Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
12.2. Partition-based Storage Pools
This section covers using a pre-formatted block device, a partition, as a storage pool.
For the following examples, a host physical machine has a 500GB hard drive (
/dev/sdc
) partitioned into one 500GB, ext4 formatted partition (/dev/sdc1
). We set up a storage pool for it using the procedure below.
12.2.1. Creating a Partition-based Storage Pool Using virt-manager
This procedure creates a new storage pool using a partition of a storage device.
Procedure 12.1. Creating a partition-based storage pool with virt-manager
Open the storage pool settings
- In the
virt-manager
graphical interface, select the host physical machine from the main window.Open the Edit menu and select Connection DetailsFigure 12.1. Connection Details
- Click on the Storage tab of the Connection Details window.
Figure 12.2. Storage tab
Create the new storage pool
Add a new pool (part 1)
Press the + button (the add pool button). The Add a New Storage Pool wizard appears.Choose a Name for the storage pool. This example uses the name guest_images_fs. Change the Type tofs: Pre-Formatted Block Device
.Figure 12.3. Storage pool name and type
Press the Forward button to continue.Add a new pool (part 2)
Change the Target Path, Format, and Source Path fields.Figure 12.4. Storage pool path and format
- Target Path
- Enter the location to mount the source device for the storage pool in the Target Path field. If the location does not already exist,
virt-manager
will create the directory. - Format
- Select a format from the Format list. The device is formatted with the selected format.This example uses the ext4 file system, the default Red Hat Enterprise Linux file system.
- Source Path
- Enter the device in the
Source Path
field.This example uses the /dev/sdc1 device.
Verify the details and press the Finish button to create the storage pool.
Verify the new storage pool
The new storage pool appears in the storage list on the left after a few seconds. Verify the size is reported as expected, 458.20 GB Free in this example. Verify the State field reports the new storage pool as Active.Select the storage pool. In the Autostart field, click the On Boot check box. This will make sure the storage device starts whenever thelibvirtd
service starts.Figure 12.5. Storage list confirmation
The storage pool is now created, close the Connection Details window.