6

I have two hard drives of different physical sector size. I would like to create an LVM volume group with them, however, when I do so with vgcreate, I get a warning telling me that the two disks have different physical sector size. Is there something to be concerned about?

Adel M.
  • 316
  • 2
  • 9
  • Most probably nothing to worry about, but I didn't know that disks still expose sector sizes. Can you add the precise command and error to the question? Also the precise commands for creating the physical volumes. – berndbausch Jul 19 '21 at 04:24
  • Some old drives support only 512byte sectors, some modern drives support 512byte sectors native, most modern drives support 4096byte sectors native and have an emulation layer for 512byte sized sectors and some newer drives just support 4096byte sized sectors. You can mix drives with different sector size if your newer drives are able to emulate the older sector size. When doing so it's important that you format the volumes always with 512byte sector size. – paladin Jul 19 '21 at 15:59

1 Answers1

6

You don't want to mix different sector sizes in a single VG. Newer versions of LVM don't even allow creating VG on PVs with mixed sector sizes by default (older versions show only the warning message you saw). The problem is not with the VG, but with the LVs and filesystems -- if you resize or move LV to the larger sector size PV the filesystem can get corrupted.

You can create the VG, but you need to make sure your LVs are allocated only on PVs with same sector size and remember to keep this setup in the future (you can specify which PV will be used with lvcreate), but I recommend creating two separate VGs. If one of your disks is 512 sectors NVMe you might be also able to switch it to 4096 sectors using nvme-cli (or vice versa to make both disks same sector size).

Few related links

Vojtech Trefny
  • 16,922
  • 6
  • 24
  • 48