Additional Information for the RHCE Exam / Logical Volumes After Installation Pt.2
Subtitles of the Movie
Now, let's add space for logical volume. We start with the partitions created in another video, specifically these two partitions created on the second SCSI drive formatted to the Linux Logical Volume Management file type. First we create physical volumes. It's easy to do with the pvcreate command. You can run this command to create physical volumes on both partitions simultaneously. And that confirms that we've created physical volumes on both of those partitions. Next, let's set up a volume group. It's easy to do with the vgcreate command. We need a name for the volume group, and for this video we'll pick a simple name. Call it vgname. And the components will be the two physical volumes that we just created. And this confirms that we created volume group named vgname. Now, let's allocate some of the space from this volume group to a logical volume. This particular switch allows me to configure the size I want. Call it 400 megabytes. From the volume group named vgname to a logical volume, let's call it lvname. To confirm, we should be able to find an associated device file. And there it is. It's ready to be formatted. The default file system is the extended 3 file system which we can apply to the device file name. And once formatted that device is ready to be mounted. Just for purposes of illustration, I mount it on the local test directory. And there it is. Let's demonstrate what you can do to resize a logical volume. Before you do any of that you should always unmount such volumes. If we have available space in the current logical volume, all we need to do is resize it. If we need more space we can create additional physical volumes. We can use commands like vgextend to take advantage of the new space available from the new physical volumes. But we already have plenty of space, so let's just resize the current logical volume to a size of 800 megabytes. If we had enough space we could even use gigabytes. And there it is. The logical volume is successfully resized. But before we can take advantage of this space we need to resize what's formatted to take advantage, and that requires the resize2fs command. We apply it to the device name and if I leave this blank, I can take full advantage of the available space, or I can specify something less than the available space. But wait a second. I have to make sure the file system is still good with the noted command. That's easy enough to do. The file system is now resized and note how the file system now takes full advantage of the space as specified. We've created a new logical volume. We've formatted it. We've tested it by mounting it. We've resized the logical volume. Before resizing any logical volume it has to be unmounted first, and we've filled in the space in the file system. Finally, to implement the logical volume, in other words, to make sure Linux recognizes and uses it the next time you boot Linux, you have to set it up in the etc slash fstab configuration file. That's the device file. We can set it up in the directory desired. It's been formatted to the third extended file system. And there it is. The next time you boot Linux this configuration file will make sure that the temp directory is automatically mounted on the logical volume device as specified.
Tutorial Information
| Course: | Red Hat Certified Engineer |
| Author: | Michael Jang |
| SKU: | 33845 |
| ISBN: | 1-934743-47-X |
| Release Date: | 2008-01-18 |
| Duration: | 6.5 hrs / 94 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 