partitioning LVM

Texts about partitioning with LVM are quite technical.However I should like to find a text explaining me how to manually make LVM-partitions in OpenSuSE. Like which ones, how big, how to do it.

I made an auto LVM with /home. Problem is my entire disk is not used (/root was 5GB max /home was only 7GB max on sda2)and I was not able to make the partitions the seize I wanted.
I have now sda1 configured as /home 280GB and sda2 with the proposed partitioning of Yast. So only 5,9 GB for root.
It looks like my try-out is working fine, however.

Help needed here. Using normal partitioning is not a good option on my PC. He shows lots of black screens. With LVM no problem at all.

This being your first post, I have the honour to welcome you to these forums.

Sorry, but I can not quite understand what you have now from your description. You are only talking about partitions like sda1, sda2, which is not LVM at all.

May be it would help when you told us what the computer thinks about it. Please the output of:

cat /etc/fstab

and

mount

and

fdisk -l

and

lvscan

Here is the demanded output. TNX for helping. I just used the LVM proposed by Yast.

Wachtwoord:
linux-9whu:/home/toran # cat /etc/fstab
/dev/system/swap swap swap defaults 0 0
/dev/system/root / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-Hitachi_HDT725032VLA380_VFA200R2CPB6YA-part1 /boot ext4 acl,user_xattr 1 2
/dev/disk/by-id/ata-Hitachi_HDT725032VLA380_VFA200R2CPB6YA-part3 /home ext4 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
linux-9whu:/home/toran #

linux-9whu:/home/toran # mount
/dev/mapper/system-root on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /boot type ext4 (rw,acl,user_xattr)
/dev/sda3 on /home type ext4 (rw,acl,user_xattr)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
linux-9whu:/home/toran #

Schijf /dev/dm-0 bevat geen geldige partitietabel means disk /dev/dm-0 contains no valid partition table

linux-9whu:/home/toran # fdisk -l

Schijf /dev/sda: 320.1 GB, 320072933376 bytes
255 koppen, 63 sectoren/spoor, 38913 cilinders
Eenheid = cilinders van 16065 * 512 = 8225280 bytes

Schijf-ID: 0x0009b78d

Apparaat Opstart Begin Einde Blokken ID Systeem
/dev/sda1 * 1 9 72261 83 Linux
/dev/sda2 10 1966 15719602+ 8e Linux LVM
/dev/sda3 1967 38913 296776777+ 83 Linux

Schijf /dev/dm-0: 13.9 GB, 13946060800 bytes
255 koppen, 63 sectoren/spoor, 1695 cilinders
Eenheid = cilinders van 16065 * 512 = 8225280 bytes

Schijf-ID: 0x00000000

Schijf /dev/dm-0 bevat geen geldige partitietabel

Schijf /dev/dm-1: 2147 MB, 2147483648 bytes
255 koppen, 63 sectoren/spoor, 261 cilinders
Eenheid = cilinders van 16065 * 512 = 8225280 bytes

Schijf-ID: 0x00000000

Schijf /dev/dm-1 bevat geen geldige partitietabel
linux-9whu:/home/toran #

linux-9whu:/home/toran # lvscan
ACTIVE ‘/dev/system/root’ [12,99 GB] inherit
ACTIVE ‘/dev/system/swap’ [2,00 GB] inherit
linux-9whu:/home/toran #

Hi, Henk. You speak Dutch? As you have a Dutch name… In dat geval, ik ook!

Ja, ik spreek nederlands, maar om anderen mee te laten genieten :wink: proberen we het toch maar in het engels.

First a request: can you please put your computer output between CODE tags (select the text and click the # button in the bar above). Then the lay-out is preserved and the different columns are saved. Thus not:
boven:~ # \fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1549f232

Device Boot Start End Blocks Id System
/dev/sda1 1 262 2104483+ 82 Linux swap / Solaris
/dev/sda2 263 2873 20972857+ 83 Linux
/dev/sda3 2874 15000 97410127+ 83 Linux
/dev/sda4 * 15001 38913 192081172+ f W95 Ext’d (LBA)
/dev/sda5 15001 17611 20972826 83 Linux
boven:~ #
but

boven:~ # \fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1549f232

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2             263        2873    20972857+  83  Linux
/dev/sda3            2874       15000    97410127+  83  Linux
/dev/sda4   *       15001       38913   192081172+   f  W95 Ext'd (LBA)
/dev/sda5           15001       17611    20972826   83  Linux
boven:~ #

Then back to your problem. I am not using LVM on Linux myself (last time did it was on HP-UX), but I asked for the obvious information from the system. What I see is:

LVM is used for Swap and root partition.
LVM is not used for /boot and /home partition.
How is this compared to you saying: “I made an auto LVM with /home”?

Maybe it is better first to go back to the point where you decided to use LVM. What were the reasons that you wanted to use LVM instead of plain partitions? What was your idea of how to use your diskspace?

And to gather more LVM information (I hope this works, because I only ask these because I tried to read the man pages):

l /dev/system/root /dev/mapper/system-root /dev/dm-0

and

lvdisplay /dev/system/root /dev/system/swap

and

vgdisplay

After inserting the DVD/CD continue to Suggested Partitioning.
Choose LVM Based.
You can accept the partition table proposed by Yast, but this is only good for a try-out.
So we will go for a manual partitioning, without trying the auto Yast partitioning.
As an example I use a 297 GB HD with 4 GB physical memory.

So, at Suggested Partitioning, choose LVM Based.Do not encrypt, unless you really need encryption.
Go to Partition Setup.
Go to Custom Partitioning (experts only).

In the Expert Partitioner, choose Hard Disks (left column).
Add Partition.
Create a primary /boot partition and format it with ext4 (or your prefered File System). I will continue using ext4.
The boot Partition should not be bigger than 100 MB.
Here Grub is installed to boot the system.
Installing Grub in the MBR (as we usually do), can rersult in an unbootable system with LVM as Grub2 seems not capable booting LVM2.
The boot partition will probably show as sda1 in Hard Disks.

Now, again in Expert Partitioner - Hard Disk, create a second primary partition.Do not create a logical partition.You won’t be able to edit.I know, it’s weird. We are always told to create only one primary, but here you have to break the rule.
Do NOT format this partition, but select it as Linux LVM in the drop-down menu.
As size for this partition, choose rest of disk.In my case 258 GB.
This partition will be shown as sda2.

Now look in the left column for Volume Managment (Expert Partitioner).
Click on Add… and select Volume Group.
The Volume Group needs a name, any name you like.
Fill in the name, and click on the middle arrow to transfer the Volume Group to Selected Physical Volumes.

The Volume Group is now a Physical Volume in which you can create partitions.
So, in Volume Managment,select the LVM partition.Click Add…Logical Volume.

Fill in the name of the Logical Volume (anything you like, but keep it simple, like usr for the usr partition).
Format as ext4 (or other)and select the mount point (/usr for the usr partition).

Repeat this procedure for all desired logical volumes.
You need a root and swap volume, and by preference also a home volume.

I made;

30 GB /
2 GB swap
500 MB /tmp
5 GB /usr (which is 65% full with 1 usr and root)
1,95 /var
258 GB /home

For swap it is said to use 2 to 3 times the physical memory.
At this day, Linux does not use more than 4 GB of memory.
So if you have a PC with 4GB memory, you can make a swap of 1 MB.
If you have 2 GB of memory, go for a minimum of 2 GB swap.
With 1 GB memory, go for 3 GB swap, but not more.
To much swap will slow your PC down.

Once you are happy with your partition table, click on Install…
People who have Black Screens with clasic partitioning, will probably have no more trouble with LVM!

Toran Korshnah

Hi,

I have to admit I did partition in a wrong way.
I found clear explanation at a concurrent distro and adapted the advise to Yast.
I posted the solution at the Unreviewed HOW TO.

Yes, I tried it on my PC. Works now like charm.

Toran

Thanks for sharing your experience ToranK. I have a few questions/issues with your recommendations.

Why would you separate out /var, /usr and /tmp? Why not just put that space under root (/) and let the various directories use space as it is needed?

I think 1/2 a gig is too small for /tmp. My /tmp right now contains 880 directories, 4500 files and 5Gb of data. And when I burn DVDs that usage doubles temporarily. Better IMO to put /tmp under root (/).

And just for interest of the readers, can you explain what benefits there are in having LVM. I personally don’t like it and don’t see an advantage with a single hard disk. (But that’s just my personal opinion).

People who have Black Screens with clasic partitioning, will probably have no more trouble with LVM!

I don’t understand this bit, can you explain why please?

Sorry to keep spotting things that puzzle me:

To much swap will slow your PC down.

I know that too much swap is a waste of space, but I didn’t know it slows down a computer, why/how does that happen?

Part of the above was posted as a Howto. As the questions of Swerdna went unanwsered and the mods are afraid that he Howto leads to the use of LVM where not required, the Howto was moved to this original thread.

It is not only the use of LVM in a situation that not calls for it at all, but also the suggested partitioning that may lead to misconceptions to the uninitiated.

Rather then removing alll traces of the intended Howto, the mods prefer to save all posts so that everybody can decide for her/himself.