![]() Once you had created the physical volume you can use the “ pvdisplay” command to display the current physical volumes on the system as shown in Figure 2.1. Physical volume "/dev/sda1" successfully created The command that we will use to create a physical volume is the “ pvcreate” command, Figure 2 shows the command used to create a physical volume using the “/dev/sda1” partition. A physical volume is usually a hard disk or a device that is similar to a hard disk. ![]() The first step that we need to do is create a physical volume. The partition that we will be working with is the “/dev/sda1” partition which is the first partition we created. We will not use the second partition until the “Extending LVM” section. In this section of the article we are going to look at configuring LVM from the command line. Once the partition table has been re-read you are ready to configure LVM. In Figure 1.5 you may be wondering what the second command does “ echo $?“, this checks the exit status of the previous enter command, if it returns a zero then the command was successfully executed. linux-6j7i:~ # partprobe /dev/sdaįigure 1.5: Have the partition table re-read. Once the partition table has been written you can issue the “ partprobe” command to have the kernel re-read the partition table and have the newly created partitions available without the need of rebooting the machine, as shown in Figure 1.5. The new table will be used at the next reboot.įigure 1.4: Writing the new partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. Partition table entries are not in disk orderĬalling ioctl() to re-read partition table. Once you are happy with the partitioning scheme, you can write the new partition table by issuing the “ w” command within the “ fdisk” utility as shown in Figure 1.4. Once you have successfully created the LVM you can repeat the steps again to create the second LVM which we will use later in this article. Command (m for help): pĬhanged system type of partition 1 to 8e (Linux LVM)įigure 1.3: Changing the “partition system id”. The “partition system id” field can be change simply by issuing the “t” option in the “ fdisk” utility as shown in Figure 1.3. Once the partition has been created you may notice that the “partition system id” field for that partition is set to Linux, this needs to be change to LVM which has the hex value of “8e”. Last cylinder or +size or +sizeM or +sizeK (1-653, default 653): +2048Mįigure 1.2: Creating a new 2GB partition. ![]() There is nothing wrong with that, but this is larger than 1024,Īnd could in certain setups cause problems with:ġ) software that runs at boot time (e.g., old versions of LILO)Ģ) booting and partitioning software from other OSs The number of cylinders for this disk is set to 2610. Once the “ fdisk” command has been executed you will be able to create a new partition as shown in Figure 1.2. Once you know the layout of your partition table you can start the “ fdisk” utility by issuing the “ fdisk /dev/sda” command. The current partition table can be viewed by issues the “ fdisk -l” command as shown in Figure 1. The partitioning utility which we will use in this article is the “ fdisk” utility along with the “ partprobe” utility to avoid rebooting the machine after partitioning the disk. The first partition that we will create is for the initial LVM setup and the second partition will be used to show how to extend a logical volume. In this article we have five gigabytes of free space, we will need to create two partitions of type LVM with the size of two gigabytes each. We will look at configuring LVM from the command line and we will also look at resizing volumes. In this article we will cover some of the basics of LVM (Logical Volume Management).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |