SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Installed Slack64-current from Eric's 1.3.19 iso (thank you Eric) on an mdadm raid 1 array (two 3TB drives). md0 lives on /dev/sda2 /dev/sdb2. Installed grub on sda and sdb and created an /etc/mdadm.conf file which looks proper. Rebooted (array was still syncing) and I get the grub prompt, select 4.19.26 kernel, boot starts with the large font, screen goes black after a bit and boot info is displayed on a smaller font. Boot continues briefly and then terminates with an error stating that it can't run fsck on the boot partition. Take offer to go to repair mode and look in /dev and strangely there is no md0 any longer and the ubiquitous md127 has appeared which explains the error.
Boot Knoppix 8.1, chroot to the broken system. mdadm.conf looks fine.
Anyone know how I get md0 back??? I've done a lot of searching and everything I try goes belly up. Have come across references to update-initramfs -u but Slackware doesn't have one.
From the default generated mdadm.conf that resulted in my devices names taking the form md12x, they were changed to the form md[0-n] by modifying mdadm.conf to take the following form:
I had this problem on several occasions. I used Lilo with a small RAID 1 partition for /boot and never seemed to get it right. Couldn't figure out a definitive solution to this md127 re-assignment problem.
Here is how I do mdadm RAID1 on the system disk now. It entailed moving from Lilo to the monstrosity that is Grub, and to a different partitioning scheme, but it has not failed me since.
Create a BIOS Boot Partition (type EF02) on each disk (I have Legacy BIOS selected in the UEFI firmware, and I use GPT partitioning). 2MB is supposed to be enough but I leave it at 4.
(As far as I remember the BIOS Boot Partition type shows up in gdisk/cgdisk only if you choose GPT partitioning. I'm not aware of a compelling reason to prefer MBR over GPT these days anyway.)
If you don't want to use LVM then you need to create separate RAID partitions if you want to separate /home and / (but don't create a separate RAID 1 partition for /boot).
If you intend to use LVM on top of mdadm, it is sufficient to fill the remainder of each disk with just a single partition for your array. Assign type Linux Filesystem (type 8300) to this partition - no need for RAID Autodetect. Make sure each disk has exactly the same partitioning scheme.
As @majekw said, you could use a UUID - but really then you end up with very cryptic and unreadable fstab files. Just label the partitions uniquely and then use /dev/disk/by-label/xxx where xxx is something like "ROOTMIRROR", or "RAID5MEDIA" etc
As @majekw said, you could use a UUID - but really then you end up with very cryptic and unreadable fstab files. Just label the partitions uniquely and then use /dev/disk/by-label/xxx where xxx is something like "ROOTMIRROR", or "RAID5MEDIA" etc
But in reality, the fstab is only as cryptic as you make it. Sure, UUIDs don't specify what the drive is, but your mount points or comments should help with that. I personally can't use labels unless I'm willing to use temporary labels as I'm swapping out drives. I much prefer UUIDs for my use case. Here's my /etc/fstab:
I personally can't use labels unless I'm willing to use temporary labels as I'm swapping out drives. I much prefer UUIDs for my use case.
You could do as I do and not have that limitation. I do a lot of disk and partition cloning and disk swapping. I don't use use HOME as the label for the filesystem mounted on /home/. I include a partition number and or a piece of the drive's name or serial number. e.g. home09h8s is the label on host big41. sda9 is the partition. h8s is the last three digits of the whole drive's serial number.
You could do as I do and not have that limitation. I do a lot of disk and partition cloning and disk swapping. I don't use use HOME as the label for the filesystem mounted on /home/. I include a partition number and or a piece of the drive's name or serial number. e.g. home09h8s is the label on host big41. sda9 is the partition. h8s is the last three digits of the whole drive's serial number.
Sure, there's various ways to mitigate my issue, but I prefer having my drives labeled a specific way. When I'm moving that data to a newer, bigger harddrive, I still like to use the same label. It makes things look nice and uniform in dolphin's left hand pane. And I don't have my root or home partitions labeled, since there's direct links already in dolphin for those.
EDIT: I should mention... it's not wrong to do labels in the fstab, just as it's not wrong to do UUIDs (or keeping the original device names, assuming they don't change). I am not trying to sway anyone a specific way, just providing information so people can make their own decision. I prefer using UUIDs in my fstab, because I feel it makes my workflow easier. That will not be the case for everyone.
Last edited by bassmadrigal; 03-05-2019 at 12:21 PM.
I had a similar problem some time ago. I blamed changing the kernel but I was not sure at the time and even less so now. However my solution was simple.
Code:
mdadm --stop /dev/md127
mdadm --stop /dev/md0
mdadm -A --scan
When it did an auto scan second time around it worked!
If you are using an initrd, make sure that the mdadm.conf that's part of the initrd is either empty (the default file isn't empty) or contains the correct values for your array. Otherwise, udev will create the md device using the high numbers.
mdadm --stop /dev/md127
mdadm --stop /dev/md0
mdadm -A --scan
This solution works for me, too.
I'm not sure why it got renamed to md127 in the first place, though, or whether it might get renamed again.
In my case it's not the boot/root filesystem, so I can play silly scripting tricks to mount it as md0 or md127, but knowing the root cause would be nice.
The reason is that since some version of mdadm, it checks 'homehost' of an array during assembly.
Hostname is set in Slackware during 'normal' boot after initramfs finishes, but arrays get assembled by mdadm in initramfs when hostame is still unknown.
So, mdadm in initramfs assembling array have mismatch between hostname (still darkstar) and homehost part written in array metadata. Then it treat such mismatched array as 'foreign' and deny assigning proper device number.
That's why putting mdadm.conf with array definitions into initramfs works (you just force mdadm to assemble array in exact way as specified in config).
And that's why assembling array while system is normally running also works, because there is no more hostname/homehost mismatch.
Probably (I didn't test it) should work also if mdadm.conf have only one line:
First of all many thanks to all of you for the wealth of information you provided. After doing some more checking it is looking like there may be a hardware problem. I will try to ferret that out first before creating a raid array again. Again, thank you all for taking the time to respond. Will be back when hw is sorted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.