RAID is not a backup¶
Exercise raid-is-not-a-backup-annex.pdf · PDF
In LVM and RAID you built a perfect mirror. Then you deleted an invoice, and it vanished from both disks at once. Was that bad luck in a lab? Or does it happen to real people, with real work, on real servers?
It happens. In 1998 it nearly cost a film studio a whole movie. This page tells that story, and then gives you a tool to answer one question for any accident: does my data survive this?
What you will learn
- Tell the story of a real data loss (Pixar, 1998): what failed and what saved the data
- Decide, for a given accident, whether RAID, a snapshot, a local copy or an off-site copy (kept in another place) survives it
- Explain why a copy that changes together with the original is not a backup
- Name the three things every real backup needs
- Write a first protection plan for a small company
- Why "the backup program runs every night" does not mean you have a backup
The night Pixar deleted Toy Story 2¶
1998, Pixar, California. A whole studio is making Toy Story 2. Every character, every set, every finished shot is a file on one shared server. The film must be in cinemas in November 1999.
One day somebody runs a delete command (rm, the one with no recycle bin) in the wrong place: at the top folder of the film. Oren Jacob, one of the technical directors, watches it happen. Files start to vanish from his screen. First single pieces, then whole characters, then whole sequences. When the command is stopped, about 90 % of the film is gone.
"No panic", they think. "We have backups." The server was backed up regularly. They go to the backups, and the restore does not give the film back. The backups had been failing for some time, and nobody had noticed, because nobody had ever tried to restore from them.
What would you do now?
In a crisis meeting, Galyn Susman, the supervising technical director of the film, remembers something. She had just had a baby and was working from home, so she had a computer there with a copy of the whole film. Nobody had planned it as a backup. She and Jacob drive to her house, wrap the computer in blankets, strap it into her car and drive it back to the studio. The copy is not from that minute, but the film is there.
| Copy | Where and when | That day |
|---|---|---|
| The server | In the office, live | Deleted: 90 % gone in moments |
| The backups | In the office, regularly (they thought) | Useless: failing, and never tested |
| The home computer | Another place, from another day | Saved the film. By accident |
Pixar had a backup system. What it did not have was one person who had ever tried to get a file back from it.
Nobody says who typed the command
The story is famous, and it is told by the people who lived it. Nobody has ever said who ran the command, and it does not matter: tired professionals make mistakes. It will happen to you too.
Four protections, six accidents¶
Your data can be "protected" in very different ways. Here are four that Tramuntana Apps could have for its project server:
| Protection | What it is |
|---|---|
| RAID 1 | Two mirrored disks inside the server |
| Snapshot on the same disks | A frozen picture of the files at one moment, kept on the server's own disks |
| Nightly copy to a USB disk that is always plugged in | Every night, the files are copied to a second disk connected to the server |
| Dated copies in another place | Copies from several days, kept outside the office |
And here are six things that really happen. For each cell: does the data survive with only that protection? Y = it survives, N = it is lost, ? = it depends.
| Accident | RAID 1 | Snapshot, same disks | USB always plugged in | Dated copies elsewhere |
|---|---|---|---|---|
| One disk dies | Y | N | Y | Y |
| A folder is deleted by mistake | N | Y | ? only before tonight's copy | Y |
| Ransomware encrypts every file it can write to | N | ? attackers delete them | N, it is writable too | Y |
| A file was damaged three weeks ago, seen today | N | ? if one that old exists | N, overwritten 20 times | Y, if the history is 3 weeks or more |
| Fire or theft: the office is gone | N | N | N | Y |
| An update breaks the system; the data is fine | N | Y | Y (data only) | Y (data only) |
The "One disk dies" row assumes the snapshot lives on the disk that died. Ransomware is malicious software that encrypts your files and asks for money to unlock them; it encrypts everything the infected machine can write to, including any disk that is plugged in.
Read the columns:
- RAID 1 has one Y. It answers one question: a dead disk. Nothing else.
- Deletions, ransomware, slow damage. Anything that follows the original at once (a mirror, a synced folder, a disk always connected) also follows the mistake and the attack. And one copy is not enough: you need several moments in time.
- Fire is real. On 10 March 2021 a fire destroyed the SBG2 data centre of the hosting company OVHcloud in Strasbourg and damaged part of the one next to it. Customers whose only backup was in the same place lost both.
- Only the last column is full of Y. It has two things the others lack: another place and history.
Careful: a synced folder is not a backup
"My files are in the cloud folder, so they are backed up." A synced folder follows you: delete here, deleted there, a few seconds later. Only a service that keeps old versions gives you a way back.
What a backup is¶
Put the Pixar story and the table together and you get a definition with three parts:
A backup is a copy from another moment, in another place, that you have already tried to restore.
flowchart LR
T["<b>Another moment</b><br>survives deletions,<br>ransomware, slow damage"] --> B["<b>BACKUP</b>"]
P["<b>Another place</b><br>survives fire, theft,<br>a dead server"] --> B
R["<b>Tested restore</b><br>proves it really<br>holds your data"] --> B
Take one of the three away and you have something else:
| Missing | What you really have |
|---|---|
| Another moment | A mirror: it copies your mistakes too |
| Another place | A copy that burns with the original |
| A tested restore | A hope. Pixar's backups ran every night too |
A first plan for Tramuntana Apps¶
Tramuntana Apps has 12 people, one server and no backups. A plan answers four questions:
- What do you copy?
- Where do the copies live? (more than one place)
- How often, and how many old copies do you keep?
- Who checks that a copy can be restored, and when?
And then the hard question: if everything burns on a Thursday at 17:00, how much work is lost?
A good first plan sounds like this: "Every night, a copy of the shared folder to a second disk in the office, keeping 7 days. Every Friday, a copy that Aina takes home. Once a month, Marta restores one file to check. Fire on Thursday at 17:00: the only copy left outside is last Friday's, so we lose almost a week. We should send a copy outside every night."
Notice what it does: more than one place, something that is not always connected, copies from different days, and one named person who tests a restore. The tools come in the next pages. You plan yours with your group on the Exercise sheet.
Key takeaways¶
- RAID survives a dead disk. It does not survive a deletion, ransomware, slow damage, fire or theft.
- A copy that changes together with the original (a mirror, a synced folder, a disk always plugged in) repeats every mistake and every attack.
- A real backup has three parts: another moment, another place, and a tested restore.
- Pixar lost 90 % of Toy Story 2 in 1998: its backups had been failing and nobody had tested a restore. A copy at home, from another day, saved the film.
- A backup nobody has restored is a hope, not a backup.
Quick check¶
1. RAID 1 protects your data against which of these?
- The failure of one disk
- A file deleted by mistake
- Ransomware on the server
- A fire in the office
RAID answers one question only: what happens when a disk dies. A mirror copies deletions and encryption to both disks at once, and a fire takes both disks with the server.
2. What saved Toy Story 2 in 1998?
- A copy on a computer in another place
- The backups kept in the office
- The RAID of the shared server
- The recycle bin of the server
The office backups had been failing and nobody had tested them. Galyn Susman's home computer had a copy from another day, in another place, and that is what brought the film back.
3. A USB disk is always plugged into the server and gets a copy every night. Ransomware attacks the server. What happens to the copy?
- It is probably encrypted too
- It is safe because it is another disk
- It is safe because ransomware ignores USB
- It is safe until the next nightly copy
Ransomware encrypts every file the infected machine can write to. A disk that is always connected is just one more folder to it. A backup must be out of reach: disconnected, or in another place.
4. The backup program has run every night for a year. Nobody has ever restored a file. What do you really have?
- A hope, because nobody knows if it works
- A tested backup of the whole server
- A RAID array with a year of history
- A proven copy from every night of the year
A backup is only proven by a restore. Pixar's backups also "ran"; they failed for months without anybody noticing. Until you get a file back, you do not know.
5. A file was damaged three weeks ago and nobody noticed until today. Which protection can still give it back?
- Dated copies in another place, with at least three weeks of history
- A RAID 1 mirror with two healthy disks
- A nightly copy that overwrites the previous one
- A folder synced to the cloud every minute
Slow damage needs history: a copy from before the damage. The mirror, the overwritten copy and the synced folder only hold the present, which already contains the damaged file.
6. Your phone falls into the sea. Your photos sync to a cloud folder that keeps no old versions. Select the two that are true.
- The photos survive the loss of the phone
- A photo you deleted by mistake last week is gone
- The cloud folder is a full backup with history
- The photos survive only if the phone used RAID
The cloud copy is in another place, so losing the phone is fine. But a synced folder has no other moment: what you delete on the phone is deleted there too.
That closes Unit 4. Next, Unit 5 is about administering the system: it starts by dusting off the terminal and teaching it new tricks (streams, pipelines, globbing) — Back to the shell.