You are not logged in.

#1 2015-11-03 18:04:04

lsas
Member
Registered: 2010-11-23
Posts: 23

BIOS/GPT and RAID1

Hello everyone.

Here my scenario: I've a HP Microserver G8 with 2 3TB Sata Drive.
Unfortunately the Microserver dont have UEFI but the old BIOS.
After some search i've understood that it's possible to create a mixed BIOS/GPT partitioning scheme.
So i'd like to create a RAID1 BIOS/GPT on the two drives.

I've already read the archwiki but now i'm a bit confused on how to manage the RAID partition, it's my first expirience with it.

I've created created 4 partition on the first disk following the archwiki guide:
/dev/sda1    1M  Bios boot
/dev/sda2  512M  EFI System
/dev/sda3   50G  Linux filesystem
/dev/sda4  2.7T  Linux filesystem

The goal is to use sda3 as Archlinux root, and sda4 as data storage partition
Now i cant understand how to procede with RAID, should i change partition type to FD00 only for sda3 and sda4?



I think i'm missing something..

Could you help me to understand?

Offline

#2 2015-11-03 18:46:30

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: BIOS/GPT and RAID1

There is no "EFI System" if your mainboard does not support UEFI. It's a regular /boot partition. You should also set the boot flag for the MBR, as some BIOS only machines require it.

With parted it looks like thus:

(parted) mklabel gpt                                                      
(parted) disk_set pmbr_boot on                                            
(parted) mkpart grub 64s 2047s
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore                                                     
(parted) set 1 bios_grub on                                               
(parted) unit mib
(parted) mkpart boot 1 512                                                
(parted) mkpart swap 512 1024
(parted) mkpart root 1024 100%
(parted) print free
Model: Loopback device (loopback)
Disk /dev/loop0: 10240MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start     End       Size     File system  Name  Flags
        0.02MiB   0.03MiB   0.01MiB  Free Space
 1      0.03MiB   1.00MiB   0.97MiB               grub  bios_grub
 2      1.00MiB   512MiB    511MiB                boot
 3      512MiB    1024MiB   512MiB                swap
 4      1024MiB   10239MiB  9215MiB               root
        10239MiB  10240MiB  0.98MiB  Free Space

Then you can proceed to create RAID partitions and filesystems. If you want to support stupid bootloaders, use 1.0 metadata and ext2 for the boot partition.

Partition type fd00 is not required. (It would be for 0.90 metadata and raid autodetect but please for the love of god don't do that anymore)

The partition type matters only if you're dual boot with windows. By default windows would try to format those partitions if not set to a linux specific type (I just set lvm on everything regardless whether I'm actually using it for lvm).

PS: Of course you can also use 1MiB-2MiB for the bios grub partition. However only a few kilobytes are actually used (the grub2 manual mentions 31kb) so I prefer to squeeze it in before the 1st MiB.

Last edited by frostschutz (2015-11-03 18:51:09)

Offline

#3 2015-11-04 10:56:39

lsas
Member
Registered: 2010-11-23
Posts: 23

Re: BIOS/GPT and RAID1

There is no "EFI System" if your mainboard does not support UEFI. It's a regular /boot partition. You should also set the boot flag for the MBR, as some BIOS only machines require it.

Ok.

If you want to support stupid bootloaders, use 1.0 metadata and ext2 for the boot partition

What do you mean? I will install GRUB2


So for the RAID i should set root and storage partition just to LVM 8e00 ? But LVM and RAID are two different thing as far as i understand. Is that right?
Or i just have to create the filesistem's partitions and the create the array with mdadm ?


PS. meanwhile i'm try to learn something more about raid at https://raid.wiki.kernel.org , but i'm still confused..

Last edited by lsas (2015-11-04 11:14:06)

Offline

#4 2015-11-09 14:21:54

lsas
Member
Registered: 2010-11-23
Posts: 23

Re: BIOS/GPT and RAID1

After reading the wiki and some other guides (this archwiki was helpfull)  i've decided to implement lvm over RAID1.

So first i created the Bios GRUB partition and a big second one:

Dispositivo Start        End             Sectors   Size   Type
/dev/sda1      64       2047                 1984  992K    BIOS boot
/dev/sda2    2048 5860155391 5860153344   2,7T   Linux

and then copied the partition table to sdb.

after that i created an array with mdadm of sda2 and sdb2 RAID1.

Then, on top of RAID i've created the lvm device, splitted in four logical volume as follow:

# lvdisplay
  --- Logical volume ---
  LV Path                /dev/server/boot
  LV Name                boot
  VG Name                server
  LV UUID                3Z70U8-Mc1W-aKQU-tORg-oiaT-P2kI-aYG74K
  LV Write Access        read/write
  LV Creation host, time archiso, 2015-11-06 08:51:19 +0100
  LV Status              available
  # open                 1
  LV Size                512,00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Path                /dev/server/swap
  LV Name                swap
  VG Name                server
  LV UUID                z8PdBc-DZRL-zsC5-190M-nyUl-k3cn-9gaYRo
  LV Write Access        read/write
  LV Creation host, time archiso, 2015-11-06 08:51:28 +0100
  LV Status              available
  # open                 2
  LV Size                4,00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

  --- Logical volume ---
  LV Path                /dev/server/archroot
  LV Name                archroot
  VG Name                server
  LV UUID                Z2eotR-N0HN-nroI-3hUd-odMB-GzHy-4PrsnL
  LV Write Access        read/write
  LV Creation host, time archiso, 2015-11-06 08:52:37 +0100
  LV Status              available
  # open                 1
  LV Size                20,00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2

  --- Logical volume ---
  LV Path                /dev/server/storage
  LV Name                storage
  VG Name                server
  LV UUID                cccOsD-GBXu-pMws-e4bS-tCic-ZCFs-OstIf9
  LV Write Access        read/write
  LV Creation host, time archiso, 2015-11-06 08:52:52 +0100
  LV Status              available
  # open                 1
  LV Size                2,70 TiB
  Current LE             709046
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

And now is all working perfectly

Thanks for the help.

Offline

Board footer

Powered by FluxBB