Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: athouston 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.
-
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.
-
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.
-
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?????
-
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
-
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:
mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd
Edit: maybe needs to be --auto=mdp --assemble. Not sure.
-
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.
-
Did you add the --auto=mdp param? Does /dev/md0 exist after assembling?
-
Sorry for the stupid question. Is the raid array partitioned, formatted?
-
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).
-
Can you mount /dev/md0p1 manually?
-
WIthout testing it is a stupid thing to tell anything. But if the array otherwise OK, I would look around at udev rules...
-
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 ;)
-
@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?
-
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.
-
Thanks. I'd appreciate that. Feel free to list any specific testing you want done as well. I'm not a TUX yet (I come from the other side of the fence) but I am techo so I can read.
-
I can see the rational behind that. In the mean time, any suggestions as to how I can mount this array.
-
What maro and bmarkus meant with manually mounting was to create the directory, and to mount with full parameters (which works irrespective of fstab). If the array's assembled and formatted:
sudo mkdir /mnt/point
sudo mount /dev/md0p1 /mnt/point
This is of course separate from the legitimate issue of lacking raid support in rebuildfstab.
-
Make sure the partitions used to assemble the array are type 'fd'.
mdadm only auto assembles partitions so marked.
You can manually mount without fstab entries:
mkdir /mnt/md0
mount /dev/md0 /mnt/md0
-
Thanks for the words of wisdom. The manual process works.
I put the assemble command in bootlocal.sh along with the mkdir and mount commands. The assemble and mkdir work but the mount does not. I do not see any error messages. I can manually mount immediately from a terminal session (sudo su).
I'll ask a new question on that outside of "bugs" thread.
Thanks. I look forward to the next version of rebuildfstab.