Operating System - Linux
1828360 Members
3628 Online
109976 Solutions
New Discussion

LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

 
Alzhy
Honored Contributor

LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

Is there a need to partition a disk if the entire disk is to be used anyways? Practically all the docus ad WPs I have seen seem to show to partition the disk to the whole capacity but I can't seem to understand why.

i.e.: if I have a disk /dev/sdda, I always use the enire disk /dev/sdda as an LVM PV or an ASM disk. Most recipes out there I have seen seem to partition the disk to /dev/sdda1 to encompass the whole disk...

TIA

Hakuna Matata.
4 REPLIES 4
Alzhy
Honored Contributor

Re: LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

Aside from FDISK complaining the disk not having a Partition Table -- is there a reason WHY I should partition disks before feeding them to LVM or ASM?

Hakuna Matata.
Tim Nelson
Honored Contributor

Re: LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

Just ran into this today.

I am curious also.

It adds to my confusion when creating nice- names in the /etc/multipath config...

In an older Oracle cluster installation using ASM we did not partition the disks, simply provided the raw device path, e.g. /dev/mapper/nice-name

Matti_Kurkela
Honored Contributor

Re: LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

The Linux system does not *need* the partition table on a data disk for anything. The LVM PV header is just as good for the kernel for identifying the disk layout.

On the system disk of a typical x86 system, it would theoretically be possible to build a MBR bootloader that could boot the system from an all-LVM disk, but so far nobody seems to have done that. The common bootloaders (GRUB, SYSLINUX and LILO) all seem to expect that the system disk has a standard partition table and that at least /boot is a traditional PC partition.

But in a multi-OS environment, it might be sensible to set up the whole-disk-encompassing partition anyway. If e.g. a storage administrator makes a mistake and allows a Linux data LUN to be presented to a non-Linux OS, there is a risk of data corruption.

A Linux LUN that is initialized as a LVM PV with no traditional partitioning is indistinguishable from a disk that has been overwritten with random data for e.g. most versions of Windows.

Adding the partition table makes the disk identifiable as *being already used for something*, even if the filesystem and partition type is unknown to the OS trying to identify the disk.

MK
MK
Tim Nelson
Honored Contributor

Re: LVM/ASM/etc. - Need for Partitioning Disks that will be Used Wholly?

Matti,
I think the biggest benefit is as you stated

"Adding the partition table makes the disk identifiable as *being already used for something*, even if the filesystem and partition type is unknown to the OS trying to identify the disk"

Also, I am sure everyone else knew this but thought I would share.

fdisk /dev/mapper/my-nice-name
does not create the partition like /dev/mapper/my-nice-namep1

kpartx -av /dev/mapper/my-nice-name
does...

now you are ready to..
oracleasm createdisk MY_DATA1 /dev/mapper/my-nice-namep1
(if you do not use the partition device file ASM writes over the top of the new partion and negates what was just done.