tagline: From openSUSE
|Tested on openSUSE||Recommended articles||Related articles|
A "standard" or purely primary partition scheme is the most common and is how most computers are partitioned from the manufacturer. In an IBM partition scheme, the partition table on the master boot record has 4 entries. This is where information about primary partitions is stored. It is generally a good idea to have at least one primary partition used to boot the system.
Information about extended partitions is stored in the extended partition boot record descriptor. Each extended partition has its own descriptor, independent from other extended partitions. The maximum number of logical partitions that can be made inside an extended partition is only limited by the amount of available disk space, however, in earlier versions of Windows, fdisk was limited by the number of available drive letters it could assign. A and B were reserved, C was system; therefore the maximum number of logical partitions was 23, before Windows adopted a Unix-like partition mounting scheme.
It is of somewhat importance to make the distinction between "extended partition" and "logical partition". An extended partition is actually a special type of primary partition, which, by itself, doesn't really contain any file system information. It instead usually contains 1 or more logical partitions ("logical" tends to get confused with "extended", and in some cases is considered and appropriate substitution).
Using the Linux kernel's logical volume manager works like this: you create a physical primary or extended partition (usually the latter) and then create multiple logical volume groups or partitions inside the physical LVM partition. LVM is more flexible than traditional partitioning in a variety of ways; the features that have the highest probability of interest are listed here:
- Volume groups can consist of and span multiple physical volumes
- Mirroring/striping entire or partial sections of logical volumes (similar to RAID 1 or 0, respectively)
- Create read-only or read-write snapshots of logical volumes (volume-level backups)
- Online volume groups can be resized, either by absorbing new physical volumes or by ejecting existing ones
- Online logical volumes can be resized as well, by either concatenating or truncating extents to/from them
- Flexibly move logical volumes between physical volumes
It would be, in most cases, a good idea to stick with a standard Primary/Extended partitioning scheme unless one of these features is of particular interest to you.
A logical volume group consists of 1 or more LVM partitions (which can be either primary or extended, so long as the partition type code is 0x8E (LVM). The former requirement makes creating a LVG slightly more elusive in YaST, but once you know how to do it, the procedure becomes ridiculously simple.
Those familiar with the Microsoft's LVM implementation (also called "dynamic disk array") might also note that instead of requiring that an entire "basic" disk be converted to a "dynamic" disk, the Linux LVM is more flexible and is implemented within partition boot records instead.
One thing to notice is that you could just as easily create just a single 200gb root--or "/"--partition and that would work just fine (provided you had enough physical memory to avoid requiring a swap partition).
The reasoning for this is that if, for example, you ever wanted to do a clean (re)installation of openSUSE, you wouldn't have much, if anything, to backup prior to formatting the root partition, as it is all stored in /home. On the other hand, if /home was on the root partition, this would probably require that you migrate /home to another physical volume prior to formatting the root partition. Creating a separate /boot in this scenario could be considered somewhat unnecessary, but usually is a good idea.
Note the device numbering, paying special attention to sda3.
/boot ends up being more than a few gigabytes from the beginning of the drive in this case. This, in general, is not a very good practice, and in some circumstances (on older/crappier BIOS's) will cause the system not to boot; YaST warn you about this too. However, on modern systems, the BIOS will still be able to find the boot partition, and you'll never notice the difference once you accept the partition scheme. For more information: SDB:Sandbox#Boot_Volume
This is where the advantages of separating /boot from the root partition become more evident. /boot, in most cases, needs to be located on a primary partition (and this is true of any operating system). It would be inconvenient (but still possible), in this case, to make a primary root partition, and keep /home and swap in the extended partition. This would make even more sense if you added in the a windows recovery partitions that are becoming more common in OEM Windows installations. If you had one of those systems with both a "system" partition (presumably containing the NTLDR) and a recovery system, you now only have room for one more primary partition.
It would also cause minimal disruption of your Windows partition to shrink it by 100mb instead of 20+gb to add a /boot partition, and then place the root partition on another physical volume, thereby avoiding having to reconfigure your BIOS to boot from the secondary PV as an additional bonus.
Creating a LVG really only makes sense when you're dealing with multiple physical volumes with which you want to span a single partition across. One of the most brilliant partition schemes I can think of would involve having one small, high-speed SSD, and two larger HDD's. The partition scheme would look thus:
Telling the LVM that you want two stripes on lvg1/root and lvg1/home on the same two physical volumes is just barely scratching the surface of the power of the LLVM.
The LVM physical partitions work somewhat similarly to how extended partitions work, not directly containing any filesystem information. The interesting thing here is that instead of creating another device on that parent node, an entirely new device node structure is created: /dev/lvg1 (you actually select what you want the device to be called, "lvg1" is completely arbitrary, as well as "lvg1/root" and "lvg1/home").
You don not need /boot to be on a physical volume not used in LVM. The following is just as valid:
To explain: if you want to have multiple stripes, it is a good idea to make your physical LVM partitions the same size. Otherwise, the maximum size of a striped logical volume would be limited to the maximum size of smallest physical volume/partition in the logical volume group multiplied by the number of physical volumes/partitions in the group. The above table is an example of this, where 100mb of the lvg1 is unused. If lvg1/home or lvg1/root only had 1 stripe, then the maximum size of the logical volume would be 379.9gb or 20.1gb, respectively. Neither lvg1/home or lvg1/root is particularly closer to any portion of either disk, but explaining the actual mechanics of how the LLVM decides where to store what extent is far outside the scope of this article.
If another operating system is already present on the boot volume (Windows), you may want to free 100MB to make room for a proper /boot partition. However, sadly, the YaST partitioning module doesn't support moving partitions around like that, so if you wish to do that, you'll need to get a more advanced tool like SDB:Gparted