Skip to main content

Mengapa Power / Listrik yang buruk akan mempengaruhi data Anda

Why power outages are bad for your data

1. Introduction

A lot of people assume that when power is cut from their computer, it should be able to handle that gracefully and no data should be lost. Unfortunately, it is not that simple. For a lot of people the risk is low, but when you're using your computer even slightly more seriously and your data is equally important, you might want to consider using a UPS.
This article explains what happens to the hardware and software when the power fails and the possible consequences it has. It should give you enough insight to decide whether you need a UPS or not.

2. What happens hardware-wise

2.1. Direct result

When the power fails, no individual component gets a clean shutdown command; power is just removed. When this happens, some parts of the machine may last longer than other parts. One of the first things that will happen, is that the memory DIMMs will no longer be refreshed properly (DRAM needs to be refreshed constantly otherwise it will lose its data) and very rapidly, the memory will contain only garbage. The hard drives and DMA controller however, will run a bit longer; so if data is being written to disk, the DMA controller will keep reading data from memory, but it has no idea that this data is corrupted. Some file systems are more sensitive to this kind of failure, because of the different kinds of journaling they do.
There are certain machines which are protected against this type of data corruption, by having the power supply send an interrupt to the operating system when power fails, but ordinary class PC hardware does not.
There is another side to this story, however. Researchers have shown that encryption keys can be retreived from memory minutes after the computer has been shut down. This would suggest that the memory doesn't corrupt so quickly at all when power is removed. However, because machines are still unstable when you decrease the refresh cycle of your RAM, it is apparent that some corruption still occurs.

2.2. Indirect result

Not directly related to a power loss as much as any kind of shutdown, is the fact that hard drives which have reached a certain age tend to die when the machine is powered up again. This doesn't necessarily happen immediately, but can take a few days. Additionally, you can imagine what will happen in this scenario when you have an array of identical disks of equal age; always put spare disks in your array, in power safe mode so they don't wear down.

3. What happens software-wise

3.1. Disk cache

Disk write cache is used to collect and delay transfers to the disks in favor of speed, because memory is faster than disks. When you shut down a machine when there is uncommitted data in the cache, you will lose this data, or corrupt it because only part of the cache is written. This can be illustrated very nicely by booting your Linux machine with the kernel parameter "init=/bin/bash". This will start a shell instead of the initialization procedure. You can then edit files, like /etc/shadow, should you want to reset your password. If you then press ctrl-alt-del without running the "sync" command to commit the disk cache first, your changes will not be committed to disk.
There are different kind of cache systems in existence. Two important ones for write cache are write-through and write-back. The former is safe, because it reports the data as written when the data is committed to disk. The latter is unsafe, because it reports the data as written when it has been written to cache, while it hasn't been written to disk yet. Even when you have a UPS it's unsafe, because there are several other reaons when power can suddenly disappear.
Write-back cache is used in a lot of disks these days. If possible, you may want to consider turning it off.

3.2. (Encrypted) file systems

Most people will think that because of journaling, file systems are protected against power failures. It's true that filesystems with journaling are more robust than those without, but it should be clear by now there are some things the file system cannot protect against.
Then of course, there are different ways that journaling can be done. Ext3 is more resillient against power failures then XFS and ReiserFS, because ext3 does physical block journaling. Ext4, however, by default does something called "delayed allocation," which means that meta-data is saved more often than the data itself. In the event of a power failure, this can data corruption, for obvious reasons. Linux Torvalds has an outspoken opinion against delayed allocation.
As the Gentoo Wiki states, you are even more susceptible to data loss in the event of a power failure when using an encrypted file system. The reason for this, is that hard disks are block devices. Normally, if a few bits are flipped as you write it to disk, you can take advantage of properties inherent in the data (depending on what it is) to recover it. At the very least, you only lose a bit of the block. Should the block be encrypted and trashed as it is written, the flipped bit will cause decryption of that block to fail, so it is all lost. Entropy of most computer data on disk is quite low, while encrypted data is essentially indistinguishable from true random; guessing gets a lot harder. Additionally, it is possible for multiple subsequent blocks to also be lost due to the initialization vectors used in IV chaining being unrecoverable. This depends on whether or not you're using them, how the cipher is configured, and other factors, but is a consideration.

3.3. (Linux software) RAID

Linux software RAID, and any RAID basically, needs to know if the disks of the array are still properly matched to eachother when the array is initialized. When power fails, or when you press reset, they will be in a "dirty" state, and the system may need to recreate the array. That is, if it can. I've never tried it, but I can imagine that a RAID0 can be completely destroyed by a power failure. But, don't take my word for that...
Modern Linux kernels (2.6.16 and newer) and raid tools (mdadm 2.4.1 and newer) luckily have a precaution against that, namely a write intent bitmap. When using Linux software RAID, I'd advise you to enable this. There are enough resources on the internet where you can find how, like the Gentoo Wiki. Unfortunately, write intent bitmaps are very slow. When you have the protection of a UPS, not using a write intent bitmap becomes more acceptable.

3.4. Databases

When you use a database system with (good) transaction support, data corruption will not happen when the power is removed. That is, when you're using disks that don't lie about their cache status (see above). You will, of course, lose all the uncommitted transactions, which can be annoying in itself. 
When you're running a database without transaction support, like MySQL MyISAM, data corruption is of course likely.
Applications like LDAP directories, source control management repositories, etc, are also potentially susceptible to the same kind of failures, depending on if and how well they use transactions. Like I describe in my backup article, it's also important to make scheduled dumps of such applications, to make sure have a backup in a robust, self-contained archive.

4. Surge protection

UPSes also protect against surges on the mains power. However, only an online UPS (the expensive sort) does it properly, by always running the load from the battery. The offline variety merely uses MOVs, which is exactly the same thing as those ordinary power strips with surge protection. The effectiveness of those things can be questioned because of delay time, impedance (resistance) of the safety earth, longetivy of the MOVs because of frequent surges, etc. The internet is filled with information about the fallibility of MOV surge protection.
The surge protection on UPSes also often includes protection for ethernet and/or telephone networks. I really advice against using those. When there is a surge, the MOVs temporarily short the line containing the surge with the safety earth, but it will also connect the data networks to it. This safety earth, however, does not have infinitely low impedance, and therefore it's possible that some of the excess current will travel up the network, as opposed to down the safety earth. The exact details of this are more complex than this, but as always, the internet is your tool should you want to find out more.

5. Recommendation

It should come as no suprise that I would advise a UPS if your data is important to you, especially when the machine in question is heavily used data-wise (with a lot of writing to the disks), like an office file server, or when it uses a database of some sort. And even more so if you use XFS or ReiserFS. It's also convenient to have your external USB disk, router, cable modem, telephone switch, or similar devices on the UPS. The router and network switches is particularly neat, because then the machine can notify you (by e-mail or SMS) of the power failure, and possible connections from the internet (like your SSH shell...) will be maintained.

5.1. Selecting a UPS

In my experience, servers often use a lot less power than you'd think (at work, our dual core 1.8 GHz Intel with three disks only uses about 100W), so you don't really need a big UPS. I'd advice getting/borrowing a power/VA meter to gauge the power use of the machine in question, and size the UPS accordingly. When doing so, remember that it will use more power when the CPU is highly utilized.
Our 500 VA APC CS 500 can supply one server, one pentium-100 (internet router), phone switch and network switch for about 15 minutes. It's loaded at 40% under normal use.
I would not connect a CRT monitor to a UPS. When the degaussing coil of the picture tube is triggered (when the monitor is turned on for example), an enormous surge of current is drawn. When you're running on battery power, this is enough to make computers connected to it reboot. Should the connected devices ever start on battery power, each connected device will suffer a momentary power outage because of the high current drawn by the degaussing coil of the monitor. This kind of outage is not very good for your hardware. Besides, what use does it have to run the monitor off a UPS? The primary function of a UPS is to avoid data corruption because of an ugly shutdown, not because you are too lazy to save your work all the time...

Comments

Post a Comment

Popular posts from this blog

Alat - Alat Fiber Optic dan Fungsinya

1. Fusion Splicer Fusion splicer atau sering dikenal sebagai alat untuk menyambungkan serat optik ini merupakan salah satu alat yang digunakan untuk menyambungkan sebuah core serat optik, dimana serat tersebut terbuat / berbasis kaca, dan mengimplementasikan suatu daya listrik yang telah dirubah menjadi sebuah media sinar berbentuk laser. Sinar laser tersebut berfungsi untuk memanasi kaca yang terputus pada core sehingga bisa tersambung kembali dengan baik. Perlu kalian ketahui, bahwa fusion splicer ini haruslah memiliki tingkat keakuratan yang cukup tinggi, hal ini ditujukan untuk menghasilkan hasil penyambungan yang sempurna, karena pada saat penyambungan tersebut akan terjadi proses pengelasan media kaca serta peleburan kaca yang akan menghasilkan suatu media, dimana media tersebut akan tersambung dengan utuh tanpa adanya celah-celah, hal ini dikarenakan media tersebut memiliki senyawa yang sama. 2. Stripper Atau Miller Sama seperti kabel - kabel yang lain, salah satunya seperti kab

Cara Menghitung Satuan Volt, Ampere, dan Watt

Sangat penting untuk mengetahui satuan dalam bidang yang ingin anda pahami, dalam bidang listrik untuk mengetahui satuan seperti volt, ampere, dan watt. Ketika anda tidak mengetahui satuan dari bidang listrik ini sama saja dengan tidak tahu dalam teori dasar dan anda sekarang bisa memperlajari dengan jelas dalam artikel saya berikan ini. Saya akan memberikan langkah demi langkah agar mudah untuk dipahami. Pengertian Volt (Voltage) Volt (Voltage) adalah standart satuan listrik yang menunjukan atau menerangkan sebuah nilai tegangan dalam listrik. Volt atau bisa disebut tegangan hanya bisa diukur dengan alat yang bernama voltmeter atau multitester, volt mempunyai bermacam-macam nilai tegangan dan juga tipe atau karekter yang berbeda. Volt Mempunyai 2 tipe atau karakter Volt atau tegangan listrik ini mempunyai jenis 2 tipe yaitu tegangan AC atau bisa disebut tegangan bolak-balik. kemudian tegangan DC (Direct Current) atau bisa disebut dengan tegangan searah. Untuk mengatahui apa itu tegan

Cara Menghitung Ampere Motor 3 dan 1 Phase dengan Rumus Daya

Sering kali, anda menjumpai motor listrik untuk menggerakan mesin pada pabrik - pabrik sekarang dan kebanyakan 85% didalam pabrik menggunakan motor listrik untuk menggerakan mesinnya. motor listrik ada 2 jenis Phase yang pertama adalah 3 phase yang di mana ada tegangan R S T sedangkan yang ke dua adalah 1 Phase dimana motor listrik hanya diberi tegangan phase dan Netral aja, contohnya seperti pumpa air dirumah.     Dari motor - motor tersebut maka anda sangat perlu untuk menghitung amperenya dimana anda membeli motor 1 phase tapi kapasitas rumah anda hanya 450 Watt saja maka anda harus menghitung motor airnya harus di bawah dari 450 Watt. Plate Motor 1 Phase  Diatas adalah name plate motor 1 phase dimana   sudah di ketahui KW dan Amperenya jika hanya di   ketahui KWnya saja bagaimana seperti berikut   menghitungya:  Diket : P : 8 KW = 8 x 1000 = 8000 Watt V : 220V Ditanya : Berapa Nilai Amperenya? Rumus daya  Motor 1 Phase: P = V x I I  = P/V Keterangan : P  : Daya ( Watt ) I   : Arus

Cara Menentukan Ukuran Kabel Instalasi Listrik

Dalam sebuah instalasi listrik di sebuah rumah atau bangunan, penggunaan kabel listrik haruslah diperhatikan betul. Mengingat kesalahan penggunaan dan pemasangan kabel dapat membahayakan manusia atau penghuni rumah. Dalam menggunakan sebuah kabel ini dari anda harus tahu jenis kabel yang akan di pasang, berapa ukuran kabel listrik, luas penampang maupun panjang kabel listrik. Ukuran Kabel Listrik Seperti yang kita ketahui bersama bahwa fungsi sebuah kabel listrik adalah untuk menghantarkan arus listrik dari sumber listrik menuju beban daya suatu alat listrik. Yang dimaksud dengan ukuran kabel lisrik adalah luas penampang kabel . Sehingga setiap ukuran kabel listrik akan menggunakan satuan mm2 . Mengapa menggunakan ukuran kabel yang tepat sangat penting ? karena kesalahan dalam penentuan ukuran kabel dapat menyebabkan resiko yang fatal. Beberapa kode yang sering ditemukan pada sebuah kabel listrik yaitu : 1 X   1,5 mm 1 X   2,5 mm 2 X   1,5 mm 2 X   2,5 mm Keterangan : Angka sebelum kal

Pengertian Konektor RJ45 dan Fungsinya Lengkap

 RJ45 adalah konektor kabel ethernet yang kebanyakan memiliki fungsi sebagai konektor pada topologi jaringan komputer LAN (Local Area Network) dan topologi jaringan lainnya. RJ itu sendiri adalah singkatan dari Registered Jack yang merupakan standard peralatan pada jaringan yang mengatur tentang pemasangan kepala konektor dan urutan kabel, yang digunakan untuk menghubungkan 2 atau lebih peralatan telekomunikasi (Telephone Jack) ataupun peralatan jaringan (Computer Networking). Juga merupakan suatu interface fisik dari jaringan kerja (network) , untuk kegunaan telekomunikasi dan komunikasi data. Konektor RJ45 memiliki fungsi untuk memudahkan penggantian pesawat telpon atau memudahkan untuk di pindah-pindah serta mudah untuk di cabut tanpa khawatir tersengat aliran listrik dan menghubungkan konektor LAN melalui sebuah pusat network. Konektor RJ45 memiliki 8 buah pin. Pin pertama terdapat di paling kiri apabila pin RJ45 menghadap ke anda, di ikuti pin nomor 2, 3, 4 dan seterusnya. Cara pe

MENGENAL PANEL LISTRIK , JENIS DAN SPESIFIKASINYA

Pengertian Panel Listrik Panel listrik adalah suatu benda berbentuk kubus dengan berbagai ukuran ataupun bervariasi dengan sebelah sisi dibuat lubang selebar hampir sama dengan belakangnya, dan nantinya di baut penutup seperti daun pintu agar bisa dibuka dan ditutup, dan didalam panel tersebut terdapat papan yang dikaitkan dengan sisi belakang pintu di pakai baut yang nantinya papan tersebut dapat dilepas dan dipasang kembali. Pada umumnya panel listrik adalah terbuat dari plat besi dengan ketebalan 0,5 – 1 mm. Biasanya disesuaikan dengan ukuran atau besarnya panel, dan nantinya papan tersebut yang akan digunakan tempat pemasangan komponen-komponen listrik. Fungsi Panel Listrik Fungsi dari panel listrik adalah untuk menempatkan komponen listrik sebagai pendukung dari mesin-mesin listrik agar bisa beroperasi  sesuai dengan prinsip kerja dari mesin listrik itu sendiri. Untuk mengamankan komponen listrik supaya terlindungi dari pengaruh di sekelilingnya. Untuk menata komponen atau rangkai

Jenis Kabel Listrik beserta Fungsi dan Gambarnya

Berbicara mengenai kabel listrik tentu sangat luas sekali. Kabel listrik sendiri merupakan komponen yang memiliki peran vital dalam berbagai peralatan elektronik yang kita gunakan sehari-hari. Dari kegunaannya, jenis-jenis kabel listrik ini sangat banyak dan beragam. Pemakaian jenis kabel pun harus tepat agar tidak menyebabkan konsleting listrik. Untuk itu penting sekali mengetahui jenis jenis kabel listrik berikut ini. Kabel listrik Kabel listrik merupakan sebuah komponen konduktor yang berfungsi untuk menghantarkan arus listrik ke benda-benda atau peralatan yang membutuhkan energi listrik agar dapat bekerja. Meskipun jenis-jenis kabel listrik sangat banyak, tetapi pada umumnya setiap kabel listrik terdiri dari dua bagian utama, yakni bagian isolator dan bagian konduktor. Bagian-bagian Kabel Listrik Pada kabel listrik, bahan isolator merupakan bahan yang tidak dapat menghantarkan arus listrik. Pada isolator terdiri dari pembungkus kabel yang memiliki fungsi sebagai pelindung (agar tid

Fungsi dan Cara Setting MCCB ( Moulded Case Circuit Breaker )

Mengulas lebih dalam tentang MCCB - dunia listrik sangat banyak sekali peralatan listrik sebagai pengaman untuk keselamatan dari bahaya listrik maupun untuk mengamankan sebuah motor dan peralatan listrik lainya dari bahaya short circuit. Apa itu MCCB ? MCCB adalah singkatan dari Moulded Case Circuit Breaker, sebagai pengaman terjadinya hubung singkat short circuit dan beban lebih overload agar tidak terjadinya kerusakan pada motor listrik maupun kebakaran yang disebabkan oleh short circuit yang selalu menimbulkan bunga api. MCCB biasanya digunakan oleh industri karena MCCB hanya untuk pengaman listrik 3 phase, dan motor listrik industri juga menggunakan listrik 3 phase, jadi jika anda ingin bertemu apa itu namanya mccb dan dan digunakan untuk apa mampir deh pabrik terdekat dan minta tolong untuk dilihatkan apa itu mccb. Pole MCCB Mccb memiliki macam – macam pole: 1 Pole, 2 Pole, 3 Pole, 4 Pole Mccb memiliki macam – macam kA: 36kA, 50kA, 85kA, 100kA Karakter MCCB - Hanya menggunakan 3 p

Perbedaan Antara KW, KVA, KWH, KVAr

Apa definisi KVA, KW, Watt, KWH, KVar, dan apa perbedaannya? Mungkin kita pernah menjumpai satuan listrik yang terkadang ditulis dengan menggunakan Watt, KW, atau KVA, Dan ini sering menjadi pertanyaan bagi kita, apa sebenarnya perbedaan satuan KW dan KVA, dan berapa 1 kVA, atau mungkin berapa itu 1 KVA KW? Selain itu kita juga sering mendengar istilah KWH, maka pertanyaannya, 1 KWH berapa Watt, atau 1 Kw berapa KWH? Untuk menjawab pertanyaan tersebut, berikut penjelasan mengenai apa yang dimaksud dengan KVA, KW, Watt, KWH, Kvar, dan apa perbedaannya. Apa yang dimaksud dengan KVA, KW, KVAr, dan KWH? Dalam listrik tiga fasa, terdapat 3 jenis daya listrik yang disebut juga dengan segitiga daya, yaitu: Daya Semu (KVA) Daya Aktif (KW) Daya Reaktif (KVAr) KVA KVA (Kilo Volt Ampere) untuk daya listrik yang tidak terlalu besar biasanya cukup menggunakan satuan daya VA (Volt Ampere). 1 KVA = 1000VA KVA adalah satuan daya listrik yang diperoleh dari perhitungan rumus daya, atau biasa disebut de

Inside the Box: UCLA's New Portable Data Center

When UCLA found out that a planned upgrade to its brick and mortar data center was going to surpass the original budget estimate by several million dollars, it began thinking "inside the box"--and chose cargo-container computing. By Dian Schaffhauser 08/11/11 The latest and potentially most powerful research data center at the University of California Los Angeles (UCLA) was delivered on the back of a flat bed truck from Austin, TX. It was put in place with a crane. The facility resembles the kind of container used to run portable recycling centers. But when it's fully loaded and performing research in physics, economics, genomics, and biochemistry, among other disciplines, the Performance Optimized Datacenter, or POD, will support more than 1,500 compute nodes. This far exceeds the campus' traditional "brick and mortar" data centers in sheer computing power, and yet it fits into a compact space of 40' x 8'. The story of UCLA&#