![]() |
VOOZH | about |
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
RAID allows you to manage separate storage drives as a unified device with better performance or redundancy properties. In this series, weโll walk through RAID concepts and terminology, create software RAID arrays using Linuxโs mdadm utility, and learn how to manage and administer arrays to keep your storage infrastructure running smoothly.
Browse Series: 3 tutorials
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Last step editing the fstab echo โ/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0โ | sudo tee -a /etc/fstab
should be
echo โ/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 2โ | sudo tee -a /etc/fstab
The 2 in the 0 space allows the system to boot the main os first then the array after. If left to 0 there is reports (and experienced myself) of the array not assembling in enough time before the system fully boots resulting in the nofail trigger to never report why it did not load. This is shown here fstab(5) - Linux manual page (man7.org)
Hi, thank you for this awesome tutorial (and others).
On a new Ubuntu 22.04 install I created a RAID 10 array per your code (sudo mdadm --create --verbose /dev/md0 --level=10 --layout=f2 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd) using f2 for a far/2-copies setup on a 4Tb x 4 array to get approx. 8Tb. Iโve created/mounted/saved per all of your instructions. I also set USB shares to mount at /media/ instead of /media/user/ per this tutorial. I started yesterday afternoon and currently when I run โcat /proc/mdstatโ the resync = 13.7%.
My 2 questions, please and thank you:
Do I need to keep this computer on until the resync is finished, or can I reboot and assume it will continue where it left off?
At what point can I add md0 to Samba and start copying data onto the new array?
Newbie here, sorry:(
OK so I have followed this how-to several times now but seem to have ongoing issues with the array stability? Today I went to access the array as I had copied 1.5TB of data to it and it wasnโt accessible? Said the super block was unreadable and I could not save the array. So now I am rebuilding it again as a Raid 6 volume. Currently waiting for the build to finish. I read the comment below about changing the 0 to a 2 so that the array would load at boot time and used that config. Is this causing me issues? I am running Ubuntu 22.04.3 LTS with a 256gb SSD OS drive and the 4 834gb SSD drives for the array which gives me a 1.7tb disk for storage. I am not a big Linux guy my day job is Windows admin so this stuff is a bit foreign to me. I am using this as a Photoprism photo respository and donโt want to get all my photos on the array only to lose them down the road? Any help is much appreciated.
After following this guide for RAID 0 my RAID was not coming up automatically after reboot. I created the RAID on the partition instead of the device (used sda1 instead of sda) and itโs working now.
There should be a section added to resetting devices. For drives that were formatted GTP there is a possibility that they will loose their superblock upon reboot causing the array to fail. This can be cleared off by sgdisk --zap /dev/sdX I spent a few days trying to figure out why my raid5 array wouldnโt survive reboot. This fixed the problem by clearing whatever corrupted partition data was on the drive.
First, congrats on and thanks for an excellent article. Just what I need, as I want to implement a software raid at home.
I hate to be pedanticโฆ
You have a typesetting issue above. In the code boxes, up in the first section on resetting the drives for the array, when you show a pathntame, such as /dev/sda, or /dev/whatever, your html causes a gap to appear that looks like a space between /dev/ and whatever follows. This looks to a beginner like a space. If you use the copy button, or copy manually, the path is correct in the copy buffer, but if you are retyping, you may be tricked into thinking that there is an extra separate argument.
The HTML is more intricate right there.
<span class="token parameter variable">--stop</span> /dev/<mark>md0</mark>
Itโs the <mark> that does it.
This is on Chrome using a Chromebook.
Hi team,
If I got this heading where if I copied it, it will link up to the wrong heading
It will link to:
It needs to link to the sub heading in here as I am using RAID1 only, thanks.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.