0

I learnt yesterday that I could pvcreate directly on /dev/sdb instead of /dev/sdb1. I thought that you could only pvcreate on a existing partition. Doing it on a partition adds a level and operations so what are the benefits of creating a partition before doing pvcreate?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Pozinux
  • 1,305
  • 5
  • 16
  • 27
  • 1
    Related question: *[Uses of single-partition disk configuration](https://superuser.com/q/1181320/432690)*. – Kamil Maciorowski Jun 28 '17 at 08:11
  • 2
    Actually there's another reason, and simply rephrasing this answer isn't useful to anyone. Directly creating the partition interferes with resizing the volumes. – Thomas Dickey Jun 28 '17 at 08:14

1 Answers1

3

There are two reasons to do so.

  1. If the partition does not allocate 100% of the space of the device, this allows you to assign only a part of the device to LVM, hence leaving the rest of the device available for other uses.

  2. In the case of a partition allocating all the device space, the reason is that if the disk is accessed by other non-Linux OSes, they might not recognize LVM and see the unpartitioned disk as a clean slate. Making a partition on it signals that the disk is being used for something.

dr_
  • 28,763
  • 21
  • 89
  • 133