Jump to content

Linux Help RAID 5 with mdadm

Hi, i am trying to create an array using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu#creating-a-raid-5-array.

I followed the all the steps, at the bottom it says "Your RAID 5 array will now automatically assemble and mount each boot. You’re now finished with your RAID set up. If you want to try a different RAID, follow the resetting instructions at the beginning of this tutorial to proceed with creating a new RAID array type"

So i rebooted, I did a " df -h " command to see if my md0 was still showing but nothing, I checked the disks nothing, then I checked fstab, mdadm,config it still had all the infomation from the tutorial.

Where am i going wrong? Guys i am so lost, any help will be great

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Gotta say, use ZFS, it does a lot of raid stuff better in my option.

 

Does the mdadm array appear in lsblk. You might need to add the filesystem to fstab if you have't already.

 

But for mdadm, did you try following something like this https://superuser.com/questions/287462/how-can-i-make-mdadm-auto-assemble-raid-after-each-boot

 

I'm guessing that mdadm --scan will show the array, so adding the array to the mdadm conf file with mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, Electronics Wizardy said:

Gotta say, use ZFS, it does a lot of raid stuff better in my option.

 

Does the mdadm array appear in lsblk. You might need to add the filesystem to fstab if you have't already.

 

But for mdadm, did you try following something like this https://superuser.com/questions/287462/how-can-i-make-mdadm-auto-assemble-raid-after-each-boot

 

I'm guessing that mdadm --scan will show the array, so adding the array to the mdadm conf file with mdadm --detail --scan >> /etc/mdadm/mdadm.conf

lsblkit appear during/after the creation of array but not after the reboot.

 

I checked everything before reboot the UUID is correct when into the all the nano files in mdadm.config and fstab all the UUID and mnt location was spot on. But after reboot nothing.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Soonal said:

lsblkit appear during/after the creation of array but not after the reboot.

 

I checked everything before reboot the UUID is correct when into the all the nano files in mdadm.config and fstab all the UUID and mnt location was spot on. But after reboot nothing.

If its not appearing in lsblk after a reboot its that mdadm config issue. Try looking at that stack overflow page I linked earlier.

 

 

And really use ZFS, it makes this all easer and is better at keeping data safe.

Link to comment
Share on other sites

Link to post
Share on other sites

okay thank you 🙂, meaning use ZFS does that imply using UNRAID or FreeNas?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Soonal said:

okay thank you 🙂, meaning use ZFS does that imply using UNRAID or FreeNas?

ZFS is a filesystem that will work on basically any linux distro. You can use TrueNAS if you want a web gui.

 

What linux distro are you using?

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Electronics Wizardy said:

ZFS is a filesystem that will work on basically any linux distro. You can use TrueNAS if you want a web gui.

 

What linux distro are you using?

ubuntu 22.04. (24.04 doesnt support jellyfin yet 😞 )

 

Here some context that I would like to acheive with my server:
JellyFin server
Minecraft Server

personal website

Password manger

I thought ubuntu will have the best support for the projects I want to do

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Soonal said:

ubuntu 22.04. (24.04 doesnt support jellyfin yet 😞 )

 

Here some context that I would like to acheive with my server:
JellyFin server
Minecraft Server

personal website

Password manger

I thought ubuntu will have the best support for the projects I want to do

I'm curious what issues you run into on 24.04 with jellyfin. 

 

If you want a simple install TrueNAS would probably make it easier to setup.

 

 

But there are lots of guides for ZFS on Ubuntu.

 

MDADM should also be able to fix fairly easily by editing that config file.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Electronics Wizardy said:

I'm curious what issues you run into on 24.04 with jellyfin. 

 

If you want a simple install TrueNAS would probably make it easier to setup.

 

 

But there are lots of guides for ZFS on Ubuntu.

 

MDADM should also be able to fix fairly easily by editing that config file.

I got package error relating to "jellyfin-ffmpeg5", apologies this was 4-5 days ago. Tried a few work arounds didnt work so I went with the older version because I know a bud that runs his jellyfin on 22.04.

 

I will try the mdadm again, I will do a clean install/ build see where that goes

Link to comment
Share on other sites

Link to post
Share on other sites

Keep in mind using ZFS rather than MD is that you will not have the ability to add single disks to grow your RAID5 if thats something you wanted to do. 

Another alternative to using MDADM is just going hardware raid with a cheap controller like the LSI 9260-8i / 9271-8i. 

 

Getting back to MD; so in order to build your Raid...

- lsblk shows your block devices...that is your drives and their partitions. 

- mdadm is for managing your array (creating/reconfiguring/destroying/etc..)

- fstab is the linux configuration table used to more easily mount filesystems. 

 

 

So from what you're telling us; you successfully created your array using mdadm? 

Have you tried simply running 'sudo mount /mnt/md0' ? then check df -h and see if /mnt/md0 exists. 

 

If it gives an error then your fstab is incorrect. If you're using UUID like you say...that might be some weird thing going on.

Make sure you're using the correct UUID for the filesystem you're mounting and not the MD UUID. 

 

You can run this command to get the UUID:

sudo dumpe2fs /dev/md0 | grep UUID

 

Then check your fstab and make sure its using this UUID. 

 

e.g

 

$ sudo dumpe2fs /dev/md0 | grep UUID  
Filesystem UUID:          88d94438-db9d-4291-901c-45cd924a8041

$ grep boot /etc/fstab
UUID=88d94438-db9d-4291-901c-45cd924a8041 /mnt/md0 ext4 defaults,nofail,discard 0 0


 

 

 

Spoiler

Desktop: Ryzen9 5950X | ASUS ROG Crosshair VIII Hero (Wifi) | EVGA RTX 3080Ti FTW3 | 32GB (2x16GB) Corsair Dominator Platinum RGB Pro 3600Mhz | EKWB EK-AIO 360D-RGB | EKWB EK-Vardar RGB Fans | 1TB Samsung 980 Pro, 4TB Samsung 980 Pro | Corsair 5000D Airflow | Corsair HX850 Platinum PSU | Asus ROG 42" OLED PG42UQ + LG 32" 32GK850G Monitor | Roccat Vulcan TKL Pro Keyboard | Logitech G Pro X Superlight  | MicroLab Solo 7C Speakers | Audio-Technica ATH-M50xBT2 LE Headphones | TC-Helicon GoXLR | Audio-Technica AT2035 | LTT Desk Mat | XBOX-X Controller | Windows 11 Pro

 

Spoiler

Server: Fractal Design Define R6 | Ryzen 3950x | ASRock X570 Taichi | EVGA GTX1070 FTW | 64GB (4x16GB) Corsair Vengeance LPX 3000Mhz | Corsair RM850v2 PSU | Fractal S36 Triple AIO + 4 Additional Venturi 120mm Fans | 14 x 20TB Seagate Exos X22 20TB | 500GB Aorus Gen4 NVMe | 2 x 2TB Samsung 970 Evo Plus NVMe | LSI 9211-8i HBA

 

Link to comment
Share on other sites

Link to post
Share on other sites

Hi guys, i have been having some issues with create a raid5 using mdadm.

 

I got some used wd red drives from ebay. I plugged them via sata did mdadm. When i would do a reboot to make sure the raid has mounted properly, I would get a recovery mode cycle. When i did the windows checkdisk command it said it had some back sectors in them, I did a "fix" reformatted them into ext4, put them back into linux, created another array, it didnt stick recovering mode boot cycle happened again. Got tired and returned the disks.

 

Now, I bought some cheap Sandisk usbs to test to make sure im not going crazy and doing the install mdadm correctly (before install new out of the box drives) when i run the command " mdadm --detail /dev/md0 " the, everything seems correct except the state which says : "active,degraded,recovering" whichh does seem correct because these are brand spanking new usbs A 2.0. The state of the wd red drives said the same thing "active.degraded,recovering " does that imply its something else?

 

Also the USBs have been partitioned to use 60 out of 64GB. 3 drives in RAID 5. 

 

Yes they are plugged directly on to the motherboard (in USB A 3.x), the motherboard does not have any usb A 2.0 on the rear io 😞

 

Guys what the heck im doing wrong, i am pretty close to using UNRAID but this should work, I have followed multiple tuts see links below:

 

https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu

https://www.jeffgeerling.com/blog/2021/htgwa-create-raid-array-linux-mdadm

 

Also when i do the " sudo mdadm --detail--scan >> /etc/mdadm/mdadm.conf" it adds the UUID of the sdc, not md0 which i find odd, in yt tutorials they UUID is the md0 drive. I have done multiple clean installs  so not sure whats happening there

 

computer specs:

i759-60x

970 gpu

ddr4 16gb 2133 crucial

nvme boot driveShellcommandsonlycantfindraidmd0.thumb.jpg.9b542008716a28e03f17d6e10b18f516.jpgrecoverycycle.thumb.jpg.dd2fb5773d1979851555a1c03d9c4eac.jpgDrivestatesmdadm.jpg.d974cf03199111b01f2ecd020df0a8e0.jpgcantfindraiderrorondrives.thumb.jpg.18abb9955598605f5bcfb398dc20292b.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/14/2024 at 12:58 AM, Jarsky said:

Have you tried simply running 'sudo mount /mnt/md0' ? then check df -h and see if /mnt/md0 exists. 

 

Thanks for the reply,
 

"sudo mount /mnt/md0" doesnt work i have to do "sudo mount /mnt/md0 / mnt/raid" (raid being the folder for all the files for raid)

 

can you clarify what you mean by this "Make sure you're using the correct UUID for the filesystem you're mounting and not the MD UUID."

 

So in the fstab you dont put the UUID for the md0?

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/18/2024 at 6:28 AM, Soonal said:

Thanks for the reply,
 

"sudo mount /mnt/md0" doesnt work i have to do "sudo mount /mnt/md0 / mnt/raid" (raid being the folder for all the files for raid)

 

can you clarify what you mean by this "Make sure you're using the correct UUID for the filesystem you're mounting and not the MD UUID."

 

So in the fstab you dont put the UUID for the md0?

 

Do you mean /dev/md0?

So if mount /mnt/md0 doesnt work, but doing mount <target> <device> does, it means your fstab is wrong. 

So we don't need to touch MD; we just need to correct your fstab

 

There are UUID's for multiple reasons; its just a Universal Identifier. We do not want the UUID for /mnt/md0; because that is superfluous;

We need the UUID for the array (device). 

 

I outlined earlier how to correct this. 

 

$ sudo dumpe2fs /dev/md0 | grep UUID  
Filesystem UUID:          88d94438-db9d-4291-901c-45cd924a8041

$ grep boot /etc/fstab
UUID=88d94438-db9d-4291-901c-45cd924a8041 /mnt/raid ext4 defaults,nofail,discard 0 0

 

Ultimately you could probably just forget about UUID and just use the block device name...this is generally what i do. 

UUID's are more important when you're dealing with mounting multiple disks etc...as the  block device name might change when you're changing disk configurations. But your /dev/md0 will always be /dev/md0 (unless you change it yourself). 

 

$ grep boot /etc/fstab
/dev/md0 /mnt/raid ext4 defaults,nofail,discard 0 0

 

Spoiler

Desktop: Ryzen9 5950X | ASUS ROG Crosshair VIII Hero (Wifi) | EVGA RTX 3080Ti FTW3 | 32GB (2x16GB) Corsair Dominator Platinum RGB Pro 3600Mhz | EKWB EK-AIO 360D-RGB | EKWB EK-Vardar RGB Fans | 1TB Samsung 980 Pro, 4TB Samsung 980 Pro | Corsair 5000D Airflow | Corsair HX850 Platinum PSU | Asus ROG 42" OLED PG42UQ + LG 32" 32GK850G Monitor | Roccat Vulcan TKL Pro Keyboard | Logitech G Pro X Superlight  | MicroLab Solo 7C Speakers | Audio-Technica ATH-M50xBT2 LE Headphones | TC-Helicon GoXLR | Audio-Technica AT2035 | LTT Desk Mat | XBOX-X Controller | Windows 11 Pro

 

Spoiler

Server: Fractal Design Define R6 | Ryzen 3950x | ASRock X570 Taichi | EVGA GTX1070 FTW | 64GB (4x16GB) Corsair Vengeance LPX 3000Mhz | Corsair RM850v2 PSU | Fractal S36 Triple AIO + 4 Additional Venturi 120mm Fans | 14 x 20TB Seagate Exos X22 20TB | 500GB Aorus Gen4 NVMe | 2 x 2TB Samsung 970 Evo Plus NVMe | LSI 9211-8i HBA

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×