mdadm created raid devices changed name
hi all
I used mdadm to create two raid devices, md0 which is a 10G stripped (2x5G) and md1 which is 5G mirrored (2x5G). I mounted them using the mount command and tested them out and it seems to work just find. Then I rebooted the VM and I found that the under /dev, they are no longer named md0 and md1, but md126 and md127. Why is that? Thanks EDIT: using ubuntu 15.04 |
What is in your mdadm.conf?
|
Try running
Code:
sudo update-initramfs -u |
Quote:
number - and after reboot, the first created became /dev/md126, and the second /dev/md127. It didn't happen when I created some test md devices (or if I forgot to put a name I wanted). It makes it look like the small numbered md device names are saved for unnamed devices. I also saw that a /etc/mdadm.conf was not necessary. The devices are created via UUIDs, and organized by the kernel scanning for md devices. The /etc/mdadm.conf can be used to try to rebuild after a disaster, but is not normally used for anything. I didn't create mine until well after both md devices were created (and after several successful reboots). I used the /dev/md/<name> to remind me which device I was dealing with (fsck/mkfs/partitioning/...) rather than try to remember which /dev/md[0123...] or which ever I was working on. I find it harder to have a typo with /dev/md/medialib. Much better than accidentally wiping out a home filesystem or something else important. Quote:
|
thanks for the reply guys. It does seem to be that md0 through 125 is already used for something else and it automatically renames them to md126 or higher. I just wish it would remember to automatically edit the /etc/fstab too. or a dynamically created softlink for the new directory.
EDIT: the underlined statement is wrong. I just rebooted it again and it changed it back to md0 and md1. F**DFKJEIJSF#(!0R(9e8tq0938euf89adsvhjdio newlkrjntgwoeiuv9oaducv iosdjch ck bdslkjvw. |
To make it permenant I had to do this:
http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/ Code:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf |
Quote:
In either case, it doesn't matter to me. I mount using volume labels (or UUID) as the only stable names available during the device scan in the initrd. |
yeah, suppose I should start using UUIDs too. This is just a play setup so not too important. Honestly UUID is too long. 727cac18-044b-4504-87f1-a5aefa774bda all that just to say /dev/sdb1.
|
Quote:
Which is why I like volume labels. There is also a PARTUUID which is much shorter (11 characters); and you can always specify a short UUID as well (which is why I prefer the volume label). I just find UUIDs hard to remember; but something like "mount LABEL=archive /mnt" is easy (or using /dev/disk/by-label/archive), doesn't depend on the device name (which can change), and reliable. for fsck (and md devices) I like being able to use /dev/md/mmedia and know I'm referring to the right device (whether it is /dev/md0..1 or md126 or md127). |
All times are GMT -5. The time now is 09:00 PM. |