Wednesday, April 9, 2014

Picture Yourself When You Delete Files Unintentionally


This day, a disaster happened when someone mistakenly added space before the end of the directory path.

sudo rm -rf --no-preserve-root /mnt/hetznerbackup /

Warning: DON'T DO IT ON YOUR DEVICE

Excerpt

I didn't spot the last space before / and a few seconds later, when warnings was flooding my command line, I realised that I had just hit the self-destruct button.
Server Fault: Monday morning mistake: sudo rm -rf --no-preserve-root /

Lessons Learnt

In this case, --no-preserve-root should not be used as it is unnecessary and considered as a bad practice when not dealing with system files.

As I have said before, backup is an important practice to protect your hard work and enable you to recover from an unexpected case quickly.

Disaster Recovery (DR) Plan should be prepared in advance. With full and incremental backup, the Mean time to recovery (MTTR) can be lower.



Published by Ivan Chau

^ >