Results 1 to 10 of 11

Thread: New 12.04 install using Advance Format Drive and LVM

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    UK
    Beans
    133
    Distro
    Ubuntu 14.04 Trusty Tahr

    New 12.04 install using Advance Format Drive and LVM

    I cannot seem to find a way through to successfully installing 12.04 onto a 2TB Western Digital Advance Format drive. Using LVM. From the Alternate Install DVD.

    This is to set up a home server. I am going to be adding more drives after completing the basic build.

    There are various threads on the topic but those I found generally end up discussing the merits of either LVM or WD.

    Going through a Normal Install (choosing LVM and allocate 30GB) I end up with a misaligned extended partition and a warning to this effect showing up on the DiskUtility (palimset).

    I have tried realigning using fdisk but this always results in a broken system and a complete rebuild.

    How do I either a) avoid this situation during the install or b) correct the alignment, whilst retaining my WD drive and LVM?

  2. #2
    Join Date
    Mar 2008
    Location
    UK
    Beans
    133
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: New 12.04 install using Advance Format Drive and LVM

    Tried again using a default install and no LVM. Using entire disk. In this case the boot partition was aligned correctly, started at 2048, but the extended partition containing swap was misaligned.

  3. #3
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: New 12.04 install using Advance Format Drive and LVM

    You can try simply creating the partitions in advance with parted. parted is very precise when creating partitions and can work with many different units like sectors, MiB, GiB, etc. I usually start of with MiB to align the first partitions starting at 2048 sectors (1MiB). But note that some 4k disks might have different sector size. parted can also show you the logical and physical sector size.

    Separate /boot partition is no longer needed for LVM but I think it might help having it. So, to create a /boot partition of 500MiB with parted you would do something like (also starting with new blank gpt table if you don't use dual boot).
    Code:
    sudo parted /dev/sda
    mklabel gpt
    unit MiB
    mkpart GRUB 1 2
    set 1 bios_grub on
    mkpart BOOT 2 502
    quit
    That will create 1MiB bios_grub partition which you need for grub2 if you use gpt table, and 500MiB partition that you will use as ext4 /boot during the install. If you want you can continue creating partitions while the unit is still MiB, so to create a 100GiB partition marked as lvm you would do like:
    Code:
    mkpart LVM1 502 102902
    set 3 lvm on
    The above assumes the partition is #3 and it will set the lvm flag on it so that it can be used as physical device for LVM later easily.

    EDIT NOTE: If you decide to go with gpt and bios_grub partition, DO NOT format it as any filesystem. it should have NO filesystem. Just create it with parted, set the bios_grub flag and that's it. The installer will use it while installing grub2 to the MBR.

    EDIT PPS: Most 4k disks have logical sector size of 512B for compatibility reason, but 4096B physical sector size so that more capacity can fit on the plates. The disk electronics usually handles the logic of the difference between the logical and physical sector size, so to the machine the hdd looks exactly like the older 512B disks. But in some cases the logical sector size can be 4096B too, so be careful if working with sectors. That's why I prefer MiB in parted because MiB is a MiB regardless of sector size.

    If you have any questions, ask. You can see details about the disk and the sector size and total number of sectors with:
    sudo parted /dev/sda print
    Last edited by darkod; January 25th, 2013 at 11:44 AM.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  4. #4
    Join Date
    Mar 2008
    Location
    UK
    Beans
    133
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: New 12.04 install using Advance Format Drive and LVM

    darkod. Thanks for the reply. After doing the normal install wihout LVM and still finding the partitions mis-aligned I managed succesfully to use Parted to realign and the system even rebooted afterwards. However I want to use LVM so your approach is better for me. However I am more a user than a system expert and there is material in your reply regarding gpt I need to understand better before jumping in. So I am going to review for a couple of hours and then will let you know how I get on.

  5. #5
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: New 12.04 install using Advance Format Drive and LVM

    GPT is a type of partition table that is used with larger disks, because the older more common type of MSDOS (MBR) table has a 2.2TB limitation. In your case, for a 2TB disk msdos table would still do the job, but if using only linux on the machine you might as well use gpt because it has some benefits (I haven't gone into details exactly which ones).

    When using the parted mkpart command, depending if the table is msdos or gpt, the syntax is different. For msdos partition you specify the type as primary or logical, and for gpt partition you only specify a label (it has to have it). With gpt there is no 4 primary partition limit (all partitions are considered as primary and you have many of them), so when you create it with mkpart you specify a label instead of primary/logical. So, the syntax for msdos or gpt partition is:
    Code:
    mkpart <primary/logical> <start> <end>
    mkpart <label> <start> <end>
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  6. #6
    Join Date
    Mar 2008
    Location
    UK
    Beans
    133
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: New 12.04 install using Advance Format Drive and LVM

    Thanks. Your GPT info answered a question I was just about to ask re the format of the mkpart command.

    In your example you set /boot to just 500Mb. I guess it can be made larger later but am interested in why not the 10-20Gb I would have expected. Presumbably you have /home on another partition? The reason for asking is that the partition selection options during the install really are not intuitive.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •