Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
My system did that too. But I noticed that it only happens for those md structures given a name. Those are recorded in /dev/md/<name>. When I created a second named device it was given a new
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.
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.
The kernel will do it on its own at boot time, and that will use md127, md126,...
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.
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.
or saying /dev/disk/by-id/ata-SAMSUNG_HD250HJ_S0URJADPC01495-part1 (though knowing the device model/serial is a bit long)
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.