I wanted to create a full-disk partition, with optimal alignment, on a 4TB disk under CentOS 6.4 and use it as an LVM PV.

fdisk doesn’t work on disks larger than 2TB so I used parted:

parted -a optimal /dev/sda
(parted) mklabel
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
(parted) mkpart primary ext2 0% 100%
(parted) set 1 lvm on

3 thoughts on “Creating an optimally-aligned full-disk partition with parted

  1. Bunch of nope…
    parted /dev/sdh
    (parted) mklabel                                                          
    New disk label type? gpt                                                  
    Warning: The existing disk label on /dev/sdh will be destroyed and all data on this disk will be lost. Do you
    want to continue?
    Yes/No? yes
    (parted) mkpart primary ext4 0% 100% << as the folks in this thread suggested

    mkfs.ext4 /dev/sdh1
    /dev/sdh1 alignment is offset by 512 bytes.
    This may result in very poor performance, (re)-partitioning suggested.

    ………..so much for the examples given.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required

This site uses Akismet to reduce spam. Learn how your comment data is processed.