![]() ![]() ![]() You may want to create a new LV to provide a dedicated partition for a specific purpose. The two most common operations on LVs are creating a new LV and extending an existing one.īy default, CentOS 6 comes with two LVs: lv_root for the root (/) filesystem directory and lv_swap for the Linux swap partition. VGs provide the necessary storage resources to create new or to extend existing logical volumes (LV), on top of which filesystems can be created. ![]() Having around 20% free capacity allows you to prevent disasters with logical volumes (partitions) running out of space. For additional details and options, check the manual for vgs.Īs a rule of thumb you should plan to leave some free unallocated space in a VG. (We'll talk about logical volumes in a moment.) The attribute column shows the VolGroup is writable (w) and resizable (z). In this output, the VG VolGroup has two physical volumes and two logical volumes. In our example, vgs shows: VG #PV #LV #SN Attr VSize VFree One VG provides enough flexibility and functionality to create, increase, and decrease numerous volumes on a server.īefore and after making changes on VGs use the command vgs to show summary information about the available VGs. You should stick with only one VG and not create multiple ones on the same server. For example, to create a new VG called TestsVolGroup, run the command vgcreate TestsVolGroup /dev/sdb1. If there is no VG yet on the server, you can create a new VG with the command vgcreate. In our case, the command vgextend VolGroup /dev/sdb1 extends the VG called VolGroup, which is the default one in CentOS 6. To extend a VG, use the command vgextend. Once you've initialized the PV on /dev/sdb1 you can either extend a VG or create a new one. This allows some useful functionality, such as disk striping for better read/write performance. LVM physical volumes are the basis of volume groups (VG), which can comprise one or more PVs. To continue our example with /dev/sdb1, run pvcreate /dev/sdb1. Once you have the LVM partition you need to initialize the physical volume (PV) using the command pvcreate. The number one in /dev/sdb1 comes from the setup in fdisk, and means primary partition number one. Your new partition should appear as /dev/sdb1: Device Boot Start End Blocks Id System To make sure the new LVM partition is ready, run the command fdisk -l /dev/sdb. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |