You are not logged in.

#1 2012-10-02 15:18:11

Registered: 2011-11-22
Posts: 27

[SOLVED] RAID 0 Partitioning Table


Im installling my favorite distro, Arch Linux, and just found out that I want to try RAID 0 (Software RAID). I hate partitioning a disk, because when I can finally decide on a partitioning table, I never remember it the next time. (Writing it down this time...) Anyway, I'm really horrible at it so I thought I'd ask for some experienced advice. So, hope someone can help me with a RAID 0 partitioning table! I have 2 x 750 GB disks.



Last edited by 7SLEVIN (2012-10-17 21:48:57)


#2 2012-10-04 10:07:03

From: London >. < Paris
Registered: 2005-06-13
Posts: 652

Re: [SOLVED] RAID 0 Partitioning Table


Since you have 2 x 750 GB disks, it should be quite straightforward.
Do the following how to set up Arch with LVM and raid make sense to you?
Software RAID and LVM: Installation » Archlinux whit RAID and LVM

Note: am running a LVM with raid 0 arch x86_64. As I have configured it this summer, I found the latest arch iso to allow setting up such an install much more straightforward than before.

Seeded this month: Arch 80 gig (and Talking~ 2, ~-anywhere 46, Apricity 16)
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) & 2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9


#3 2012-10-15 12:36:42

Registered: 2011-11-22
Posts: 27

Re: [SOLVED] RAID 0 Partitioning Table

Sorry for the late reply! School's kicking my ass...

Very much, thank you!

Setting up the raid arrays and logical volumes etc. went smooth, but when i tried to pacstrap base, it couldn't find the database files. Read around and tried different solutions, but it just wouldn't budge, so as we speak, I'm trying over again. :-)


#4 2012-10-16 13:46:15

Registered: 2011-11-22
Posts: 27

Re: [SOLVED] RAID 0 Partitioning Table

So, the previous issue disappeared, but I got a new one. When trying to install GRUB2, I get an error running grub-install:

/usr/sbin/grub-bios-setup: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
+ exit 1

I read in the Arch Wiki, under Preliminary Requirements for GRUB2, that:

GRUB2 in BIOS-GPT configuration requires a BIOS Boot Partition to embed its core.img in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB2 only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB2). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.

For a BIOS-GPT configuration, create a 2 MiB partition using cgdisk or GNU Parted with no filesystem. The location of the partition in the partition table does not matter but it should be within the first 2 TiB region of the disk. It is advisable to put it somewhere in the beginning of the disk before the /boot partition. Set the partition type to "EF02" in cgdisk or set <BOOT_PART_NUM> bios_grub on in GNU Parted.

So, I need a 2MiB partition, of type bios_grub, before my /boot partition? And how do I find out if my system i UEFI based?

Thanks for the help!


#5 2012-10-16 18:12:25

Registered: 2011-11-22
Posts: 27

Re: [SOLVED] RAID 0 Partitioning Table

After some googling, I can't find anything about my motherboad (Asus M3A32-MVP Deluxe) being UEFI supported/compatible/based/whatever. I therefor assume it's not.

I'll then try an install with previously mentioned config.

EDIT: ITS ALIVE!! I'll admit, it wasn't that hard when you did proper research.

Made a basic outline of the process to help me get it right, maybe it will help someone:

Arch Linux install process

Getting ready

Stop raid arrays:
# mdadm -S /dev/md{x,y,z}
Erase superblocks:
# mdadm --zero-superblock /dev/sd{a,b}{1,2,3,4}
Wipe disk:
# dd if=/dev/zero of=/dev/sdX bs=1M count=100

GPT Partition Scheme

Partition	Mount p.	Size		Type	Raid
/dev/sda1			2MiB		ef02	
/dev/sda2	/boot		100MiB	fd00	/dev/md1
/dev/sda3	/swap	2048MiB	fd00	/dev/md2
/dev/sda4	/		rest		fd00	/dev/md0 <-- OBS!

# sgdisk --backup=table /dev/sda
# sgdisk --load-backup=table /dev/sdb

(--assume-clean / watch -n .1 cat /proc/mdstat)

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]4

# mdadm --create /dev/md1 --level=1 --raid-devices=2 --metadata=0.9 /dev/sd[ab]2

# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sd[ab]3

Further info: mdadm --misc --detail /dev/md[012] | less

# pvcreate /dev/md0

# vgcreate VolGroupArray /dev/md0

# lvcreate -L 20G VolGroupArray -n lvroot
# lvcreate -L 15G VolGroupArray -n lvvar
# lvcreate -L 640G VolGroupArray -n lvhome

File system
# mkfs.ext4 /dev/VolGroupArray/lvroot
# mkfs.ext4 /dev/VolGroupArray/lvvar
# mkfs.ext4 /dev/VolGroupArray/lvhome

# mkfs.ext4 /dev/md1

# mkswap /dev/md2
# swapon /dev/md2

# mount /dev/VolGroupArray/lvroot /mnt
# mkdir /mnt/{home,boot,var}
# mount /dev/md1 /mnt/boot
# mount /dev/VolGroupArray/lvvar /mnt/var
# mount /dev/VolGroupArray/lvhome /mnt/home

Select mirror:
# vi /etc/pacman.d/mirrorlist
# pacstrap /mnt base base-devel
Update raid:
# mdadm --examine --scan > /mnt/etc/mdadm.conf
Generate fstab:
# genfstab -p /mnt >> /mnt/etc/fstab
and only / needs 1 in last field and remove "data=ordered":
# nano /mnt/etc/fstab
Chroot into system:
# arch-chroot /mnt
Configure locale:
# nano /etc/locale.gen
# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
Console font and keymap:
# nano /etc/vconsole.conf
# ln -s /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime
Hardware clock to UTC:
# hwclock --systohc --utc
# echo myhostname > /etc/hostname
Edit hosts:
# nano /etc/hosts	kroesus	localhost	nas
Configure network with static ip:
# pacman -S netcfg ifplugd
# cd /etc/network.d
# cp examples/ethernet-static .
# nano ethernet-static
# systemctl enable net-auto-wired.service
Uncomment repos in pacman:
# nano /etc/pacman.conf
Set root pwd:
# passwd
Add user:
# useradd -m -g users -s /bin/bash markus
# passwd markus

MODULES=(... dm-mod raid1 ...)
HOOKS=(... mdadm lvm2 filesystems...)

Re-generate the initramfs image:
# mkinitcpio -p linux

# pacman-db-upgrade
# pacman -Syy
# pacman -S grub-bios
# grub-install --target=i386-pc --recheck /dev/sda
# cp /usr/share/locale/en\@quot/LC_MESSAGES/ /boot/grub/locale/
# grub-mkconfig -o /boot/grub/grub.cfg
Modify menu.cfg:
# nano /boot/grub/grub.cfg >
	insmod lvm
	insmod raid
	set raid=(md1)
exit chroot, umount, reboot, pray

Mount into LVM
Info with pvs / # lvdisplay /dev/VolGroupArray 
# vgscan --mknodes
# lvchange -a y /dev/VolGroupArray/lvroot
# mount /dev/VolGroupArray/lvroot /mnt

Thanks Arch, for being such an elegant distro.

Last edited by 7SLEVIN (2012-10-17 21:48:02)


Board footer

Powered by FluxBB