Most documentations about LVM have roughly these steps:fdisk /dev/sdbpvcreate /dev/sdb1vgcreate fileserver /dev/sdb1lvcreate --name share --size 40G fileservermkfs.ext4 /dev/fileserver/shareIn some documentations I have seen as well that they did another fdisk between lvcreate and mkfs. And in another documentation I have seen that they left the first fdisk away as well. I tested now on one of my machines where I didn't do any fdisk at all and it works.My question is now is the fdisk needed at all on secondary (non boot) hard-disks? And why? And does the fdisk between lvcreate and mkfs give any advantage?
Is fdisk needed with lvm?
lvm;fdisk
You do not need to create a partition table on a disk (neither the traditional kind created with fdisk nor the GPT kind created with, e.g. gdisk), you could make the whole block device into an LVM PV if you wanted to. However, other tools or other operating systems might accidentally mistake that device for an unformatted hard disk and offer to format it, so it can be error-prone. Basically there is hardly any downside to creating a partition table with one big partition on it occupying the whole disk and it's a bit safer, so why not do it.If the disk is intended to be bootable then you will definitely require a partition table.As for creating an inner partition table on an LVM LV, that is unnecessary and very unusual. It is not expected that you would do this. The only exception would be if the LVM is expected to be presented to a virtual machine as a raw block device. In that case, the VM might expect to put a partition table on it.