Traditional MBR(MSDOS) disk label has limitation of 2^32 (2TiB) in capacity and 15 in partition numbers(including logical partitions), while GUID Partition Table (GPT) supports 2^64 KiB (2 ZiB) and 128 partitions by default.
In Linux, fdisk doesn’t support GPT, parted is the common built-in tool for GPT.
#mpathb is the disk name is in FC SAN with multipath enabled in my test env>parted /dev/mapper/mpathb(parted) mklabel gpt(parted) mkpart primary ext4 1024kb 2tbWarning: The resulting partition is not properly aligned for best performance.Ignore/Cancel?#This warning indicates the start position of the partition may not aligned with physical sector of the #hard disk. It is very important for harddisk of hardware raid, the start position must be n*stripe size.#see also: http://honglus.blogspot.com.au/2009/08/align-partitions-on-stripe-boundary-for.html#It may also hold true for single hard disk, because even a single harddisk has sector size of 2K,4K #nowadays .#To fix the issue, just change the unit from SI to IEC 60027-2 standard# k- stands for kilo, meaning 1,000 in Metric(SI) Prefix# ki- stands for kilobinary ("kibi-"), meaning 1,024 in IEC 60027-2 standard(parted) help unitunit UNIT set the default unit to UNITUNIT is one of: s, B, kB, MB, GB, TB, compact, cyl, chs, %, kiB, MiB, GiB, TiB(parted) mkpart primary ext4 1024KiB 8TiB#the values are accepted without any warning(parted) print..Number Start End Size File system Name Flags1 1049kB 8796GB 8796GB primary#1049KB is shown, because the default unit is KB, we change it to KiB(parted) unit KiB(parted) print..Number Start End Size File system Name Flags1 1024kiB 8589934592kiB 8589933568kiB primary#set LVM flag#GPT has reserved GUID for different partitions e.g LVM= E6D6D379-F507-44C2-A23C-238F2A3DF928#(parted) set 1 lvm on(parted) pModel: Linux device-mapper (multipath) (dm)Disk /dev/mapper/mpathb: 19527106560kiBSector size (logical/physical): 512B/512BPartition Table: gptNumber Start End Size File system Name Flags1 1024kiB 8589934592kiB 8589933568kiB primary lvm#create LVM physical volume as usual.>pvcreate /dev/mapper/mpathb1
"(parted) mkpart primary ext4 1024KiB 8TiB
ReplyDelete#the values are accepted without any warning"
Yes, but is the partition properly aligned?
1024KiB offset is safe, the common stripe size of RAID is 64KiB~512KiB
ReplyDeletemore info
http://honglus.blogspot.com.au/2009/08/align-partitions-on-stripe-boundary-for.html
I have fired 'print' command on parted prompt it throws below error.
ReplyDelete"Error: msdos labels do not support devices that have more than 4294967295 sectors."
As the message explains, you are using "msdos" or MBR-style partitioning on a device that isn't supported by that partitioning model. You must first set up that device as gpt with "mklabel gpt". Please note that this operation will destroy all partitions currently existing in that HDD. Some external HDDs are still formatted with MBR but have some weird hack that enables them to show 3TB partitions, even though this is by definition impossible. These HDDs should be repartitioned as GPT then formatted before storing any data on them!
Delete