LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-09-2021, 06:22 PM   #1
jan128
Member
 
Registered: Nov 2020
Posts: 201

Rep: Reputation: Disabled
How to implement RAID - for real


This is not a question, just sort-off plea for assistance.
I am having a heck of a time implementing RAID.
There are tutorials , mostly based on "mdadm" and incomplete.

This is what works - sort off - not necessarily in proper sequence

1. Use gpatred to add /dev/sdx -
assign "raid" flag to it
2. Use mdadm to --create RAIDx
3. Use Disks to mount /dev/sdx and /dev/mdx
4. Use gparted to create /dev/mdx partion type and
create /dev/mdx partiton - not sure when
4. (Test) copy something to ONE of the /dev/sdx
5. Use mdadm to watch for smoke

However the most challenging part is that RAID uses SEVERAL valid / legal designations:

"standard " Linux /dev/sdx
mdadm CAN assign /mdx or /name
gparted WILL change at random from /md1 to /md127 or /name
Disks by default uses uuid - name, icon name , icon symbol optional
Ubuntu file manager goes by Name or Label - assigned by user in gparted
or UUID assigned by Disks - impossible to track.

And I'll skip mount point for now.

Any suggestions how to manage this mess?
Post-it notes ?


Besides the old doctor's joke:

"doctor - it hurts when I do this..."
"soo don't do that !"
 
Old 02-09-2021, 06:33 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Start here, it is valid for all Linuxes, not only Ubuntu.
 
Old 02-09-2021, 07:14 PM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,620

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
If you want it to be FEAKISHELY easy, read up on BTRFS! BTRFS does RAID (0, 1, 10 at least, newer version do 5 and 6 but with some cautions) without MDADM or LVM helpers.

BUT, using it is a totally different animal from using MDADM.
 
Old 02-09-2021, 07:28 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
btrfs has supported 5/6 for years - regardless of the doom-sayers. But I wouldn't recommend it to the OP.
For some time LVM has had native (i.e. not requiring mdadm) RAID - super easy to implement and add devices, as well as policies that kick in in the event of a device failure. I use it on my pi3 router/filewall for instance for the simplicity.
 
Old 02-09-2021, 08:03 PM   #5
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
btrfs has supported 5/6 for years - regardless of the doom-sayers. But I wouldn't recommend it to the OP.
For some time LVM has had native (i.e. not requiring mdadm) RAID - super easy to implement and add devices, as well as policies that kick in in the event of a device failure. I use it on my pi3 router/filewall for instance for the simplicity.
Nice, found this
https://lwn.net/Articles/577961/

Now for real stupid question.
Briefly scanned the article and it looks as the /dev/sdx still has to be "assigned' before btrfs is used, right?
I'll give it a go - for test purpose on same HDD. Later.
 
Old 02-09-2021, 08:11 PM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
In case you like BTRFS you may also have a look at ZFS.
 
Old 02-09-2021, 09:50 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
The link posted by emerson in post 2 is the best guide. Ideally you want to use new blank disks with no partitions of any type on them.

Using mdadm requires that it be able to create the raid metadata in the partition table area of the disk so they need to already be blank or you can manually blank that area.

raid 0 & 1 require a minimum of 2 devices, raid 5 requires a minimum of 3 devices, raid 6 & 10 require a minimum of 4 devices.

I recently assisted another individual to create a raid array for use with a media server using mdadm.

I do recommend that you not even consider anything with btrfs for raid at present.

Last edited by computersavvy; 02-09-2021 at 09:52 PM.
 
Old 02-10-2021, 08:27 AM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,620

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
I want to add that no matter what you do with RAID it does not replace BACKUPS. Raid can either provide performance benefits, or protect you from single storage device (or select dual device) failure. It does not protect you from data corruption, storage SYSTEM failure, or server failure that corrupts or destroys the contents of the storage devices. It clearly does not protect you from catastrophic failures from teh environment, such as fire, flood, cats, etc. If the data matters, if it has value, back it up two different ways (or more) using offsite generational backup images and verify your backups often.
 
Old 02-10-2021, 09:00 AM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Amazingly enough my storage survived flood. All equipment was under water for a week in 2016 during Louisiana historic flood - I did not expect 6 feet water in my house and did not put my stuff in the attic. My Intel NUC lost infrared receiver, I emailed Intel and asked what was the type of it, intending to solder a new one in. Intel replaced my NUC for free, even paid shipping! My Supermicro based server with ECC RAM and 6 hard drives works again, did not have even to replace the power supply. Indeed, I took everything apart and cleaned thoroughly before powering up, it was lots of work, but it paid off in the end. And all other computers also survived.
 
Old 02-10-2021, 09:02 AM   #10
TorC
Member
 
Registered: Dec 2020
Location: as far S and E as I want to go in the U.S.
Distribution: Fossapup64
Posts: 224

Rep: Reputation: 78
+1 -- ZFS
I believe it is an install option, at least in some 'buntu derivatives (like enchantment 20.04.1). Just be aware of the costs vs benefits

+1 -- backups!
 
Old 02-10-2021, 09:15 AM   #11
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
I went for KISS, used mdadm to create new TEST RAID 5 array,
sudo mdadm --create --verbose /dev/md10 --level=5 --raid-devices=3 /dev/sda19 /dev/sdb9 /dev/sdg27

Yes, I added small /dev/sdx first using gparted.

Did no format, didn't added "raid" flag, did not mess with Label nor Name , did not use Disks to mount.
Just run "create " , waited for "recovery " to finish and then run -detail.


Quote:
@a-desktop:~$ sudo mdadm --detail /dev/md10
[sudo] password for a:
/dev/md10:
Version : 1.2
Creation Time : Wed Feb 10 08:02:59 2021
Raid Level : raid5
Array Size : 2043904 (1996.00 MiB 2092.96 MB)
Used Dev Size : 1021952 (998.00 MiB 1046.48 MB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent

Update Time : Wed Feb 10 08:03:58 2021
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Consistency Policy : resync

Name : a-desktop:10 (local to host a-desktop)
UUID : 3fee7915:97923e1c:5165ee2e:3e5191c5
Events : 18

Number Major Minor RaidDevice State
0 259 3 0 active sync /dev/sda19
1 8 25 1 active sync /dev/sdb9
3 259 22 2 active sync /dev/sdg27
a@a-desktop:~$
Let me restate - this is just a RAID TEST.

I would prefer NOT to discuss pro and cons of RAID any more.
Yes, I can do variety of "save /backup" - my C IDE does one when optioned.

I used RAID when windowze was introduced and it did the job.
I am little stubborn and want the Linux RAID to work as expected ON FIRST TRY . I do realize there are holes in my procedures - mainly identifying the hardware and setting mount points at correct time.

My current dilemma / question is
I have a working / functioning RAID array - according to mdadm, but

my file manager does not let me to write anything to the RAID5 array BECAUSE
I cannot identify the /dev/sda19 ( for example )
WHY ?

.... fill in blank....

PS
At present "Disks" won't let me change / add /modify ANY RAID devices mount points - including the "/dev/md10 "

PPS
I case it is not clear - RAID technology works, it is my procedure which is incorect and "buy a new computer" is not a solution.

PPPS
I'll try other method (AKA new computer ) AFTER I fix RAID
 
Old 02-10-2021, 09:37 AM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
In another thread I told you about filesystem. Where did this piece of knowledge go. A black hole aka /dev/null ?
 
Old 02-10-2021, 12:11 PM   #13
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by jan128 View Post
I went for KISS, used mdadm to create new TEST RAID 5 array,
sudo mdadm --create --verbose /dev/md10 --level=5 --raid-devices=3 /dev/sda19 /dev/sdb9 /dev/sdg27

Yes, I added small /dev/sdx first using gparted.

---snip

My current dilemma / question is
I have a working / functioning RAID array - according to mdadm, but

my file manager does not let me to write anything to the RAID5 array BECAUSE
I cannot identify the /dev/sda19 ( for example )
WHY ?

.... fill in blank....

PS
At present "Disks" won't let me change / add /modify ANY RAID devices mount points - including the "/dev/md10 "
You created the raid device, /dev/md10
Now you need to
1. create a partition on it,
2. then format the file system there,
3. then mount it.
in that order.

Disks is a gui that can only handle the physical devices and cannot access the raid device. (Its name tells you that)

Use gparted (a gui partitioning tool) which can handle the raid device (/dev/md10) to create the partition and format it.
Or
Use gdisk (a cli partitioning tool) which can create the partition but does not format it. Gdisk would have to be followed by fsck.ext4 to format the partition.
The command "gparted /dev/md10" will get you started there.

Once partitioned and formatted you still will have to manually create the mount point and mount the file system before you can access it.

GUI tools like disks are great !!!,
--- until they cannot do what you need done....

Then you need to go back to the cli to do what the gui is not designed for.

Last edited by computersavvy; 02-10-2021 at 12:45 PM.
 
1 members found this post helpful.
Old 02-10-2021, 06:13 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
my file manager does not let me to write anything to the RAID5 array BECAUSE
As posted many many times you can not use the RAID until it formatted with a file system and mounted. To mount the RAID once formatted you use its device ID i.e. /dev/md10 or its filesystem's UUID.

As far as I know and still true that you can not partition a RAID device unless it is created with --auto=mdp option.

https://raid.wiki.kernel.org/index.p..._/_LVM_on_RAID
 
Old 02-10-2021, 09:19 PM   #15
jan128
Member
 
Registered: Nov 2020
Posts: 201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
You created the raid device, /dev/md10

Problem:
When I use "gparted" and create (sizeable ) /dev/sdx devices and then
use "mdadm --create...." it starts "recovering" hence

there is no way to use gparted until mdadm is done "recovering" empty /dev/sdx array.
Solution :
take a break...

Now you need to
-2. access gparted , select "dev/mdx"
-1. build partition table type
0. now you are cooking

1. create a partition on it,

2. then format the file system there,

since the newly created partition has "file type assigned "
not sure if that is necessary , but it won't hurt

3. then mount it.
gparted at that point has no option to mount /dev/mdx
so I switch to "Disks" to mount /dev/mdx , choose
"mount on startup / reboot"
and do so.

I have not figured out how NOT to have to reboot to make the mount configured / setup in Disks stick.

BUT
just "discovered" today Disks have option to SELECT how the mount point is going to show up elsewhere

bye bye UUID (assigned by default by Disks) and good riddance !

UUID is still there, but now I have humanly readable interface value !


in that order.

Disks is a gui that can only handle the physical devices and cannot access the raid device. (Its name tells you that)

not true , it actually is the key to my (partial) success



Use gparted (a gui partitioning tool) which can handle the raid device (/dev/md10) to create the partition and format it.
Or
Use gdisk (a cli partitioning tool) which can create the partition but does not format it. Gdisk would have to be followed by fsck.ext4 to format the partition.

The command "gparted /dev/md10" will get you started there.

Really ?


Quote:
@a-desktop:~$ sudo gparted /dev/md10
Unit boot.mount does not exist, proceeding anyway.
Unit tmp.mount does not exist, proceeding anyway.
GParted 1.0.0
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.3
/dev/md10: unrecognised disk label
a@a-desktop:~$
And of course it opens gparted GUI and "select /dev/md10" and you can start over - again from 0. Fun.
Actually I wonder how mdamd --detail /dev/md10 looks now? Checked - it is (still) clean.

Once partitioned and formatted you still will have to manually create the mount point and mount the file system before you can access it.

GUI tools like disks are great !!!,
--- until they cannot do what you need done....

Then you need to go back to the cli to do what the gui is not designed for.

In (partial) closing -
I really, really appreciate you sticking with me until this is resolved.

Last edited by jan128; 02-10-2021 at 09:20 PM.
 
  


Reply

Tags
disks, gparted, raid



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to implement delay (microseconds) with real timer ticking at 100ms. mayankparasher Programming 1 12-24-2009 12:04 PM
How to implement memory mapping between protected mode and real mode? me_too Linux - Newbie 0 05-13-2008 01:12 AM
real, real, real, basic computer for my Mom shengchieh General 3 12-18-2005 12:02 AM
Real Programmers Real People Real CS Students nakkaya General 5 07-04-2003 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration