1

You've surely heard the warning: after some years of use, or a lot of data written to it, an SSD drive might be become defective.

One of its symptoms: it might become only available for read-only accesses → No more output can be done on it.
And those who encountered this problem, from what I've red over the Internet, found their computer entirely stuck.


But on the other end, few years ago, CDs of Live Linux distributions were common.
And from them, it was possible to start a session without any output operations to a drive. (If I am remembering the thinks well...!)


Is it now possible for a recent Linux Operating System to detect a drive unable to respond to output requests, at boot or initialization/starting time, and switch itself, for it, in "read only" mode like if it was booting from a CD?

And then, provide the ability for the user, with input operations, to access its data from that defective SSD in the read-only mode that it only supports now, to allow him to dump them elsewhere?

Or would such feature be to complex to implement?

  • Normally, when a read-only OS is mounted, a read-write overlay is mounted to avoid write issues. See https://unix.stackexchange.com/q/316018/64699 – stark Sep 09 '23 at 16:03
  • @stark Here, the OS isn't read-only, at the beginning. It has to switch itself in read-only mode (ideally for the faulty drive only). Can a modern OS do that itself? Everything OK →Normal session, Defective SSD detected →that drive stays accessible in read-only, and if that SSD drive is the one holding the OS, the OS start in read-only mode. Is this behavior already available? – Marc Le Bihan Sep 09 '23 at 16:13
  • Linux switches your SSD filesystem to read-only when an error occurs. This is standard behavior. – stark Sep 09 '23 at 16:41
  • the answers to all of your questions is yes, except the last one, which is no – jsotola Sep 09 '23 at 17:11

1 Answers1

0

Yeah, booting in read-only mode when the storage is damaged is standard. Most Linux distros will be configured to only boot to a rescue state, but there's no inherent reason for that other than that it would be surprising the user not to do that. You could add ram-based RW overlay to still allow services to write logs and the user to change the system, but all these things would be lost on shutdown, so doing that would probably lead to the user losing work, without them expecting it. So, in my humble opinion, if I set up a Linux on a drive and that suddenly is no longer able to write, I'd want to be dropped to a minimal rescue shell to copy as much data as possible off the drive without attempting more writing.

Some Linux distros are based on immutable root file systems anyway, so these would not even notice.

So: To answer the question of whether it's hard: no, it's in fact commonly done.