Monday, April 29, 2024
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 28859  / 1 Year ago, thu, january 26, 2023, 10:49:00

I was following this tutorial found here: How to set up multiple hard drives as one volume?



Which was working out great however i have a 3TB drive and every time i create the partition (whether it be via fdisk or gparted), after i start creating the volumes in LVM, my partition is re-sized to 2TB and the partition table becomes msdos which doesn't allow me to create any more partitions or to extend the current partition.



Is there a way that i can get a 3TB drive working with LVM?



Thanks,
Adam


More From » partitioning

 Answers
4

It seems that by creating a partition to use as a physical volume in LVM, we're limited to a 2TB volume size. This is due to the limitations in the legacy MSDOS partition table system managed by fdisk and why one should use GPT.



Fortunately, LVM also understands plain devices without a partition table. This has the drawback that you'll have to use the whole device as physical volume, but that's exactly what I want to achieve.



To erase the current partition table execute the following command (Warning: this effectively erases all contents on the disk!):



sudo dd if=/dev/zero of=PhysicalVolume bs=512 count=1


replacing PhysicalVolume with your device path, e.g. /dev/sdb. Then run



sudo partprobe


to let the kernel re-read the new now non-existing partition table.



Now actually format it as an LVM physical volume:



sudo pvcreate PhysicalVolume


(again, replace PhysicalVolume with your device path)



This is based on the information mentioned in the manpage of pvcreate:



DESCRIPTION
pvcreate initializes PhysicalVolume for later use by the Logical Volume
Manager (LVM). Each PhysicalVolume can be a disk partition, whole
disk, meta device, or loopback file. For DOS disk partitions, the
partition id should be set to 0x8e using fdisk(8), cfdisk(8), or a
equivalent. For whole disk devices only the partition table must be
erased, which will effectively destroy all data on that disk. This can
be done by zeroing the first sector with:

dd if=/dev/zero of=PhysicalVolume bs=512 count=1

[#31993] Saturday, January 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edgehogight

Total Points: 272
Total Questions: 113
Total Answers: 99

Location: Northern Mariana Islands
Member since Sun, Jul 19, 2020
4 Years ago
edgehogight questions
Sat, Sep 11, 21, 22:09, 3 Years ago
Sat, Nov 6, 21, 19:48, 3 Years ago
Fri, Aug 26, 22, 09:37, 2 Years ago
;