[Leaplist] "SWAP" --- " RHEL Logical Volume Management System"

John Simpson jms1 at jms1.net
Fri May 9 17:39:07 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2008-05-05, at 1822, William H. Ferguson wrote:
>
> I was previously somewhat familiar with the 4th Partition in Linux  
> which is called the Extended Partition. I understood that many  
> Directories could be created in that Extended 4th Partition

the idea of an "extended partition" has nothing to do with linux per  
se; it's been around since IBM first built a PC with a hard drive in it.

under the IBM partition table format (which is used by MS-DOS,  
windows, linux, and many other operating systems) the partition table  
physically has room for four partitions. if somebody needs more than  
four, they can make one of the four into an "extended partition",  
which itself contains a four-slot partition table, which makes it  
possible to have up to seven usable partitions on a disk.

there is functionally no difference between a partition within the  
first partition table (which would be called /dev/hda[0-3]) and a  
partition within the extended partition's partition table (which would  
be called /dev/hda[4-7].)

the "extended partition" doesn't contain directories, it contains  
partitions. each partition, whether 0-3 or 4-7, contains a  
filesystem... and the filesystem contains directories.


> I used that Partitioning approach back around Fedora Core 5 to  
> install Fedora. I created     /boot/     / root     and Swap      as  
> Primary Partitions and then created the Extended Partition as my 4th  
> Primary Partition. Within that 4th Partition I created several  
> Partitions which I wanted, and one of them was  /home.
>
> With that prologue I write to ask these two basic (to me)  questions:
>
> 1. Can the User still install a Linux Distribution (I happen to use  
> Fedora Core 8 now) without ever using the Logical Volume Management  
> System if he so desires? Similar to what I summarized in two  
> paragraphs above this one.

yes. however, you have to do a "custom" layout, because fedora's  
default (if you let it do whatever it wants with your disk) is to  
install LVM and create all of its filesystems as LVM containers.

unfortunately, it takes all available space when it does this, so even  
if you want to use LVM but leave some open room for future partitions,  
you have to do a "custom" layout, and create the PV (or PVs), VG, and  
LVs by hand.

i concentrated on LVM for your system, because it was already running  
with LVM. you didn't want to re-install from scratch, so what we  
needed to do was shrink your "/" filesystem (which was almost the  
entire disk) and the LVM container which holds it, and that would have  
freed up enough space for you to create additional LVM containers to  
set up separate partitions for each family member's home directory.


> 2. Does SWAP always have to be a Primary Partition?
>     Or can SWAP be a not-Primary Partition?

first, please put the distinction between "primary" and "non-primary"  
partitions out of your mind. THERE IS NO DIFFERENCE. they are both  
"physical parititions", in that they represent a physically contiguous  
series of blocks on the disk.

swap space, like any other filesystem, can be created on ANY  
partition, whether it's in a primary partition, an extended partition,  
an LVM logical volume, a RAID container, or a raw disk without a  
partition table at all (if you structure it correctly.) all that  
matters is that the kernel is able to address it as a block device.  
for that matter, you can even create a file and use that as swap  
space, although it's not as fast as devoting a partition to it.

the ONLY restriction on what can be on which kind of partition, is the  
filesystem containing the kernel and initrd files. it must be on a  
physical partition (primary or non-primary, it doesn't matter) instead  
of an LVM or RAID-5 container.

in addition, on systems which boot from IDE drives, the filesystem  
containing the kernel and initrd files MUST be contained totally  
within the first 1024 cylinders of the disk, so that the BIOS disk  
services (which on most machines can't address cylinder numbers higher  
than 1023) can be used to load the kernel and initrd into memory in  
the first place. where your machine has a SATA drive, which linux sees  
as SCSI, the 1024-cylinder restriction doesn't apply to you.

all that matters for you is that IF you choose to use LVM, your "/ 
boot" directory must be on a physical partition- it cannot be within  
an LVM container.


> If User is using the Logical Volume Management Partitioning program  
> for installation of Partitions, can User put SWAP in the Logical  
> Volume Management Group as a Logical Volume rather than make it a  
> Primary Partition?

yes.


> I don't remember where I got the idea that Swap had to be a Primary  
> Partition but I have had that notion in my head for a few years.   
> John, during Install-Fest,  said  that SWAP could be either  a  
> Primary Partition, or a non-Primary Partition or could be a  
> Partition under the Logical Volume Management System.

correct. swap space can be anywhere, as long as the kernel is able to  
address it in a random-access fashion, as it can with a block device,  
or a file. if you're really a masochist, you can even use a USB stick  
as swap space... or set up a ramdisk and use that as swap space, but  
that kinda defeats the point of using swap in the first place...


- --------------------------------------------------------
| John M. Simpson  --  KG4ZOW  --  Programmer At Large |
| http://www.jms1.net/                 <jms1 at jms1.net> |
- --------------------------------------------------------
|   Hope for America  --  http://www.ronpaul2008.com/  |
- --------------------------------------------------------





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkgkxHsACgkQEB9RczMG/PukpwCgl2gYnrMZjRHeCFf5duR1J29k
EeQAoN65sM7RzPB8aBPu2IZlrwoqCBmw
=RmUF
-----END PGP SIGNATURE-----


More information about the Leaplist mailing list