[SOLVED] RAID on slackware15.0, zfs or mdadm + ext4?
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.
Emmm, i dont know if i understand well what you said.
Many nas solution providers like QNAP also use the madam for raid?
It's MDADM, NOT Madam! From Multiple Disks Administration.
This word "Madam" in my language means "Madame" or "Lady" or "Mistress" as is House's Boss, and seems like the same is with English and not only.
At least be kind to name correctly the software.
Code:
root@darkstar:~# mdadm --help
mdadm is used for building, managing, and monitoring
Linux md devices (aka RAID arrays)
Usage: mdadm --create device options...
Create a new array from unused devices.
mdadm --assemble device options...
Assemble a previously created array.
mdadm --build device options...
Create or assemble an array without metadata.
mdadm --manage device options...
make changes to an existing array.
mdadm --misc options... devices
report on or modify various md related devices.
mdadm --grow options device
resize/reshape an active array
mdadm --incremental device
add/remove a device to/from an array as appropriate
mdadm --monitor options...
Monitor one or more array for significant changes.
mdadm device options...
Shorthand for --manage.
Any parameter that does not start with '-' is treated as a device name
or, for --examine-bitmap, a file name.
The first such name is often the name of an md device. Subsequent
names are often names of component devices.
For detailed help on the above major modes use --help after the mode
e.g.
mdadm --assemble --help
For general help on options use
mdadm --help-options
root@darkstar:~#
BTW, also there is not such operating system named slk15.0, but there's Slackware 15.0
Last edited by LuckyCyborg; 03-23-2023 at 09:47 AM.
It's MDADM, NOT Madam! From Multiple Disks Administration.
This word "Madam" in my language means "Madame" or "Lady" or "Mistress" as is House's Boss, and seems like the same is with English and not only.
At least be kind to name correctly the software.
Code:
root@darkstar:~# mdadm --help
mdadm is used for building, managing, and monitoring
Linux md devices (aka RAID arrays)
Usage: mdadm --create device options...
Create a new array from unused devices.
mdadm --assemble device options...
Assemble a previously created array.
mdadm --build device options...
Create or assemble an array without metadata.
mdadm --manage device options...
make changes to an existing array.
mdadm --misc options... devices
report on or modify various md related devices.
mdadm --grow options device
resize/reshape an active array
mdadm --incremental device
add/remove a device to/from an array as appropriate
mdadm --monitor options...
Monitor one or more array for significant changes.
mdadm device options...
Shorthand for --manage.
Any parameter that does not start with '-' is treated as a device name
or, for --examine-bitmap, a file name.
The first such name is often the name of an md device. Subsequent
names are often names of component devices.
For detailed help on the above major modes use --help after the mode
e.g.
mdadm --assemble --help
For general help on options use
mdadm --help-options
root@darkstar:~#
Sorry...Sometime typing fast make the wrong word and after miss typing many times....
And where to change the post title for correction?
Sorry...Sometime typing fast make the wrong word and after miss typing many times....
And where to change the post title for correction?
Edit first post in Advanced Mode.
And while you are at it, please write Slackware 15.0 instead of slk15.0 , out of respect for Mr. Volkerding who spent 30 years to give you gratis this wonderful operating system. So I guess it's OK for you to spend 2 more seconds to spell correctly it's name.
Last edited by LuckyCyborg; 03-23-2023 at 09:55 AM.
And while you are at it, please write Slackware 15.0 instead of slk15.0 , out of respect for Mr. Volkerding who spent 30 years to give you gratis this wonderful operating system. So I guess it's OK for you to spend 2 more seconds to spell correctly it's name.
I for one, I don't like ZFS and BTRFS, because I believe that is not a filesystem business to handle disks and/or partitions. They both tries to be a Swiss Army Tool, but going this way they limits the user on their features.
And, let's do not forget the old saying often ventilated in this forum: do a thing and do it well, this is the UNIX way!
And yes, in this case I believe that "the UNIX way" should be enforced.
I know, I know, the BTRFS evangelists tries to convince you with snapshots, mirrors, migrations and so on...
BUT, also MD(ADM) is capable to do those things and probably do them even better. Heck, the former forum member Darth Vader even made a live system with persistence using only the MD support.
So, I for one, IF I would be on your shoes, I would go with an ol'good RAID1 using MD, and probably as filesystem I would chose EXT4FS. Bonus points: a MD device could be also partitioned, then you can have /dev/md2p3 and so on. And this is extremely useful.
BTW, that driver thing from kernel is named simply MD, the MDADM is the administration tool from user space.
Last edited by LuckyCyborg; 03-23-2023 at 10:53 AM.
I for one, I don't like ZFS and BTRFS, because I believe that is not a filesystem business to handle disks and/or partitions. They both tries to be a Swiss Army Tool, but going this way they limits the user on their features.
And, let's do not forget the old saying often ventilated in this forum: do a thing and do well, this is the UNIX way!
And yes, in this case I believe that "the UNIX way" should be enforced.
I know, the BTRFS evangelists tries to convince you with snapshots, mirrors, migrations and so on...
BUT, also MD(ADM) is capable to do those things and probably do them even better. Heck, the former forum member Darth Vader even made a live system with persistence using only the MD support.
So, I for one, IF I would be on your shoes, I would go with an ol'good RAID1 using MD, and probably as filesystem I would chose EXT4FS. Bonus points: a MD device could be also partitioned, then you can have /dev/md2p3 and so on. And this is extremely useful.
BTW, that driver thing from kernel is named simply MD, the MDADM is the administration tool from user space.
If using MD + ext4, does LVM required?
And is external journal supported for md with ext4fs?
If using MD + ext4, does LVM required?
And is external journal supported for md with ext4fs?
This is the beauty of Linux MD: it has no business with the filesystems, it handle only the disks. So you have a big flexibility.
Regarding LVM, probably you ask because the partitioning. You can use LVM for partitioning, OR like I said already, you can simply partition a MD device. As simple as managing a disk, you can do also "fdisk /dev/md0" and getting partitions like "/dev/md0p1" and so on.
Regarding that "external journal", I do not understand well what you mean. Yes, from what I know, the EXT4FS supports an external journal, BUT it's not business of MD(ADM) if the journal of a filesystem is internal or external. You should handle it as you like.
In other hand, there are mirrors and snapshots on MD engine logic, but probably it's better to just use LVM for using device snapshots.
BTW, also this LVM uses the MD engine from kernel, so you should see it as another face of MD.
HOWEVER, please bear in mind that RAID wasn't invented or DATA SAFETY, but for SYSTEM RESILIENCE, then to survive alive to a faulty drive until the admin intervene. So, the RAID is not a replacement for backups.
You should make a consistent backup strategy both for system and data, no matter of what RAID you use.
Last edited by LuckyCyborg; 03-23-2023 at 11:16 AM.
This is the beauty of Linux MD: it has no business with the filesystems, it handle only the disks. So you have a big flexibility.
Regarding LVM, probably you ask because the partitioning. You can use LVM for partitioning, OR like I said already, you can simply partition a MD device. As simple as managing a disk, you can do also "fdisk /dev/md0" and getting partitions like "/dev/md0p1" and so on.
Regarding that "external journal", I do not understand well what you mean. Yes, from what I know, the EXT4FS supports an external journal, BUT it's not business of MD(ADM) if the journal of a filesystem is internal or external. You should handle it as you like.
In other hand, there are mirrors and snapshots on MD engine logic, but probably it's better to just use LVM for using device snapshots.
BTW, also this LVM uses the MD engine from kernel, so you should see it as another face of MD.
Thanks. Snapshot is not necessary in my case.
And how mdadm + ext4 detects the data incosistent(bit-rot?)?
And how mdadm + ext4 fix it?
Thanks. Snapshot is not necessary in my case.
And how mdadm + ext4 detects the data incosistent(bit-rot?)?
And how mdadm + ext4 fix it?
Again? Let's do NOT confuse the disks (or devices) with the filesystems.
The MD(ADM) has its logic for detecting the the incongruity in the RAID data, the EXT4FS has its methods to find the incongruity on the filesystem data. Those are fully different things.
The MD engine cares just that the bits of data are for example properly mirrored (or stripped, etc) and eventually to rebuild the RAID (or kick of a disk), while EXT4FS, as any other FS, do its business as usual. It's no difference for EXT4FS on how it runs in a MD RAID, a bare disk of even a loop file.
BTW, from the RAID POW, IF you care specially about consistency, I strongly recommend you a RAID5, which requires at least 3 disks - and gives you the space of 2 disks, while the third is used for checksums. It's also more efficient as read or write speed, and as offered storage space than RAID1.
RAID1: 2 disks of 100GB means 100GB storage, read 2x, write 1x as speed.
RAID1: 3 disks of 100GB means 100GB storage, read 3x, write 1x as speed.
RAID5: 3 disks of 100GB means 200GB storage, read 3x, write 2x as speed.
Also, it's more scalable.
RAID5: 4 disks of 100GB means 300GB storage, read 4x, write 3x as speed.
RAID5: 5 disks of 100GB means 400GB storage, read 5x, write 4x as speed.
Of course, the read/write speed depends also on hardware throughput, if hardware is capable to support that speed.
Last edited by LuckyCyborg; 03-23-2023 at 11:34 AM.
Again? Let's do NOT confuse the disks (or devices) with the filesystems.
The MD(ADM) has its logic for detecting the the incongruity in the RAID data, the EXT4FS has its methods to find the incongruity on the filesystem data. Those are fully different things.
The MD engine cares just that the bits of data are for example properly mirrored (or stripped, etc) and eventually to rebuild the RAID (or kick of a disk), while EXT4FS, as any other FS, do its business as usual. It's no difference for EXT4FS on how it runs in a MD RAID, a bare disk of even a loop file.
BTW, from the RAID POW, IF you care specially about consistency, I strongly recommend you a RAID5, which requires at least 3 disks - and gives you the space of 2 disks, while the third is used for checksums. It's also more efficient as read or write speed, and as offered storage space than RAID1.
RAID1: 2 disks of 100GB means 100GB storage, read 2x, write 1x as speed.
RAID1: 3 disks of 100GB means 100GB storage, read 3x, write 1x as speed.
RAID5: 3 disks of 100GB means 200GB storage, read 3x, write 2x as speed.
Also, it's more scalable.
RAID5: 4 disks of 100GB means 300GB storage, read 4x, write 3x as speed.
RAID5: 5 disks of 100GB means 400GB storage, read 5x, write 4x as speed.
Of course, the read/write speed depends also on hardware throughput, if hardware is capable to support that speed.
Again? Let's do NOT confuse the disks (or devices) with the filesystems.
The MD(ADM) has its logic for detecting the the incongruity in the RAID data, the EXT4FS has its methods to find the incongruity on the filesystem data. Those are fully different things.
The MD engine cares just that the bits of data are for example properly mirrored (or stripped, etc) and eventually to rebuild the RAID (or kick of a disk), while EXT4FS, as any other FS, do its business as usual. It's no difference for EXT4FS on how it runs in a MD RAID, a bare disk of even a loop file.
BTW, from the RAID POW, IF you care specially about consistency, I strongly recommend you a RAID5, which requires at least 3 disks - and gives you the space of 2 disks, while the third is used for checksums. It's also more efficient as read or write speed, and as offered storage space than RAID1.
RAID1: 2 disks of 100GB means 100GB storage, read 2x, write 1x as speed.
RAID1: 3 disks of 100GB means 100GB storage, read 3x, write 1x as speed.
RAID5: 3 disks of 100GB means 200GB storage, read 3x, write 2x as speed.
Also, it's more scalable.
RAID5: 4 disks of 100GB means 300GB storage, read 4x, write 3x as speed.
RAID5: 5 disks of 100GB means 400GB storage, read 5x, write 4x as speed.
Of course, the read/write speed depends also on hardware throughput, if hardware is capable to support that speed.
Write operations with raid5 are very poor
The calcul method is : Nx/4
N: number of disks
x: IOPS
So, with 3 or 5 disks, the performances are almost the same as a single disk
Because, on every single operation, raid5 read the data, read the parity, write the data and finally write the parity
Again? Let's do NOT confuse the disks (or devices) with the filesystems.
The MD(ADM) has its logic for detecting the the incongruity in the RAID data, the EXT4FS has its methods to find the incongruity on the filesystem data. Those are fully different things.
The MD engine cares just that the bits of data are for example properly mirrored (or stripped, etc) and eventually to rebuild the RAID (or kick of a disk), while EXT4FS, as any other FS, do its business as usual. It's no difference for EXT4FS on how it runs in a MD RAID, a bare disk of even a loop file.
BTW, from the RAID POW, IF you care specially about consistency, I strongly recommend you a RAID5, which requires at least 3 disks - and gives you the space of 2 disks, while the third is used for checksums. It's also more efficient as read or write speed, and as offered storage space than RAID1.
RAID1: 2 disks of 100GB means 100GB storage, read 2x, write 1x as speed.
RAID1: 3 disks of 100GB means 100GB storage, read 3x, write 1x as speed.
RAID5: 3 disks of 100GB means 200GB storage, read 3x, write 2x as speed.
Also, it's more scalable.
RAID5: 4 disks of 100GB means 300GB storage, read 4x, write 3x as speed.
RAID5: 5 disks of 100GB means 400GB storage, read 5x, write 4x as speed.
Of course, the read/write speed depends also on hardware throughput, if hardware is capable to support that speed.
So with raid1, if md detecs the mismatch and how does it fix it? how does the md know which data is correct in two disks?...
So with raid1, if md detecs the mismatch and how does it fix it? how does the md know which data is correct in two disks?...
The consistency is detected by MD engine automatically and also automatically happens the array rebuilds and/or disks kicking.
I am not a programmer (to know precisely how MD driver works), but I guess that on the RAID1 the data read from both stripes (on each disks) should be equal, otherwise starts rebuilding the array. BUT, I believe that RAID1 has no way to check IF the equal data from stripes is correct or not. Anyway, any RAID1 system, no matter if it's software or hardware, should react this way.
That's why I believe that RAID5 is superior, because it has checksums for every data stripe, so eventually it even can rebuild the missing data. For example, introducing (replacing a faulty) disk in a 3 disks RAID5 will end with rebuilding your entire data correctly.
This is better than on the RAID1, where I guess that rebuilding means just mirroring the data from the "good" disk to the new disk.
And let's do not talk about RAID0 which has no ways to recover after a faulty disk. This one is only for getting the maximum storage speed.
BUT, like I already told you, the RAIDs are not a backup (data integrity) solution. They are about system resilience when a disk fails. Read: for some time to stay online in a consistent state (even with degraded performances) when that event occur.
So, you should have your own separate backup solution.
Long story short, the RAIDs aren't a backup solution. No one of their variants.
Last edited by LuckyCyborg; 03-23-2023 at 12:56 PM.
The consistency is detected by MD engine automatically and also automatically happens the array rebuilds and/or disks kicking.
I am not a programmer (to know precisely how MD driver works), but I guess that on the RAID1 the data read from both stripes (on each disks) should be equal, otherwise starts rebuilding the array. BUT, I believe that RAID1 has no way to check IF the equal data from stripes is correct or not. Anyway, any RAID1 system, no matter if it's software or hardware, should react this way.
That's why I believe that RAID5 is superior, because it has checksums for every data stripe, so eventually it even can rebuild the missing data. For example, introducing (replacing a faulty) disk in a 3 disks RAID5 will end with rebuilding your entire data correctly.
This is better than on the RAID1, where I guess that rebuilding means just mirroring the data from the "good" disk to the new disk.
And let's do not talk about RAID0 which has no ways to recover after a faulty disk.
BUT, like I already told you, the RAIDs are not a backup (data integrity) solution. They are about system resilience when a disk fails.
So, you should have your own separate backup solution.
The RAIDs just gives you more time to react, before the server goes fully offline.
If you really care about your data, a consistent backup solution is absolutely necessary.
And by this I mean data being synced to one or more disks which are NOT physically connected usually at that server.
And there are the flavors: (operating) system backup and data backup.
Usually is way more simple to recover the operating system (i.e. by clean reinstalling) than to recover data (i.e. by writing or translating again a book), so I believe that for each one should be a particular backup strategy.
Last edited by LuckyCyborg; 03-23-2023 at 01:07 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.