WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: MD (RAID) setup problem (Solved)  (Read 2099 times)

Offline athouston

  • Full Member
  • ***
  • Posts: 143
MD (RAID) setup problem (Solved)
« on: June 30, 2010, 10:08:51 PM »
I have installed MD (swRAID) and MDADM (admin) on latest release TC.

I seem to be able to use MDADM to create a new array:

mdadm --create /dev/md0 --level=5 --raid-devices=4 --spare-devices=0 -f /dev/sda /dev/sdb /dev/sdc /dev/sdd

These are four 1TB SATA drives. I then cfdisk /dev/md0 and create a primary partition md0p1 (TC names it automatically) of 3GB.

I then mkfs.ext3 /dev/md0p1 and it seems to do what it is supposed to with no errors.

I then rebuildfstab.

There is no entry in fstab for /dev/md0p1. I manually entered one, did a backup and rebooted. When I checked fstab the entry I put in for /dev/md0p1 is gone, replaced by an entry for /dev/sda1 which is the first drive in the array.

Can someone suggest what I am missing please.
« Last Edit: July 11, 2010, 01:37:56 AM by athouston »

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: MD (RAID) setup problem
« Reply #1 on: July 01, 2010, 03:00:28 AM »
fstab is populated automatically from fdisk -l

I think there is a "nofstab" boot option to not have it autogenerate one.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: MD (RAID) setup problem
« Reply #2 on: July 01, 2010, 09:45:30 AM »
Looks like I got some of that wrong. Apparently you need to create partitions on the drives first and rebuildfstab to get them recognised. After that the RAID command seems to work (change sda to sda1 etc). I now have a running array and it is rebuilding onto the 4th drive which it thinks is a spare for some reason.

I have  a conf file at /etc/mdadm.conf with an entry for the array but I cannot mount /dev/md0 because there is no entry in /dev. So apparently my problem is :--how do I now make md0 persistent.