Then use w to write the partition table to disk and exit:
Command (m for help): w
The partition table has been altered!
Calling ioctl( ) to re-read partition table.
Syncing disks.
You can now rerun the graphical LVM administration tool and initialize the partition for use with LVM. This gives you a new physical volume that you can work with.
The next step is to add the new physical volume to the volume group. You'll see the newly initialized partition under Unallocated Volumes in the left pane. Click on it, and then click on the button labeled 'Add Volume to existing Volume Group.' A menu of volume groups will appear; select the one to add it to, and then click Add.
Once you've added a PV, you can use the extra space to create new logical volumes or grow an existing volume.
6.1.1.2.5. Removing a partition
To take a physical volume (partition) out of a volume group, select the PV in the left pane, and then click 'Remove Volume from Volume Group.' You will be prompted for confirmation (including any move of data to another device), and the PV will be removed (as long as the free space in the VG exceeds the size of the PV; otherwise, removing the PV would destroy data).
6.1.1.3. Managing LVMs from the command line
Logical volumes are almost always used to contain filesystems (the other common use is to hold swapspace). In essence, an LV serves as a container for a filesystem. This has several ramifications:
? The LV must be created before the filesystem can be created.
? The filesystem must be removed before the LV is destroyed.
? When growing an LV and filesystem, the LV must be grown first.
? When shrinking an LV and filesystem, the filesystem must be reduced first.
Fedora's LVM2 system provides the
# lvm
lvm>
At the lvm> prompt, you can enter any of the subcommands shown in Table 6-1.
Table 6-1. LVM subcommands
LVM subcommand | Description |
---|---|
vgs | Displays details about volume groups (compact) |
pvs | Displays details about physical volumes (compact) |
lvs | Displays details about logical volumes (compact) |
vgdisplay | Displays details about volume groups (verbose) |
pvdisplay | Displays details about physical volumes (verbose) |
lvdisplay | Displays details about logical volumes (verbose) |
vgcreate | Creates a volume group |
vgremove | Removes a volume group |
pvcreate | Prepares a block device (such as a disk partition) for inclusion in a volume group by adding a disk label to the start of the block device |
pvremove | Wipes out the disk label created by pvcreate |
vgextend | Adds a physical volume to a volume group |
vgremove | Removes a physical volume from a volume group |