You are not logged in.

#1 2011-06-27 03:49:58

99Percent
Member
Registered: 2011-06-11
Posts: 32

[SOLVED] how to install ArchLinux on a simple software raid 0

I have two 256GB disks and I want them to be in raid 0.

I tried following this tutorial: https://wiki.archlinux.org/index.php/In … AID_or_LVM

but this tutorial has the added complication of LVM and raid 1 which I don't need.

I made 3 partitions on each of the disks:
sda1 - 100MB for /boot
sda2 - 2048MB for swap
sda3 - raid 0 md0
sdb1 - unused
sdb2 - 2048 for swap
sdb3 - raid 0 md0 for /

I can assemble and format the sda1(ext4), sda2(swap), sdb2(swap)  md0 (ext4) and install all the packages
I also configured mdadm.conf by Alt F2 at the installer and executing: mdadm --examine --scan > /mnt/etc/mdadm.conf
and added mdadm hook to the HOOKS list in /etc/mkinitcpio.conf (before 'filesystems')
configured the boot with grub outside of the installer as indicated in the tutorial

But when I boot I get:

md0: unknown partition table
Error: Unable to determine the file system of /dev/sda3

please help.

Last edited by 99Percent (2011-06-29 20:21:52)

Offline

#2 2011-06-27 10:44:25

esdaniel
Member
From: Paris
Registered: 2010-02-01
Posts: 58
Website

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Have a look at this page and see if that can give you a few hints to help you resolve:
https://wiki.archlinux.org/index.php/In … _Fake_RAID

Offline

#3 2011-06-27 14:07:13

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

You do not want fakeraid. Fakeraid is horrible and eat children.
Just ignore the lvm part, and select 0 as the raid level instead of 1.

Post your grub config and fstab.

Last edited by Mr.Elendig (2011-06-27 14:15:10)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2011-06-27 18:03:12

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

I agree about the fakeraid, I had horrible experiences trying to get it working under windows XP

At /arch/setup in step 7, install Bootloader>Use Grub
I answer 'Yes' to 'Do you have your system installed on software raid.
menu.lst:

title Arch Linux
root
kernel /vmlinuz26 root=/dev/md0 ro
initrd /kernel26.img

'Do you want to install grub to the MBR of each harddisk from your boot array /dev/sda1 (recommended)? > Yes
I get 'Error: Missing/Invalid root device: Grub was NOT succesfully installed'

I exit the setup and reboot anyway and I get the grub> command prompt
I enter:
grub> root (hd0,0)
grub> setup (hd0)
grub> reboot

And then the system boots ok with the archlinux installed, so it is (apparently) working now. Not very smooth and I struggled quite a bit...

Offline

#5 2011-06-28 13:20:51

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Sadly the raid stuff in the install is not that great. I always prefer to set up the raid and trow in the bootloader by hand because of that.

Sidenote: Why not seperate /home? keeping the user data on a seperate partion is always nice.

Last edited by Mr.Elendig (2011-06-28 13:21:47)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2011-06-28 18:39:52

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

fyi this is how I finally set up my simple 2 drive raid 0:

1. Create a bootable USB ArchLinux with UNetBootin
2. Boot with the USB
3. # /arch/setup
3. Select source: internet (highly recommended because i found out UNetBootin sources are not 100% reliable though not necessarily so, IOW just to be sure)
3. partition the two drives with 100mb for /boot and 100mb for swap (setup requires it - I have 8GB memory, I decided I don't need much swap space) and the rest of both sda and sdb which will make your raid 0.
4. ALT F2 to another terminal and create the the raid like this:
# modprobe raid0 (not sure if this is actually necessary)
# mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sda2 /dev/sdb2
5. go back to the setup screen with CTRL-ALT-F1
6. go to Prepare Hard Drives>Manually configure block devices, filesystems and mountpoints. Add the /boot (ext2) for sda1 swap for sdb1 and desired filesystem for md0 (I chose reiserfs). Ignore the rest of the devices.
7. Select packages. Add the base-devel just in case, but nothing else and install packages
8. ALT F2 again to the  terminal and run:
# mdamd --examine --scan > /mnt/etc/mdadm.conf
(this will configure the mdadm.conf to use your raid as created)
9. go back to the setup screen again with CTRL-ALT-F1
10. Select configure system
11. Edit /etc/rc.conf adding: raid0 to MODULES= like this:
MODULES=(raid0)
again not sure if necessary but it works for me
12. Edit /etc/mkinitcpio.conf adding dm_mod to the MODULES= like this:
MODULES="dm_mod"
13. also add to /etc/mkinitcpio.conf HOOKS= mdadm but before filesystems in my case it went like this:
HOOKS="base udev autodetect pata scsi sata mdadm filesystems"
14. I went ahead and uncommented a few mirrors in the mirrorlist file so I wouldn't have to deal with that later (and maybe it helps on the way).
15. Also set a root password. Not sure if it is even necessary but maybe some components require it.
16, Go to configure bootloader and select Grub
17. When asked "Do you have your system installed on software raid? answer Yes
18. When asked to edit the menu.lst file don't edit anything, just exit
19. When asked "Do you want to install grub to the MBR of each harddisk from your boot array? answer Yes
20. You will get "Error: Missing/Invalid root device:" and "GRUB was NOT successfully installed." Ignore those messages.
21. Exit the install
22. remove the USB stick and:
# reboot
23. the boot will fail and you will get a grub> prompt type the following commands:
grub> root (hd0,0)
grub> setup (hd0)
grub> reboot

Thats it!

Last edited by 99Percent (2011-06-28 18:51:59)

Offline

#7 2011-06-28 20:21:35

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

99percent

Perhaps you can provide info on the status of your raid array, supposedly raid0 bootable, from...cat  /proc/mdadm.

Am not aware that a raid0 array will boot....only raid1 or others.

I may be uninformed, however...not unusual for an 86 year old man.!

Perhaps you can post hdparm /dev/md0  as well?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2011-06-28 22:27:14

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Hello lilsirecho,

I partitioned sda with a 100mb (and the rest for the raido0) for the boot that is why I was able to boot.

Offline

#9 2011-06-28 23:06:26

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

I appreciate your description of the boot.

I am curious as to why my request for ...hdparm -t /dev/md0 and cat /proc/mdstat  results were not included in your post.

Raid0 produces twice the speed of identical drives as you are aware.

It seems probable to me that your actual running raid system is raid1.  I am not an expert but am curious about the performance measures for your method of raid0 implementation.

Does the raid0 assemble during boot with mdadm as it does with "normal" raid0 mdadm controlled boots.?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2011-06-29 15:24:35

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

mdstat:

Personalities : [raid0]
md0 : active raid0 sda2[0] sdb2[1]
      499908608 blocks super 1.2 512k chunks

unused devices: <none>

I dont have hdparm

Offline

#11 2011-06-30 00:37:19

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

screenshot of my storage device list and benchmark
http://comicastle.com/hdbench20110629.png

Follow image posting rules -- Inxsible

Last edited by Inxsible (2011-06-30 17:28:59)

Offline

#12 2011-06-30 17:14:38

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Thanks for the posting.  Looks very impressive.

Perhaps this procedure needs a wiki page.....

I have used the setup you described using grub2 and did not need to use the grub entries you list at the end of your post.

Also, when entering F2 after installing packages (FTP) the file /etc/mdadm.conf was not found.  I proceeded with the procedure ignoring that step.

My setup is a pair of CF cards connected via adapters to sata ports.  The CF cards are UDMA IDE capable.  Each is 8GB 266x.

The boot speed is very fast and all activities brisk.

I will utilize larger capacity devices in another setup later this month.

When booting, I select the boot CF device which is sda(1) .

I used FTP install packages so the kernel is current.

I appreciate your efforts and the results are first rate.

I do not expect to have problems with this setup regarding the Flash devices.

I have used CF devices for a year or more with many variations and they still perform with accuracy and dependability.  Keeping my fingers crossed!!!!

Thank you for your patient replies and for the install methodology.

I will report the boot time shortly.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2011-06-30 17:22:36

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Boot time to root log-in prompt is 8 seconds.

Hdparm for /dev/md0 is 88+MB/sec.  Normal CF card hdparm is 45MB/sec.

Thus the raid is performing as expected.

With proper care and feeding, it may last for a good while.

EDIT:  You need to upgrade to 100percent!

Last edited by lilsirecho (2011-06-30 17:47:34)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#14 2011-07-01 03:28:16

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Performed the procedure again with 16GB CF devices of 533x.

Again with FTP install and using grub2 which enabled booting without grub menu.lst editing.

Still no /mnt/etc/mdadm.conf and the file doesn't show in /etc after install is completed.

Running with xfce4.

Will report boot time in next post. 

One strange thing...gparted refuses to list /dev/md0...it claims there is no  : /dev/md/0... of course there isn't because ..cat /proc/mdstat..sez md0 is enabled.

Each drive of the pair reports 14.8GB , somewhat less than the 16GB marking.

Hdparm -t reports 128MB/s for the raid array ...again somewhat lower than expected.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#15 2011-07-01 03:31:27

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Boot time to xfce4 Desktop 10 seconds...................


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#16 2011-07-01 04:09:21

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Cfdisk reports md0 raid is 31.8GB in size.

Gparted in my HDD arch bootup shows .../Dev/md0p1...

Hdparm in HDD for the /dev/md0 reports 81MB/s.

Dunno why the difference except for the different operating enviro.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#17 2011-07-01 15:06:42

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Info on the CF cards from hdparm:

/dev/sda:

Model=, FwRev=20090728, SerialNo=CF CARD     A01006D5
Config={ HardSect NotMFM Fixed DTR>10Mbs }
RawCHS=31045/16/63, TrkSize=0, SectSize=576, ECCbytes=4
BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
CurCHS=31045/16/63, CurSects=31293360, LBA=yes, LBAsects=31293360
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma6
AdvancedPM=yes: disabled (255) WriteCache=enabled

* signifies the current active mode


/dev/sdb:

Model=, FwRev=20090728, SerialNo=CF CARD     A01007DF
Config={ HardSect NotMFM Fixed DTR>10Mbs }
RawCHS=31045/16/63, TrkSize=0, SectSize=576, ECCbytes=4
BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
CurCHS=31045/16/63, CurSects=31293360, LBA=yes, LBAsects=31293360
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma6
AdvancedPM=yes: disabled (255) WriteCache=enabled

* signifies the current active mode

Still having a problem with the ID for md0 being reported as ..md/0....???


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#18 2011-07-01 15:30:38

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

While booted into md0 the hdparm reads for the two drives

/dev/sda:
Timing buffered disk reads: 194 MB in  3.01 seconds =  64.45 MB/sec

/dev/sdb:
Timing buffered disk reads: 200 MB in  3.03 seconds =  66.09 MB/sec


The total is 130MB/s while is close to the figure I quoted previously, certainly within reason for the variations possible.

These are probably typical for IDE mode CF udma5.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#19 2011-07-01 18:30:32

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

More info:mdadm --misc --detail /dev/md0...

/dev/md0:
        Version : 1.2
  Creation Time : Thu Jun 30 17:59:35 2011
     Raid Level : raid0
     Array Size : 31083520 (29.64 GiB 31.83 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Thu Jun 30 17:59:35 2011
          State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0

     Chunk Size : 512K

           Name : (none):0
           UUID : 4935abc5:ad9d24f5:47347181:a023c62f
         Events : 0

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#20 2011-07-01 18:56:06

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Perhaps the procedure step listed as step8 should be:

mdadm -D --scan >>/etc/mdadm.conf....?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#21 2011-07-05 17:18:30

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

hi lilsirecho, sorry I have been busy trying out my new ArchLinux big_smile

I am now concerned about write times decaying due to lack of garbage collection ("TRIM") in my array. I tried chaging my fstab from:

/dev/md0 / reiserfs defaults, noatime 0 1

to

/dev/md0 / reiserfs defaults, noatime,discard 0 1

and to my horror the array went to read only! I had to do some juggling to be able to edit the /etc/fstab again

I thought reiserfs supported the discard option for TRIM, now I will have to change the fs sad or is this a limitation of raid0?

Offline

#22 2011-07-06 02:05:08

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Cannot help on this query...haven't had experience with reiserfs and my fstab is printed below:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
# DEVICE DETAILS: /dev/md0 UUID=9bd175ad-d8b4-4ae4-b34f-69afefa49651 LABEL=none
# DEVICE DETAILS: /dev/sda1 UUID=04d0861d-2a17-4db8-9937-0b83085d092b LABEL=none
# DEVICE DETAILS: /dev/sdb1 UUID=c97f8aac-893f-4ceb-b78d-3d358234a53b LABEL=swap
UUID=04d0861d-2a17-4db8-9937-0b83085d092b /boot ext2 defaults 0 1
UUID=9bd175ad-d8b4-4ae4-b34f-69afefa49651 / ext3 defaults 0 1
UUID=c97f8aac-893f-4ceb-b78d-3d358234a53b swap swap defaults 0 0

Looks normal as can be!!  It functions nicely in both 8GB devices and 16GB devices. EDIT: CF cards connected with adapters to sata ports.

The 16GB devices are 533x and the 8GB devices are 266x.

Boot time to xfce4 Desktop is 9 seconds.

Last edited by lilsirecho (2011-07-06 02:24:41)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#23 2011-07-06 08:17:12

esdaniel
Member
From: Paris
Registered: 2010-02-01
Posts: 58
Website

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

Hi,

I've been enjoying reading this thread... @99 what's the bench tool you've been using?

I was looking at the results and only now realise you're using SSDs, until then I thought that was an amazing performance for SATA drives ;-) I'm curious to know if I'm missing out on hard disk performance by using Fakeraid instead of software raid like you guys.

Re: filesystems FWIW I've been keeping on ext4 for now based on the notion of maturity though xfs is also a worthy candidate - one tip I might share is that I did come across someone who'd had pains with BTRFS on the Amazon cloud thus it might well be worth sitting that one out until it has sufficiently matured 'in the field' and all patches applied: http://blog.anzix.net/2010/11/20/amazon … inux-ext4/ - as an example... Google will show you a few others.

Trim with ext4 how-to: https://sites.google.com/site/lightrush … dsonubuntu

Offline

#24 2011-07-07 12:46:01

99Percent
Member
Registered: 2011-06-11
Posts: 32

Re: [SOLVED] how to install ArchLinux on a simple software raid 0

yes, to enable TRIM to the drive just add discard on the fstab line

but in my case the mount turned to read only. I don't know if its a Reiserfs issue or a limitation of raid0. I believe its the latter but probably both. O well, we'll see how badly write speed deteriote. I might have to resign myself to hdparm --secure-erase the drives once in a while with the tedious backup and restore.

Offline

Board footer

Powered by FluxBB