Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My system is set up so that I take four devices, create a RAID 10 array out of them, create a physical volume, a volume group, and then three logical volumes, and lastly I create filesystems out of the logical volumes and mount them on my filesystem.

I know that mdadm.conf exists to locate (or maybe recreate?) the RAID10 device on a restart of the system, and I know that fstab exists to remount the logical volumes on the filesystem. However, I'm a little confused as to how to recreate the physical volume, volume group, and logical volumes on restart of the system. Is it the case that the volumes already exist on the RAID 10 device once it is located by its UUID and name so that I do not need to create them again, or is there some kind of configuration I need to set so that they are automatically created?

share|improve this question
    
If LVM is setup properly this should be automatic. The tools create signatures on the various partitions that are detected when the system starts. –  Zoredache Nov 1 '12 at 6:51
add comment

1 Answer 1

Newer versions of mdadm don't bother with mdadm.conf any more - they scan for superblocks and assemble what arrays they find. Most distros have a startup hook for this.

Once up, your arrays will contain inactive volume groups which, again, should be activated by LVM during startup. If not, the command

vgchange -ay

will enable all your volumes.

share|improve this answer
    
A couple questions: 1. How do I check whether a volume group is active or not? 2. If volumes are inactive on reboot, where can I put vgchange -ay so that it is called after the kernel locates the RAID device but before the filesystem in fstab is mounted? –  user730569 Nov 1 '12 at 17:57
    
Is your root, or a partition like /usr which you need at boot time, on LVM like this? –  Xyon Nov 1 '12 at 21:58
    
I don't think so. Looks like root is just an ext4 filesystem from the /dev/xvda1 device –  user730569 Nov 1 '12 at 22:37
    
But I'm honestly not sure, it's an Amazon Linux so a lot of stuff was preconfigured. –  user730569 Nov 1 '12 at 22:43
    
Also my system can no longer seem to locate the RAID device. When I run sudo mdadm -Q /dev/sdh1 the output is /dev/sdh1: is not an md array /dev/sdh1: device 0 in 4 device unknown raid10 array. Use mdadm --examine for more detail –  user730569 Nov 1 '12 at 22:49
show 8 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.