Using Logical Volume Management
Logical Volume Management (LVM) is an abstraction layer over the hard drives, which allows the Linux kernel to access the filesystems normally, yet each filesystem may be comprised of multiple hard drives. The main benefit you may see with LVM is when you run out of space in a filesystem (/home, for example), you can either resize the filesystems on the fly, or add another hard drive and spread /home across the two drives. If you are running short on two filesystems, the new drive can be used to augment both filesystems.
Notice how I have avoided the use of the word “partition”? Partitions do not exist under LVM. Under most Linux systems, a partition is used to create a filesystem (formatted with ext2, ext3, or reiserfs), then the filesystem is mounted to a mount point. LVM can use your partitions, and combine them together in one large storage pool (called a volume group). From that volume group (VG), you create logical volumes (LV), which is like a partition, from which you create the filesystems. Page 3 of the LVM Whitepaper (PDF) describes this concept in detail.
Last December, I set up my Linux workstation. Since I didn't really know how I would use the machine over the next few months, I decided to install LVM - I was trained in IBM AIX LVM, so I knew what it could do. I also chose to create my filesystems using ReiserFS, which turned out to be a huge benefit. Four months later, I filled the /home filesystem. Traditionally, I would have been forced to move stuff around, and make a bunch of symlinks to use the space on another file system, or repartition, reformat and reload my data. In this case, /home was 100% full, but my /share and /tmp filesystems had several gigabytes of unused space on them. The LVM HOWTO descibes a classic scenario like this one that illustrates exactly why LVM is an excellent tool.
Obviously, the solution was to resize the LV's. However, I had an old unused 4GB hard drive (more on this later) that I wanted to add to the mix. I installed the new hard drive, set its partition type to LVM (the whitepaper says this is not necessary for LVM, but old habits die hard, and I did this before reading the whitepaper), and added it to the VG. When that was done, I resized the LV's to use the 4GB drive and to take some space from /share and /tmp, and I gave it to /home.
This all sounds so simple, but of course, it was not. My first snag was in trying to resize the reiserfs on /home. Since I am using SuSE 7.3, I used YaST2. It showed me that my filesystem was resized, yet df showed me the truth - my filesystem was still the same size. Undaunted, I tried several more times. I fired up YaST1, and it resized the ReiserFS with no problems.
The second snag is the old 4GB drive itself. My other drives were 7200 RPM Fast IDE drives. The 4GB drive was a 5400 RPM [slow] IDE drive. Because LVM blended it in so well to the VG, I now suffered a data throughput performance hit. Before I used the 4GB drive, I could move data from filesystem to filesystem with a sustained data transfer rate of about 8 - 10MB/sec. With the old drive in place, my sustained data transfer rate was 1 - 1.5MB/sec. It looks like you are limited to the speed of the slowest drive on the filesystem, which makes sense.
Since LVM is a kernel device driver, it works with all Linux distributions, however, only some distributions support LVM during installation. As of this writing, only Mandrake (see figure 1) and SuSE (see figure 2) support implementing LVM during Linux installation.
SuSE's YaST administration tool provides a GUI-based logical volume management interface. As mentioned earlier, I noticed YaST2 does not resize ReiserFS VG's properly. YaST1 works correctly.
This brings me back to the benefit of using ReiserFS that I mentioned earlier - the ability to resize the filesystem on the fly. The ext3 filesystem has the ability to be resized, however, that filesystem must be unmounted during resizing, and ReiserFS can be resized while it is mounted and in use.
Regardless of which Linux distribution you use, you may always use the command line to manage your LVM installation. The LVM whitepaper provides an excellent discussion on using these tools.
George Toft has been heavily involved in Linux system administration for five years. He enjoys helping newbies and is currently teaching Introduction to Unix/Linux at a local community college. He also maintains a web site devoted to Linux and Linux Security at www.georgetoft.com/linux.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- Stunnel Security for Oracle
- The Firebird Project's Firebird Relational Database
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide