1753846 Members
8388 Online
108807 Solutions
New Discussion юеВ

LVM versus FDISK

 
SOLVED
Go to solution
Yaboto
Super Advisor

LVM versus FDISK


Can somebody help me compare LVM with FDISK ?

I am using RHEL5 and I would be creating mount points or partitions to hold Oracle Databases and Oracle applications.

Please give me advantage/disadvantage, strengh/weakness of FDISK and LVM.


Regards,
7 REPLIES 7
Michal Kapalka (mikap)
Honored Contributor

Re: LVM versus FDISK

hi,

use LVM.

mikap
Matti_Kurkela
Honored Contributor
Solution

Re: LVM versus FDISK

The standard x86 PC partition table (=what you'll be creating with FDISK) has a hard maximum limit of 2 TB. If your disk or RAID set is larger than that, you need to use something else, like LVM or Itanium-style GPT partitioning. Disks of 1 TB capacity already exist; within three years or so, I think the 2 TB limit will be a major annoyance (even more than it already is).

In a 32-bit Linux OS, LVM can handle 16 TB; but if you use a 64-bit version of Linux (as you usually should with modern hardware), the limit is 8 Exabytes, i.e. effectively unlimited for most purposes.

Unless you create a custom boot loader, FDISK partitioning is still required on x86 system disk. As far as I know, there is no bootloader yet that could boot from a LVM-only disk.

LVM allows a Logical Volume to span multiple physical disks/RAID sets. If you run out of space on your current disk, just add a new disk to the system, use it to extend the volume group that needs more space, and add the necessary space to your logical volume. If you need to move your data to new disks and remove the old ones, you can use pvmove or LVM-level mirroring to migrate the data to the new disks. All this can be done while filesystems are mounted and applications are running.

With FDISK, you can extend an existing partition only if there is free space on the disk immediately after the partition. So extending any partitions other than the last one on the disk will require moving partitions around, which cannot be done while the partition is mounted.

FDISK-created Linux partitions are identifiable to other operating systems as "there is already a partition of some unknown type". If you use pvcreate to initialize the entire disk for LVM ("pvcreate /dev/sda"), other operating systems may not recognize that the disk is already in use.

This may be an issue with SAN storage, when there is a possibility that your LUNs may be accidentally presented to another system if the SAN admin makes a mistake. In such an environment, it may be useful to create a simple FDISK partition that covers the whole LUN, and then use it with LVM ("pvcreate /dev/sda1"). This way the admin of the other system can easily notice that the LUN is already in use and ask the SAN admin to double-check.

In short, I would always use LVM on data disks unless there is a specific reason *not* to do it.

MK
MK
Viktor Balogh
Honored Contributor

Re: LVM versus FDISK

>As far as I know, there is no bootloader yet that could boot from a LVM-only disk.

grub2 has LVM support, but I didn't tested it yet
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: LVM versus FDISK

shalompeace: always choose a volume manager like LVM or VxVM over fdisk. That's so simple. (LVM is easier to manage than VxVM)
****
Unix operates with beer.
Steven E. Protter
Exalted Contributor

Re: LVM versus FDISK

Shalom,

Even to use lvm, you sometimes need to use fdisk first.

In general, I use lvm for everything possible. If I add a new disk, I will use fdisk to prepare it and mark the disk as 8E a Linux partition. This is useful in telling contractors and temporary systems administrators, "Yo, its LVM, use lvm!!!!"

LVM should be used wherever possible, because you can resize file systems or logical volumes on the fly, without a complete reconfiguration of the system or complex dd commands.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: LVM versus FDISK

>If your disk or RAID set is larger than >2T, you need to use something else, like >LVM

but before use LVM I have to create physical partition first, isn't it?

(sorry for hijacking thead)
Yaboto
Super Advisor

Re: LVM versus FDISK

Thank you for your contributions !