Partition in Red Hat

Hello

I am installing RED Hat linux on my machine
and want to create partition mounted on /boot , / ,/var, /var/log,/opt , /export/home and /tmp.

Do i need to force any of the mounted partition to be primary as i know if it is not created as a primary partition it is created as a logical partition
This option appears in the installation gui when installing

I don't think it really matters these days.

1 Like

Hello,

You need two partitions, a 512 MiB - 1 GiB /boot and the rest in an LVM physical volume. Keep all mount points in logical volumes for flexibility.

On creating two partitions, both should be primary, if that is important for you.

In case you have 2.2+ TiB disk, installer might take to GPT and there are 128 partitions (nothing primary, though).

You can have all partitions to lie in logical partitions, in case you are dual booting.

If you are still unsure, why not fire up a virtual machine and see how it goes?

Nandan

I would suggest keeping / reasonably small and try not to use it for anything other than the core OS, splitting off /usr (biggest on install) along with /tmp, /var and create an area for home directories preferably on another disk in another volume group.

What size disk are you starting with?

Robin

Linux can't be booted from an LVM partition, so if / is an LVM partition /boot needs to be on a separate partition.

I have installed Red hat Linux 5.11 with all the necessary patches needed but I have one questions
The partitions and disk space is not right e.g when using df �k
I get this

Filesystem                                                                          1K-Blocks                             Used                                                     Available                Use               Mounted on
/dev/mapper/VolGroup00-LogVol00                      617377040                           3332196                                                582177964                1%                          /
/dev/sda1                                                                           101086                                  17808                                                    78059                    19%                        /boot
Tmpfs                                                                                   8148028                                0                                                              8148028                0%                          /dev/shm

I want to create other partitions with disk space such as
/var 160000MB
/tmp 4000MB
/opt 40000 - 200000MB
/usr 4000 MB
Now I know I can use the fdisk command but also there is a LVM (which I have never used before )

Having looked at previous disk partition on other Red Hat Servers
There is something like this and also would like something similar

/dev/mapper/vg-sys-optvol 43 GB

dev/mapper/vg-sys-varvol 2GB

dev/mapper/vg-sys-tmpvol 2GB

dev/mapper/vg-sys-varlogvol 2GB

Please can you advise and assist on this

Hi, DOkuwa

Please, do not get confused between partitions and lvm volume management. Both are independent of each other.
LVM is an abstraction layer that works with disk blocks. These disk blocks can be full disk (unpartitioned) or part of a disk (partitions)
/boot can not reside inside a LVM for your operating system, thus it must be in a partition (using fdisk or parted)
The rest of the disk can be part of an LVM.
LVM involves three layers. PV (Physical Volume), VG (Volume Group), and finally LV (Logical Volume)

Let's do an example with a 500GiB hard drive
Use fdisk to do two partitions one for /boot (500MiB) and one for the rest of the system.
Now you have two partitions dividing your disk

/dev/sda1
/dev/sda2

/dev/sda2 you use it for the LVM

First, the PV:

pvcreate /dev/sda2

This prepares the partition to be part of LVM

Second, the VG:

vgcreate  vg-sys /dev/sda2

This creates a volume named vg-sys ready to be carved with logical volumes

Third, the LV:

lvcreate -L 500M vg-sys -n swapvol
lvcreate -L 100G vg-sys -n rootvol
lvcreate -L 43G vg-sys  -n optvol
lvcreate -L 2G vg-sys -n varvol
lvcreate -L 2G vg-sys -n tmpvol
lvcreate -L 2G vg-sys -n varlogvol 

These will carve six logical volumes out the volume group vg-sys , they are named with the -n flag

thanks