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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20091231/84ef70c8/attachment.html>
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 onesI'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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20091231/cb83b5cc/attachment.sig>
>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 --scanThat'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...
2009/12/31 Luciano Rocha <strange at 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. -- Regards, James ;) Pablo Picasso - "Computers are useless. They can only give you answers." - http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html