Questions tagged [failure-resistance]
11 questions
43
votes
6 answers
Corruption-proof SD card filesystem for embedded Linux?
Recently we had a rather unpleasant situation with our customer - Raspberry Pi based "kiosk" used to display remote sensing data (nothing more fancy than a kiosk mode browser displaying a self-updating webpage from the data-collection server) failed…
SF.
- 2,891
- 2
- 25
- 26
13
votes
3 answers
Can the filesystem become inconsistent if interrupted when moving a file?
I have two folders on the same partition (EXT2)
If I mv folder1/file folder2 and some interruption occur (e.g. power failure) could the file system ever end up being inconsistent?
Isn't the mv operation atomic?
Update:
So far on IRC I got the…
graphtheory92
- 245
- 2
- 7
12
votes
1 answer
Does BTRFS guarantee data consistency on power outages?
As ZFS states exclusively, ZFS is claimed to be invulnerable ZFS accepts that it might be vulnerable to power failures.
I couldn't find such a statement for BTRFS. Is it (or designed/planned to be) durable between power outages?
ceremcem
- 2,231
- 1
- 23
- 53
5
votes
3 answers
Where does LVM store data?
My questions are similar to this thread Does LVM increase the risk of data loss?, however, I couldn't find a satisfying answer.
So the question is, where does LVM store data/files, when I have a Volume Group (VG) of 3 physical disks?
What happens…
Cherrun
- 187
- 1
- 2
- 5
5
votes
1 answer
To sync /var or not?
It seems in a hard crash, in particular failure of a UPS to keep a system running, that some of the contents of logs get lost due to file system caching. As an experiment, I tried mounting the /var partition with the sync option. There was…
casualunixer
- 904
- 3
- 11
- 20
4
votes
3 answers
Is it "broken" to replace an existing file without fsync()?
In Linux's mount(2) man page, I noticed the following excerpt:
Many broken applications don't use fsync() when replacing existing files via patterns such as
fd = open("foo.new")/write(fd,...)/close(fd)/ rename("foo.new", "foo")
or worse yet
fd =…
Nate Eldredge
- 951
- 8
- 12
3
votes
1 answer
Where/when are exit statuses returned for background jobs in bash?
I'm writing a bash script which has many parts, but I want built in resiliency and parallel processing as much as possible. An example is below:
while true
do
var=$(curl someurl) || continue
var2=$(curl someurl2) || continue
var3=$(curl…
Teofrostus
- 161
- 1
- 1
- 3
2
votes
0 answers
Make Linux reboot when it runs out of PID
I want to configure a headless server to automatically reboot under catastrophic circumstances. Right now I have configured to make it panic when running out of RAM, and reboot automatically on kernel panic (sysctl kernel.panic=15 reboots 15 seconds…
iBug
- 3,428
- 1
- 24
- 57
0
votes
1 answer
How do I find at which line my data file fails while being piped to a command?
I have a file that contains one SQL command per line and I pipe it to the mysql client.
I would like to know at which line it fails (when it fails) to be able to continue without re-processing the already-processed lines.
cat my_file | magic_cmd |…
moechofe
- 3
- 1
0
votes
2 answers
Bash: Run Command (with a specific pattern) only if another Command (with another specific pattern) has failed
I have a shell script that creates a function (in a bashscript file which is sourced by .bashrc) for each Markdown files to open it in the editor.
Example:
ls /home/nikhil/Notes/Studies
Physics.md
Chemistry.md
Studies.md
index.md
ls…
Porcupine
- 1,680
- 2
- 19
- 45
0
votes
1 answer
backup boot / root in case primary fails to boot
I have these mini-servers based on raspberry pi. Lots of them. But currently we have relatively frequent malfunctions because for some reason or another the filesystem on the SD card gets corrupted and the device will no longer function…
velis
- 367
- 1
- 4
- 16