Hi,
I lost my mdadm.conf (and /proc/mdadm shows nothing useful) and I'd like to mount the filesystem again. So I've booted using rescue but I was wondering if I can do a command like this safely (i.e without losing the data previously stored).
mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sda1 /dev/sdb1
Where of course the raid devices and the /dev/x are the correct ones
On Thu, Dec 31, 2009 at 11:39:25AM -0400, robert mena wrote:
Hi,
I lost my mdadm.conf (and /proc/mdadm shows nothing useful) and I'd like to mount the filesystem again. So I've booted using rescue but I was wondering if I can do a command like this safely (i.e without losing the data previously stored).
mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sda1 /dev/sdb1
Where of course the raid devices and the /dev/x are the correct ones
I've collected an howto somewhere from the 'net:
$ cat docs/sysadm/mdadm_recovery.txt
## define possible devices with arrays echo 'DEVICE /dev/hd[a-l]* /dev/sd[a-l]*' > mdadm.conf
## scan mdadm --examine --scan --config=mdadm.conf >> mdadm.conf
## review configuration, copy to /etc cp mdadm.conf /etc/
## create devices MAKEDEV md || { for ((i=0; i <= 31; i++)); do mknod /dev/md$i b 9 $i; done; }
## start arrays mdadm --assemble --scan
Best of luck,
I've collected an howto somewhere from the 'net:
$ cat docs/sysadm/mdadm_recovery.txt
## define possible devices with arrays echo 'DEVICE /dev/hd[a-l]* /dev/sd[a-l]*' > mdadm.conf
## scan mdadm --examine --scan --config=mdadm.conf >> mdadm.conf
## review configuration, copy to /etc cp mdadm.conf /etc/
## create devices MAKEDEV md || { for ((i=0; i <= 31; i++)); do mknod /dev/md$i b 9 $i; done; }
## start arrays mdadm --assemble --scan
That's a fairly limited script and out of date, I've never used mknod...
Simply: # mdadm --detail --scan --verbose And look it over, then: # mdadm --detail --scan --verbose > /etc/mdadm.conf
And worry about mountpoints etc now...
Not all rescue environments have MAKEDEV or have it in $PATH, so this should always work. ;)
Really, on my hp's as well? I don't have any /dev/hdx or /dev/sdx on the ones with software raid...
Nothing is easier than simply: # mdadm --detail --scan --verbose > /etc/mdadm.conf
And that actually *does* work in all environments...
On Thu, Dec 31, 2009 at 04:40:56PM +0000, Joseph L. Casale wrote:
Not all rescue environments have MAKEDEV or have it in $PATH, so this should always work. ;)
Really, on my hp's as well? I don't have any /dev/hdx or /dev/sdx on the ones with software raid...
Nothing is easier than simply: # mdadm --detail --scan --verbose > /etc/mdadm.conf
And that actually *does* work in all environments...
Does that create the /dev/md* devices? I mean, a *scan* shouldn't change the filesystem, should it? That's the problem that line tries to fix: that there's no mdX device in /dev...
2010/1/1 Luciano Rocha strange@nsk.no-ip.org:
On Thu, Dec 31, 2009 at 04:40:56PM +0000, Joseph L. Casale wrote:
Not all rescue environments have MAKEDEV or have it in $PATH, so this should always work. ;)
Really, on my hp's as well? I don't have any /dev/hdx or /dev/sdx on the ones with software raid...
Nothing is easier than simply: # mdadm --detail --scan --verbose > /etc/mdadm.conf
And that actually *does* work in all environments...
Does that create the /dev/md* devices? I mean, a *scan* shouldn't change the filesystem, should it? That's the problem that line tries to fix: that there's no mdX device in /dev...
I think after adding those details to your mdadm.conf and restarting your /dev/md* devices would be created?
Hi,
it worked (kind of). Thanks.
I was able to recreate (the all appear in /proc/mdstat) and in the rescue I've mounted the /boot which maps to /dev/md0. But I can't mount any other partition.
they all complain with the same error
mount: Mounting /dev/mdX on /tmp/mountpoint failed: no such file or directory
Any ideas?
On Thu, Dec 31, 2009 at 11:42 AM, Luciano Rocha strange@nsk.no-ip.orgwrote:
On Thu, Dec 31, 2009 at 11:39:25AM -0400, robert mena wrote:
Hi,
I lost my mdadm.conf (and /proc/mdadm shows nothing useful) and I'd like
to
mount the filesystem again. So I've booted using rescue but I was
wondering
if I can do a command like this safely (i.e without losing the data previously stored).
mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sda1 /dev/sdb1
Where of course the raid devices and the /dev/x are the correct ones
I've collected an howto somewhere from the 'net:
$ cat docs/sysadm/mdadm_recovery.txt
## define possible devices with arrays echo 'DEVICE /dev/hd[a-l]* /dev/sd[a-l]*' > mdadm.conf
## scan mdadm --examine --scan --config=mdadm.conf >> mdadm.conf
## review configuration, copy to /etc cp mdadm.conf /etc/
## create devices MAKEDEV md || { for ((i=0; i <= 31; i++)); do mknod /dev/md$i b 9 $i; done; }
## start arrays mdadm --assemble --scan
Best of luck,
-- lfr 0/0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Now you've got your array working give us a fuller picture, how many hard drives have you got, in what configuration, how many arrays, how many partitions, what file systems, output of "mount" command, fstab details etc etc
On Thu, Dec 31, 2009 at 12:24:23PM -0400, robert mena wrote:
Hi,
it worked (kind of). Thanks.
I was able to recreate (the all appear in /proc/mdstat) and in the rescue I've mounted the /boot which maps to /dev/md0. But I can't mount any other partition.
they all complain with the same error
mount: Mounting /dev/mdX on /tmp/mountpoint failed: no such file or directory
Silly question: does /dev/md0 and /tmp/mountpoint exist?
Hi,
Yes.
I have from /devmd0 to /dev/md6 (for some reason it skipped md3).
I do not have the fstab at hand but / /boot and /tmp
each map to a different mdX. I've been able to mount the /boot but no other.
One thing, besides the /boot all the other are ext4. Could it be a problem with the rescue does not supporting this filesystem type.
On Thu, Dec 31, 2009 at 12:32 PM, Luciano Rocha strange@nsk.no-ip.orgwrote:
On Thu, Dec 31, 2009 at 12:24:23PM -0400, robert mena wrote:
Hi,
it worked (kind of). Thanks.
I was able to recreate (the all appear in /proc/mdstat) and in the rescue I've mounted the /boot which maps to /dev/md0. But I can't mount any
other
partition.
they all complain with the same error
mount: Mounting /dev/mdX on /tmp/mountpoint failed: no such file or directory
Silly question: does /dev/md0 and /tmp/mountpoint exist?
-- lfr 0/0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, Dec 31, 2009 at 12:38:51PM -0400, robert mena wrote:
Hi,
Yes.
I have from /devmd0 to /dev/md6 (for some reason it skipped md3).
I do not have the fstab at hand but / /boot and /tmp
each map to a different mdX. I've been able to mount the /boot but no other.
One thing, besides the /boot all the other are ext4. Could it be a problem with the rescue does not supporting this filesystem type.
Yes, it could. Can you send us the output of dmesg?
Dmesg shows (for example when I tried to mount /dev/md2)
ext4-fs: md2 : not marked OK to use with test code
On Thu, Dec 31, 2009 at 12:40 PM, Luciano Rocha strange@nsk.no-ip.orgwrote:
On Thu, Dec 31, 2009 at 12:38:51PM -0400, robert mena wrote:
Hi,
Yes.
I have from /devmd0 to /dev/md6 (for some reason it skipped md3).
I do not have the fstab at hand but / /boot and /tmp
each map to a different mdX. I've been able to mount the /boot but no other.
One thing, besides the /boot all the other are ext4. Could it be a
problem
with the rescue does not supporting this filesystem type.
Yes, it could. Can you send us the output of dmesg?
-- lfr 0/0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
the problem was with the rescue image. i've booted from a new disk with a regular Os install and managed to mount the raid partitions.
On Thu, Dec 31, 2009 at 12:43 PM, robert mena robert.mena@gmail.com wrote:
Dmesg shows (for example when I tried to mount /dev/md2)
ext4-fs: md2 : not marked OK to use with test code
On Thu, Dec 31, 2009 at 12:40 PM, Luciano Rocha strange@nsk.no-ip.orgwrote:
On Thu, Dec 31, 2009 at 12:38:51PM -0400, robert mena wrote:
Hi,
Yes.
I have from /devmd0 to /dev/md6 (for some reason it skipped md3).
I do not have the fstab at hand but / /boot and /tmp
each map to a different mdX. I've been able to mount the /boot but no other.
One thing, besides the /boot all the other are ext4. Could it be a
problem
with the rescue does not supporting this filesystem type.
Yes, it could. Can you send us the output of dmesg?
-- lfr 0/0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
---------- Forwarded message ---------- From: robert mena robert.mena@gmail.com Date: 2009/12/31 Subject: Re: [CentOS] Lost mdadm.conf To: CentOS mailing list centos@centos.org
each map to a different mdX. I've been able to mount the /boot but no other. ---------------
So have you got one RAID0 which is partitioned into /boot, /tmp, / .....etc etc?
If /boot is mounting then try booting the machine normally?
i've tried with no luck the problem is that a back rsync probably caused this.
On Thu, Dec 31, 2009 at 1:04 PM, James Bensley jwbensley@gmail.com wrote:
---------- Forwarded message ---------- From: robert mena robert.mena@gmail.com Date: 2009/12/31 Subject: Re: [CentOS] Lost mdadm.conf To: CentOS mailing list centos@centos.org
each map to a different mdX. I've been able to mount the /boot but no other.
So have you got one RAID0 which is partitioned into /boot, /tmp, / .....etc etc?
If /boot is mounting then try booting the machine normally?
-- Regards, James ;)
Samuel Goldwyn - "I don't think anyone should write their autobiography until after they're dead." - http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
2009/12/31 Luciano Rocha strange@nsk.no-ip.org:
On Thu, Dec 31, 2009 at 11:39:25AM -0400, robert mena wrote:
Hi,
I lost my mdadm.conf (and /proc/mdadm shows nothing useful) and I'd like to mount the filesystem again. So I've booted using rescue but I was wondering if I can do a command like this safely (i.e without losing the data previously stored).
mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sda1 /dev/sdb1
Where of course the raid devices and the /dev/x are the correct ones
I can't say this with 100% certainty but I would of thought that it would been fine. I've lost my mdadm.conf (reinstalled OS) with a separate 4 disk RAID 5 array and re-assembled the array and carried on as if nothing had happened.
Use "sudo mdadm -E --scan" do get a list of discovered RAID devices like this example:
ARRAY /dev/md0 level=raid0 num-devices=2 UUID=fde94900:3f3f3bf6
Pop the results in your mdadm.conf and that should sort you out after a reboot (I think). Also try something like "sudo mdadm --assemble /dev/md1 /dev/sdb1 /dev/sdc1" to assemble the RAID manually.
James Bensley wrote:
2009/12/31 Luciano Rocha strange@nsk.no-ip.org:
On Thu, Dec 31, 2009 at 11:39:25AM -0400, robert mena wrote:
Hi,
I lost my mdadm.conf (and /proc/mdadm shows nothing useful) and I'd like to mount the filesystem again. So I've booted using rescue but I was wondering if I can do a command like this safely (i.e without losing the data previously stored).
mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sda1 /dev/sdb1
Where of course the raid devices and the /dev/x are the correct ones
I can't say this with 100% certainty but I would of thought that it would been fine. I've lost my mdadm.conf (reinstalled OS) with a separate 4 disk RAID 5 array and re-assembled the array and carried on as if nothing had happened.
Yes, I thought mdadm.conf wasn't really necessary these days and if the partitions are type FD (autodetect) the md devices are assembled before you'd be able to read /etc anyway. If your partitions aren't set to autodetect, you might be able to change that, reboot, and come up working.
Use "sudo mdadm -E --scan" do get a list of discovered RAID devices like this example:
ARRAY /dev/md0 level=raid0 num-devices=2 UUID=fde94900:3f3f3bf6
Pop the results in your mdadm.conf and that should sort you out after a reboot (I think). Also try something like "sudo mdadm --assemble /dev/md1 /dev/sdb1 /dev/sdc1" to assemble the RAID manually.
'cat /proc/mdstat' should show the status of the md devices and the partitons that are working so far.
On 12/31/2009 11:27 AM, James Bensley wrote:
I can't say this with 100% certainty but I would of thought that it would been fine. I've lost my mdadm.conf (reinstalled OS) with a separate 4 disk RAID 5 array and re-assembled the array and carried on as if nothing had happened.
Yes, in general, you don't need the mdadm.conf at all. As long as the array is built out of partitions marked as type "fd: Linux raid autodetect".
However, whenever CentOS installs a new kernel and initrd image file, it creates (or uses?) an mdadm.conf file within the initial boot environment. Back when I was migrating a server to a new environment, I had to unpack the image, edit that copy of mdadm.conf, and then repack it all in order to get a proper boot.
So I suspect (but am not certain) that the ARRAY lines in /etc/mdadm.conf are useless on a CentOS system but that the ARRAY lines inside the initrd image file are the real ones used. But the former may be used to generate the latter when you install a new kernel.