WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Software RAID doesn't save config's  (Read 9443 times)

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Software RAID doesn't save config's
« on: July 01, 2010, 10:10:49 PM »
I regret to advise that after three days (and nights) of heartache I must suggest that there exists an inconsistency of operation in the MDADM program.

I have Qty 4 of 1TB SATA drives. I can cfdisk and mkfs each of these drives. I can create an array with MDAM, cfdisk and mkfs on it, and manage and monitor it. I cannot mount it because it is not recognised by rebuildfstab and doesn't put an entry in fstab.

I cannot find an mdadm.conf file so I manually made one in /etc but that appears ineffective.

Everything disappears after rebooting.

ANy suggestions would be greatly appreciated.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Software RAID doesn't save config's
« Reply #1 on: July 02, 2010, 01:42:30 AM »
I would not get too hung up about the fact that '/usr/sbin/rebuildfstab' does not create an '/etc/fstab' entry. AFAIK those entries are not mandatory, they are merely convenient. They might allow for a user other than 'root' to use mount /dev/... instead of sudo mkdir /mnt/... ; sudo mount /dev/... /mnt/... or support the use of mount -a, but neither is absolutely required for you to mount a device. Unfortunately I can't give you any real help as I don't have such hardware at my disposal.

A few things you have probably already tried out come to mind:
  • Any interesting bits in 'dmesg'?
  • What partitions does the system "see" (e.g. grep -v loop /proc/partitions)?
  • Any interesting output of blkid, when run against those partitions?

You will probably agree that your hardware is a bit more "exotic" than what the majority of TC / MC users will be using. I hope you'll make some progress and will in the end of the day be able to provide some clues (or patches) so that '/usr/sbin/rebuildfstab' might be improved.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: Software RAID doesn't save config's
« Reply #2 on: July 02, 2010, 04:02:28 AM »
Yes I agree that I am fortunate to have access to some higher spec gear than perhaps the usual, thanks to a benevolent sponsor for this project.

The big drives are none-the-less attached to a standard SATA controller so basically I am just trying to get software RAID running on an ordinary PC. I hadn't come across the term "faikraid" before and did some reading. I now understand the comment made to me elsewhere on these forums about the lack of speed difference between my Highpoint card and the swRAID drivers.

I'll specifically look at the ideas you give and get back here later tonight with the results.

The bottom line is that I seem to be able to create the RAID array and the drives and everything else looks like its doing its thing correctly, I just can't mount the drive md0 and it all disappears when I reboot.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: Software RAID doesn't save config's
« Reply #3 on: July 02, 2010, 07:26:55 AM »
There are no references to the raid array in dmesg. All the drives and their associated parameters are displayed.

/proc/partitions shows all physical drives and their partitions but nothing about the raid array.

blkid against each of the partitioned discs (sda1 etc) shows them as members of the same raid array.

mdadm responds that the array does not exist when I try to manage it.

fstab shows all the individual devices (partitions) and lists them as members of the raid array.

I can assemble an array from the partitioned drives by specifying the drives to use and mdadm --detail shows all its parameters but cannot mount it because it does not find it in fstab. mdadm -- assemble --scan replies no arrays found.

According to the doco I have read. mdadm is supposed to create a conf file at /etc/mdadm/mdadm.conf but it does not. I can create one manually by making a /etc/mdadm directory and mdadm -Es and pipe the output to the file. The contents have a raid array with the same UID as listed for each of the drives. This also disappears when I reboot - despite doing a backup.

Any ideas what I am doing wrong?????
« Last Edit: July 02, 2010, 07:50:40 AM by athouston »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Software RAID doesn't save config's
« Reply #4 on: July 02, 2010, 08:01:46 AM »

According to the doco I have read. mdadm is supposed to create a conf file at /etc/mdadm/mdadm.conf but it does not. I can create one manually by making a /etc/mdadm directory and mdadm -Es and pipe the output to the file. The contents have a raid array with the same UID as listed for each of the drives. This also disappears when I reboot - despite doing a backup.

Any ideas what I am doing wrong?????

According to my knowledge mdadm.conf is not needed for the software raid, it is just to simplify tasks. My CentOS boxes are working fine as expected without having such file since years.

Beauty of software it grabs all information from the drives to assemble arrays. I had problem only once when /dev/mdx was not created by the system and I had to use mknod command first.

Havn't tried raid on TC yet :(

Regarding mdadm.conf see http://man-wiki.net/index.php/5:mdadm.conf
« Last Edit: July 02, 2010, 08:03:45 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11073
Re: Software RAID doesn't save config's
« Reply #5 on: July 02, 2010, 08:03:43 AM »
Reading the docs at https://raid.wiki.kernel.org/index.php/RAID_setup

I'm new to this, but looks like you'll need to run a command on boot. A config file is not required, it would just store a part of that command. I assume "big" distros would run it automatically if the config file exists, which is where this confusion likely came up.

Try adding the following to /opt/bootlocal.sh, run a backup, reboot:

Quote
mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd

Edit: maybe needs to be --auto=mdp --assemble. Not sure.
« Last Edit: July 02, 2010, 08:14:12 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: Software RAID doesn't save config's
« Reply #6 on: July 02, 2010, 09:49:02 AM »
I see the need to assemble the array on startup and the bootlocal mods work fine (thanks).

But I still cannot mount the array. It gives an error that it cannot be found in fstab. I added an entry for it in fstab but then I get an error that /dev/mdo does not exist.

The doco pointed to says that the mdadm.conf file is required for array management but mdadm hasn't created one on my system.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11073
Re: Software RAID doesn't save config's
« Reply #7 on: July 02, 2010, 09:58:58 AM »
Did you add the --auto=mdp param? Does /dev/md0 exist after assembling?
The only barriers that can stop you are the ones you create yourself.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Software RAID doesn't save config's
« Reply #8 on: July 02, 2010, 10:01:10 AM »
Sorry for the stupid question. Is the raid array partitioned, formatted?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: Software RAID doesn't save config's
« Reply #9 on: July 02, 2010, 10:12:16 AM »
I didn't add the --auto param because I couldn't find it in the mdadm help, but the array assembles. I can query it and get its details through mdadm.

I can cfdisk it and mkfs.ext3 /dev/md0p1 on it but when I rebuildfstab it does not put an entry in fstab (I've been using the shorthand md0 but its actually md0p1).

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Software RAID doesn't save config's
« Reply #10 on: July 02, 2010, 10:15:36 AM »
Can you mount /dev/md0p1 manually?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Software RAID doesn't save config's
« Reply #11 on: July 02, 2010, 10:21:13 AM »
WIthout testing it is a stupid thing to tell anything. But if the array otherwise OK, I would look around at udev rules...
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11073
Re: Software RAID doesn't save config's
« Reply #12 on: July 02, 2010, 11:26:13 AM »
I didn't add the --auto param because I couldn't find it in the mdadm help, but the array assembles. I can query it and get its details through mdadm.

I can cfdisk it and mkfs.ext3 /dev/md0p1 on it but when I rebuildfstab it does not put an entry in fstab (I've been using the shorthand md0 but its actually md0p1).

This is expected, as there's no explicit raid support (yet at least).

edit: I have a patch for rebuildfstab, to have fstab and mount points for raid. MD devices though don't cause udev events, so you'll need to add a rebuildfstab call after the raid assembly. --auto isn't necessary ;)
« Last Edit: July 02, 2010, 12:22:26 PM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline athouston

  • Full Member
  • ***
  • Posts: 143
Re: Software RAID doesn't save config's
« Reply #13 on: July 02, 2010, 04:41:47 PM »
@BMarkus:

No I can't manually mount the array.

@Curaga:

When I rebuildfstab it does not put any entry in fstab so I assume I need the patch you mention to make that work. I see the logic of adding rebuildfstab into bootlocal after that. How do I get a copy of the patch please?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11073
Re: Software RAID doesn't save config's
« Reply #14 on: July 02, 2010, 05:49:00 PM »
It's quite small, so I'd prefer for it to go through official channels - let's see if it can get into the next release.
The only barriers that can stop you are the ones you create yourself.