Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Device Boot Start End Blocks Id System
/dev/sda1 * 1 14 103424 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 14 1306 10380288 8e Linux LVM
/dev/sda3 1306 2610 10480089 8e Linux LVM
/dev/sda4 2611 5221 20972857+ 8e Linux LVM
This is not related to LVM. You've hit the 4 partition limit of the MBR partition table.
The MBR only has room for four entries, limiting you to a maximum of four primary partitions. A workaround exists; one of the four primary partitions can be a so-called extended partision, which in turn can contain a number of sub-partitions ("logical" partitions).
Unfortunately, you've already created four primary partitions. You will need to convert the last of these to an extended partition containing a logical partition. This typically involves backing up data and deleting and recreating the partition in question, although various utilities exist which claim to be able to do a non-destructive conversion.
In either case, your existing /dev/sda4 partition will become /dev/sda5, so you'll need to reconfigure LVM.
These partitions are PVs in an LVM Volume Group, right? No, there's no way to simply merge the partitions. Each partition contains LVM metadata that identifies it as an LVM Physical Volume.
However, it is possible to add a temporary drive (say, an external USB drive) to the VG, use pvmove to migrate all data from /dev/sda4, and then remove /dev/sda4 from the VG with vgreduce.
You could then create an extended partition (/dev/sda4, which should take up all available disk space) and any number of logical partitions (/dev/sda5++), which you could then add back to the VG before using pvmove/vgreduce again to get rid of the temporary drive.
Actually, if that's not possible, if I add another physical HDD to the OS. Can I then create it as a new partition (I assume /dev/sdb1) and add that to the LVM without losing anything? If so, can someone please tell me the commands to do this?
So you'll wind up wasting half that (original) disk - no big deal I suppose these days. Allocating multiple pv's like that is limiting in a LVM setup.
In future you would be better off to have one large pv (maybe even the entire disk in the case of the new disk), and use vg's to carve it up if you wish; that way you can expand at will, and not waste disk real estate.