Basic RAID (discussion) - using mdadm software on Linux

Status
Not open for further replies.

anneranch

Active Member
Joined
Mar 16, 2019
Messages
223
Reaction score
43
Credits
2,078
I am posting a new thread about general RAID.
(if it is OK with management )
I like to keep the discussion on target I like to post a question and
have forum to discuss / answer it.
( Side trips are OK but keep on subjects. )

1. After array is "--create" How is it mounted ?
mkdir and mount ?


2. What / where is this mount saved ?
I have
/etc/mdadm
and
/etc/ mdadm/ mdadm.conf

(I assume mdmad.conf ) ?

3. Do I have to reboot to make mount effetive?

4. if I edit mdadm.conf , do I have to reboot to make
it to take effect?
 


Here's a link to a good step by step on how to build, create the file system, mount a raid array and more.

 
Here's a link to a good step by step on how to build, create the file system, mount a raid array and more.

Thanks , however , I have used that link already.
Unless I missed it , it does not answer my questions.

What I really need is to find a way to recover inaccessible array.

It cannot be simply "--create" beause the old devices are "busy" .

Ideally if I can find out to what "md" the old partitions belong.

The fstab and mdadm.conf both show the old array as /dev/md/30" but then
report "no such file" ( But I think I am crossing to the other post ....)

So back to my current questions , as posted.
 
If the md devices show up in the fstab, more than likely they're being mounted at boot. If they're mounted, they're busy.
If they show up when you run df from the command line. You can comment them out in the fstab and reboot.

You can tell which disks belong to which array by using this:
cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md1 : active raid1 sdb3[1] sda3[0]
19542976 blocks [2/2] [UU]

md2 : active raid1 sdb4[1] sda4[0]
223504192 blocks [2/2] [UU]

If the mdstat file isn't there use this:
ls -l /dev/md?

That will show up to 9 md devices.

Use this to look at each device md0, md1 etc...
mdadm --detail /dev/md0
mdadm --detail /dev/md1
etc...


As far as recovering an array, depending on what level of raid and how many disks you're using it can be quite a challenge.
I hope this helps
 
If the md devices show up in the fstab, more than likely they're being mounted at boot. If they're mounted, they're busy.
If they show up when you run df from the command line. You can comment them out in the fstab and reboot.

You can tell which disks belong to which array by using this:
cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md1 : active raid1 sdb3[1] sda3[0]
19542976 blocks [2/2] [UU]

md2 : active raid1 sdb4[1] sda4[0]
223504192 blocks [2/2] [UU]

If the mdstat file isn't there use this:
ls -l /dev/md?

That will show up to 9 md devices.

Use this to look at each device md0, md1 etc...
mdadm --detail /dev/md0
mdadm --detail /dev/md1
etc...


As far as recovering an array, depending on what level of raid and how many disks you're using it can be quite a challenge.
I hope this helps
Yes it does - confirming that fstab is read on boot...
Now what the heck we need mdadm.conf ?

Unfortunately my loss is of md varitety - lsblk is only telling me I have RAID /dev and no md number / name.... so I cannot look at md since I have none - except in mdadm,conf .

Just noticed something more and here are my results :

qy@qy-desktop:~$ ls -l /dev/md?
brw-rw---- 1 root disk 9, 0 Jan 5 18:54 /dev/md0
brw-rw---- 1 root disk 9, 1 Jan 5 18:54 /dev/md1
brw-rw---- 1 root disk 9, 3 Jan 5 18:54 /dev/md3
brw-rw---- 1 root disk 9, 5 Jan 5 21:21 /dev/md5


Only md5 is currently working as it should .

I am not sure about md 0,1,3

I should have /dev/md10 also in the output...


Can you tell me how to "attach files " - say result of lsblk running terminal .
Do I have to copy to libreOffice and send pdf ?



Update
ls -l /dev/md*

asterisk gives me ALL RAID numbers and names

THANKS
 
mdadm --detail --scan > /etc/mdadm.conf
qy@qy-desktop:~$ sudo mdadm --detail --scan > /etc/mdadm.conf
bash: /etc/mdadm.conf: Permission denied
qy@qy-desktop:~$ mdadm --detail --scan > /etc/mdadm.conf

besides - I have /etc/mdadm/mdadm.conf and get same permission denied
 
OK , I have created mount point and attempt to mount the
new md25 array.
I have buidl the array copying existing , wiht data, partiton.
"--created " reported a file system xyz.
Now I get "no valid NTFS " - I do not wnat NTFS - that is windoze
I neex ext4 and DO NOT WANT to loose the data....


qy@qy-desktop:~$ sudo mount /dev/md25 /mnt/md25
[sudo] password for qy:
NTFS signature is missing.
Failed to mount '/dev/md25': Invalid argument
The device '/dev/md25' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
qy@qy-desktop:~$

Here is my current state of md25 - it shows USED
so I am assuming it contains data.

How do I access the array to make sure - without taking a chanse
to loose data by mounting the array ?


/dev/md25:
Version : 1.2
Creation Time : Thu Jan 6 12:32:58 2022
Raid Level : raid5
Array Size : 21983232 (20.96 GiB 22.51 GB)
Used Dev Size : 7327744 (6.99 GiB 7.50 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent

Update Time : Thu Jan 6 12:39:37 2022
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Consistency Policy : resync

Name : fileserver:25 (local to host fileserver)
UUID : 88c11837:4cd53b5d:5501f428:38133fb0
Events : 18

Number Major Minor RaidDevice State
0 8 60 0 active sync /dev/sdd12
1 8 61 1 active sync /dev/sdd13
2 8 62 2 active sync /dev/sdd14
4 8 63 3 active sync /dev/sdd15
qy@qy-desktop:~$


BTW - disclaimer
this is all academic / testings to learn about RAID
no real data has been harmed - so far .
 
Status
Not open for further replies.

Members online


Latest posts

Top