Recover Raid+LVM on non system drives after system failure
I have (had) Debian Testing running on a 250GB IDE hard drive, partitioned normally.
I also have 4x 1TB drives in a raid 5 using mdadm, and 2x 500GB drives in a raid 1 also with mdadm. I put the two arrays in lvm using: # pvcreate /dev/md0 /dev/md1 # vgcreate storage /dev/md0 /dev/md1 I then used "lvcreate" to make storage/backup 300GB, and the rest went to storage/media (approx. 2TB usable). I put an xfs filesystem on both and mounted them. All was working fine until the system drive shorted out and died on me this morning. As far as I can tell, all my other drives and everything else is fine. I do a daily rsnapshot of the filesystem, which of course is residing on storage/backup (stupid, I know). So I have full backups of everything, but I'll have to put a new hard drive in and reinstall Debian before I can restore everything. I've reinstalled before and simply reassembled mdadm arrays and remounted them before with no problems, but this is the first time I've used lvm, so I'm not sure what I have to do to restore everything. Is it as simple as reinstalling the system then doing a: # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 # mdadm --assemble /dev/md1 /dev/sdf1 /dev/sdg1 # vgchange -a y I've googled and didn't have a whole lot of luck figuring out if that last command is the right one, but is that what I would need to do to restore/recreate the lvm? Any advice would be appreciated. Mike |
Greetingz!
I've been in your shoes before; during my experience (RHEL5), the OS will notice the RAID arrays on boot, then it will do a "vgscan" (I think). I swear I was never more impressed when an LVM-managed 4x1TB RAID10 array came online of it's own accord! However, it's been *ages* since I've done anything with Debian, but I'd assume it would have evolved enough startup scripts to detect and setup the RAID arrays (at the very least). You might want to check the "vgscan" manpage though. Good Luck! |
Quote:
Thanks again. Mike |
Quote:
If I were you, I would label the drives and the data connections (SATA cables or IDE ribbons), then disconnect them before you do the OS install. |
Quote:
Mike |
All times are GMT -5. The time now is 09:29 AM. |