Thread (24 messages) 24 messages, 8 authors, 2022-06-27

Re: a new install - - - putting the system on raid

From: Wol <hidden>
Date: 2022-06-23 23:44:18

On 23/06/2022 23:27, Pascal Hambourg wrote:
quoted
Why would it crash?
Do you really believe a program can lose some of its data and still 
behave as if nothing happened ? If that were true, then why not just 
discard data instead of swap them out when memory is short ?
No ...
quoted
Firstly, the system shouldn't be swapping. MOST systems, under MOST 
workloads, don't need swap.
Conversely, some systems, under some workloads, do need swap. And when 
they do, swap needs to be as reliable as any other storage space.
And if your system is one of the ?majority? that shouldn't swap, the 
cost/benefit analysis is COMPLETELY different for swap than for main 
storage. So don't treat them the same.
quoted
And secondly, the *system* should not be using swap. User space, yes. 
So a bunch of running stuff might crash. But the system should stay up.
Firstly, the *system* is not only the kernel. Many user space processes 
are part of the *system*. Secondly, you were the one who wrote:

"/tmp - is usually tmpfs nowadays, if you need disk backing, just make 
sure you've got a big-enough swap (tmpfs defaults to half ram, make it 
bigger and let it swap)."
And? /tmp is *explicitly* not to be trusted in the event of problems. If 
you lose a disk and it takes /tmp out, sorry. If the tmp-cleaner decides 
to do a random "rm /tmp/*" at an inconvenient moment, well, if the 
system can't handle it then whoever set the system up (or wrote the 
program) was incompetent. Sorry. It's true. (And, no, I'm not claiming 
to be a competent person :-)
quoted
Raid is meant to protect your data. The benefit for raiding your swap 
is much less, and *should* be negligible.
No, this is what backup is meant to. RAID does not protect your data 
against accidental or malicious deletion or corruption. RAID is meant to 
provide availabity. The benefit of having everything including swap on 
RAID is that the system as a whole will continue to operate normally 
when a drive fails.
And how does backup protect your data when the system crashes? You know, 
all that web-shop data that is fresh and new and arrived after the most 
recent backup 5mins ago? But that is probably irrelevant to most people :-)

(Oh, and I didn't tell o1bigtenor NOT to raid his swap. I asked him WHY 
he would want to. Maybe he has good reason. But I know him of old, and 
have good reason to suspect he's going OTT.)

You need to know what the threats are, what the mitigations are, and 
what strategies are RELEVANT. And you need different strategies for 
long-term, short-term, and immediate protection/threats.

I run xosview. Even with gentoo, and a massive tmpfs, swap in-use sits 
at 0B practically ALL the time. Why would I want to protect it? On the 
other hand, my data sits on raid-5 on top of dm-integrity - protected 
against both disk corruption and disk loss.

And then I usually forget I've got a massive disk sitting there for 
backup. Losing a hard drive doesn't cross my mind, because in pretty 
much 30 years I personally have yet to lose a disk. I know I'm lucky, 
I've recovered other people who have, but ...

As I say, different risks, different mitigations...

Cheers,
Wol
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help