a) it needs to create a checksum for parity … how else would you know that parity is corrupt ?
b) scrubbing a btrfs with nor raid level that sits on top of dmraid will result in absolutelly nothing, btrfs is not aware of extra copy it can recreate data from.
dude, parity created by dmraid is not visible to btrfs … whole point of having a dmraid is that it creates a virtual block device with raid hidden behind it, no filesystem is aware of what is available in the background, only IO and sysctl calls that amount to nothing.
you should really go and do a homework,
unmount your btrfs file system, corrupt a block on file system that has RAID 1 and on a system that has a no raid (single) and see how btrfs will behave.
Again, in your situation disk will silently replace your bad sector with good sector from spare pool (sector size = 512bytes or 4k, sector size in btrfs default = 16k, strip size in dm raid = 4k up to few megabytes for insane people) and you end up with a btrfs sector that has a part of it replaced with 0xffffffff and CRC does not match, btrfs does not have any backup, because you did setup a btrfs with no raid on top of dmraid that is performing raid behind the scenes - btrfs will give you IO error and block access to WHOLE file, not just a part of it. dmraid has no knowledge that something went wrong BECAUSE FILESYSTEMS DON’T COMMUNICATE FINDING A BROKEN SECTOR TO UNDERLYING BLOCK DEVICES !. There is no mechanism for that, there never were ! Nobody in ext4 or FAT32 found a block that seemed corrupt and said “hey HDD, you got a bad sector”, storage behaviour logic is more or less 40 year old logic.
(Ok I’m calm now, sorry for angry part … I’m now to tired to reword it to be less brusk)
Beg, borrow, steal. Honestly I know your pain. Not always I had money for a spare disk. BUT, rather than buying into a new harddrives try to do it smart - all big enterprises ditch their disks after 2 year (to limit maintenance cost with increasing failure rate) - some time ago I’ve even came across a listing for over 1000x 2tB WD SAS disks for 27 GBP a pop - thats less than half price for new WD.
So, since we are in this subject of money. I think most of folks assume that if you go for btrfs - you moderately care for data integrity (because you care for system with data CRC). Most will tell you not to touch btrfs without a ECC ram. Yes it sucks, but most have learnt the hard way. If you don’t care that much about data integrity, why btrfs at all ? dmraid_raid5 + random FS and your golden.
After decade in software engineering I can tell you just one advice - don’t kick out an open door.
you can try strip zfs of sun part to be less ram hungry, but then it’s a bit buggy, legalities are hazy, driver in linux is nonprintable_opinion_here. But one thing for sure, btrfs guys are veeeerrryyyyy concerned about getting a raid5&6 working, it’s just now a more serious messups were uncovered in places that were supposed to be stable so the fundation is being ironed out.
Always you strip will be biggest_sector_size * how many disks you have. so if you go for 2TB disk you most likely have a 4kb sectors … so every time a sector will be updates all sectors on other disks will have to be read (to create a parity) than your data + parity will get written down.
Yeah, about that … yes it’s feasible … only thing that peole don’t want to admit is that unclean shutdown is an umbrella term to: you loosing power, sata controller being overloaded get’s a self reset and silently looses some data ( aaaahhhhhh good old MARVEL chips ), driver in kernel dying on you, kernel ooops, kernel panic, kernel oom killer, application in system mode exploding on you (docker comes to mind ?)
Bitmaps are a last hope attempt to fix a problem that is caused by a lacking design … some folk clinge to stuff to much
Also bitmaps are not without it’s problem (just a quote from https://raid.wiki.kernel.org/index.php/Write-intent_bitmap)
"In one configuration I have, this takes about 16 hours on a 400Gb drive. When I do 5 of them simultaneously this takes 2+ days to complete"
Maybe zfs then ?
Aaahhh yes, sorry for bringing confusion to the equation:
a) mdadm - just an management tool, can be used to configure multitude of different raids (even hardware ones) so mdadm does not mean kernel raid
b) dmraid - an actual software (fake hardware) raid done in BIOS (by silently pushing all hard work to kernel again) called by Device Mapper (usually buggy as hell, since BIOS & UEFI is done by firmware engineers … and opinion of firmware is usually bad)
c) kernel raid (or RAID … wtf ?!) whish is by a definition multipath raid (WTF?!) … same stuff as dmraid, but less broken because implemented fully in kernel and reviewed by a lot of smart people
Honestly I know that calling linux raid a dmraid might be an insult to some, but kernel raid was there to help with some use cases and people used it to replace multi thousand dollar equipment and got surprised why performance sucked.
experience, logic, btrfs mailing list, knowing how stuff works …
Also I know which stuff you are referencing, this specific people run that setups in enterprise environments. Best example is a guy that did run a btrfs RAID 10 on top of kernel raid where each “disk” that btrfs have seen had a mirrored RAID1 of two or more disks. Through that when read is performed kernel will sequence read from 3 different disks (giving you 3x throughput) to btrfs that sits on top. He was using it for a very high bandwidth setup with 4 xeons and tone of ram pumping into teamed fibre network interfaces …
Let’s start again. In line of not kicking in an open door: you said that you are a broke student. and you want to use raid 5 - hence I assume you got 3 disks at disposal.
From you status, and amount of data that you want to store I assume that your data is not worth that much (well most of gigabytes of it) it’s movies or porn Fair enough, I prefer online database for that matter but each to their own.
So raid 5 on 3 disks will give you 66% capacity with one disk fail redundancy.
How about placing all you data on 2 disks connected into RAID 1 and all not so important into NORAID file system ? Hell for that matter you can build btrfs filesystem with 3 disks and have different RAID levels for different folder !!! This is where btrfs really shines, you can use dirt cheap stuff of different capacity and achieve wonders with it !
Now, if all you data is absolutely important to you, you got 3 disks of EXACTLY same capacity, nothing else than raid 5 is a go, and you got 4GB ECC ram … zfs and don’t look back ! (at least I would)
On the other hand if you are willing to go to a job and earn some cash, some examples of how you can buy stuff smart:
got 2 of those when they were 25 guid a pop:
you can join those in series, SAS card can be as little as 20 quid, you just need a pciE socket in what ever system you have and BAM for less than 50 quid you can start poping chap ex corporate disks (again those were cheaper before):
If you need it to be a separete nas, pick up an HP proliant (g6 and up) for 40 quid and seriously you will blow anything out of the water with that !!!