≡ Menu

Linux: Boot a 2TB+ partition or Larger Array Using Grub

I've already written about creating a partition size larger than 2TB under Linux using GNU parted command with GPT. In this tutorial, I will provide instructions for booting to a flat 2TB or larger RAID array under Linux using the GRUB boot loader.

How to Boot a 2TB or Larger Array in Linux

Run fdisk -l to see disk drive geometry and note down heads, sectors and cylinders. If your device name is /dev/sda, enter:
# fdisk -l /dev/sda
Note down drive geometry from the output including heads, sectors, cylinders etc. Type the grub, enter:
# grub
At grub prompt type the following commands:
grub> geometry (hd0) <#cylinders><#heads><#sectors>
grub> root (hd0,0)
grub> setup (hd0)

Replace <#cylinders><#heads><#sectors> with actual values. /dev/sda is hd0 i.e. first scsi hard disk. command geometry can be used to print the information for the drive drive. In the grub shell, you can set the geometry of the drive arbitrarily. The number of cylinders, the number of heads, the number of sectors and the number of total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, respectively. If you omit TOTAL_SECTOR, then it will be calculated based on the C/H/S values automatically.

GRUB should update MBR and other information in order to boot your system. Before, you issue reboot command make sure grub.conf (menu.lst) has correct syntax.

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 3 comments… add one }

  • Egor December 8, 2008, 10:43 pm

    mate, this stuff totally does not work. the geometry command gives a negative number of total cylinders and error 22 during further installation.

  • Chris February 16, 2010, 11:47 am

    Does this even make sense? fdisk does not work with GPT drives, and indeed, a fair number of machine BIOS’es probably don’t work either, so booting might never be possible?

    For folks looking for an answer who happen to use 3ware RAID cards, these can be configured when you create your array to contain a small virtual drive at the start, then your massive terabytes drive afterwards – so you can use MBR on the smaller drive to boot from, and hopefully GPT on the huge one after. eg – here I use the ThreeWareCommandLineUtility (tw_cli) to create a 12gig disk (using v0=12) to put my boot/swap partitions on, and a 14TB one for the rest (/):-

    root@sysresccd /x/3w/packages/cli/linux/x86/tw_cli
    //sysresccd> show
    Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
    ------------------------------------------------------------------------
    c2    9550SXU-12ML 12        8        1       0       1       1      -
    //sysresccd> /c2 show
    Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
    ------------------------------------------------------------------------------
    u0    RAID-5    OK             -       -       256K    13038.4   ON     OFF
    Port   Status           Unit   Size        Blocks        Serial
    ---------------------------------------------------------------
    p0     OK               u0     1.82 TB     3907029168    9WM04TVH
    p1     OK               u0     1.82 TB     3907029168    9WM02YH3
    p2     OK               u0     1.82 TB     3907029168    9WM02WQ2
    p3     OK               u0     1.82 TB     3907029168    9WM04K1M
    p4     OK               u0     1.82 TB     3907029168    9WM04EKH
    p5     OK               u0     1.82 TB     3907029168    9WM067LK
    p6     OK               u0     1.82 TB     3907029168    9WM04GMQ
    p7     OK               u0     1.82 TB     3907029168    9WM03T26
    p8     NOT-PRESENT      -      -           -             -
    p9     NOT-PRESENT      -      -           -             -
    p10    NOT-PRESENT      -      -           -             -
    p11    NOT-PRESENT      -      -           -             -
    //sysresccd> /c2/u0 del
    Deleting /c2/u0 will cause the data on the unit to be permanently lost.
    Do you want to continue ? Y|N [N]: Y
    Deleting unit c2/u0 ...Done.
    //sysresccd> /c2 add type=raid5 disk=0-7 stripe=256K name=cnd14tb ignoreECC autoverify v0=12 storsave=perform
    Creating new unit on controller /c2 ... Done. The new unit is /c2/u0.
    Naming unit /c2/u0 to [cnd14tb] ... Done.
    Setting AutoVerify=ON for the new unit ... Done.
    Setting IgnoreECC=ON for the new unit ... Done.
    Setting Storsave policy to [perform] for the new unit ... Done.
    Warning: New unit /c2/u0 storsave policy is set to Performance which may
    cause data loss in the event of power failure.
    Setting default Command Queuing policy for unit /c2/u0 to [on] ... Done.
    Setting write cache = ON for the new unit ... Done.
    Warning: You do not have a battery backup unit for /c2/u0 and the enabled
    write cache (default) may cause data loss in the event of power failure.
    //sysresccd> /c2/u0 show all
    /c2/u0 status = INIT-PAUSED
    /c2/u0 is not rebuilding, its current state is INIT-PAUSED
    /c2/u0 is not verifying, its current state is INIT-PAUSED
    /c2/u0 is initializing with Percent Completion = 0%
    /c2/u0 Write Cache = on
    /c2/u0 volume(s) = 2
    /c2/u0 name = cnd14tb
    /c2/u0 serial number = 9WM04TVH000479002578
    /c2/u0 Ignore ECC policy = on
    /c2/u0 Auto Verify Policy = on
    /c2/u0 Storsave Policy = performance
    /c2/u0 Command Queuing Policy = on
    Unit     UnitType  Status         %RCmpl  %V/I/M  Port  Stripe  Size(GB)
    ------------------------------------------------------------------------
    u0       RAID-5    INIT-PAUSED    -       0%      -     256K    13038.4
    u0-0     DISK      OK             -       -       p0    -       1862.63
    u0-1     DISK      OK             -       -       p1    -       1862.63
    u0-2     DISK      OK             -       -       p2    -       1862.63
    u0-3     DISK      OK             -       -       p3    -       1862.63
    u0-4     DISK      OK             -       -       p4    -       1862.63
    u0-5     DISK      OK             -       -       p5    -       1862.63
    u0-6     DISK      OK             -       -       p6    -       1862.63
    u0-7     DISK      OK             -       -       p7    -       1862.63
    u0/v0    Volume    -              -       -       -     -       12
    u0/v1    Volume    -              -       -       -     -       13026.4
    //sysresccd>
    //sysresccd> quit
    root@sysresccd /x/3w/packages/cli/linux/x86 % fdisk -l
    Disk /dev/sda: 12.9 GB, 12884901888 bytes
    255 heads, 63 sectors/track, 1566 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000
    Disk /dev/sda doesn't contain a valid partition table
    Disk /dev/sdb: 13987.0 GB, 13987037052928 bytes
    255 heads, 63 sectors/track, 1700493 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000
    Disk /dev/sdb doesn't contain a valid partition table
    root@sysresccd /x/3w/packages/cli/linux/x86 %
    
  • rtt May 29, 2010, 8:07 am

    Unfortunately I don’t see how this helps, I’ve tried it. What I ended up doing is making my own grub boot disc. I used the latest Debian unstable grub .97 diff/patch on top of the original .97 GNU Grub. You really need a patched grub to write the MBR on a 2TB+ hard drive. Remember that .97 GRUB does NOT work with GPT EFI partitions either (and I personally don’t like them anyway). I believe Grub 2 uses it, but most distros are still using their own form of patched .97.

    Personally I blame GRUB, they should be making new releases so the distros can all use a standardized GRUB, instead of patching it for peculiar things with EXT3 etc…

Leave a Comment