inode dalam file system linux
Hari ini ngalamin hal cukup menjengkelkan, sebuah web server tiba tiba ngadat nggak mau jalan.
Awalnya database error, di restart eh apache nya malah nggak jalan.
Di coba jalankan manual web servernya, selalu muncul nggak punya akses ke file logs.
Juga ada error katanya not enough space gitu …
saya cek pakai command :
df -h, hardisk masih nyisa banyak….. ini aneh.
ternyata saya cek pakai command
df -i, inodes nya sudah 100%.
Nah apakah sebenarnya inodes ini dalam file sistem linux.? Mari kita pelajari bersama sama.
Dari wikipedia :
In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object.
Jadi gampangnya inode ini adalah data tentang suatu file. Jadi tiap file dalam sistem linux punya inode.
masih dari wikipedia :
When a file system is created, data structures are created that contain information about files. Each file is associated with an inode that is identified by an inode number (often referred to as an “i-number” or “inode”) in the file system where it resides.
Inodes store information of files, such as user and group ownership, access mode (read, write, execute permissions) and type of file. On many types of file systems the number of inodes available is fixed at file system creation, limiting the maximum number of files the file system can hold. A typical fraction of space allocated for inodes in a file system is 1% of total size.
The inode number indexes a table of inodes in a known location on the device; from the inode number, the kernel can access the contents of the inode, including the data pointers, and so the contents of the file.
A file’s inode number can be found using the ls -i command, while the ls -l command will retrieve inode information (i.e. the file information).
Pada saat kita membuat file system (ini biasanya pertama kali kita install linux), besaran inodes ini dibuat dan ini bersifat fixed atau tetap. Artinya apa? kira kira dalam sebuah sistem file tersebut berapa banyak jumlah file yang bisa disimpan sudah terbatas atau dibatasi oleh jumlah inodes ini.
Nah itulah yang saya alami, saya mengecek dalam sebuah folder /var/spool/mqueue ada kurang lebih 9 juta files. Walaupun ukuran file tersebut kecil, dan bahkan kalau semua ukuran tersebut dijumlahkan, tetap masih lebih kecil dari kapasitas hardisk Anda, akan tetapi jelas telah menghabiskan kapasitas atau jumlah inodes yang ada dalam table inodes.
Hasilnya, kita tidak bisa menulis file baru. error nya “not enough space”. wow !!! padahal maksudnya not enough inode.
Dalam sebuah sistem yang sudah running, biasanya sebuah program akan menulis file temporary. Dan saat program tidak berhasil menulis file temporary, ada kemungkinan program tersebut berhentu berjalan.
Untuk mengetahui seberapa banyak file yang ada dlm folder sistem linux kita jalankan perintah sbb :
cd /; for i in *; do echo -n $i,; find $i -print | wc -l; done
Perintah di atas akan mengeluarkan jumlah file dalam folder folder di bawah root.
Kira kira hasilnya akan spt ini :
sbin,234
selinux,44
src,201
srv,1
sys,2028
tmp,8
usr,114430
var,9521849
Dari output tersebut kita bisa lihat ada 9 juta file dibawah folder /var. Nah kemudian anda lakukan lagi perintah
cd /var; for i in *; do echo -n $i,; find $i -print | wc -l; done
untuk mengetahui berapa banyak file dalam folder folder di bawah /var
Lakukan begitu terus hingga kita menemukan folder mana yang berisi jutaan file tersebut.
Semoga membantu …
Salam
Yuan
Related Video
Pengunjung Datang Ke Blog Ini Mencari Info Tentang :
Topics
- AJAX (2)
- Belajar Hipnotis (7)
- Download (5)
- hipnoterapi (1)
- Internet Marketing (18)
- Javascript (10)
- Lain lain (9)
- Latest News (3)
- linux (2)
- Mac (2)
- Mindset (5)
- Review (15)
- Script PHP (7)
- security (17)
- Tutorial (20)
- Android (6)
- iPhone-iPad (5)
- MySQL (1)
- untangle (5)
- Windows Server (1)
- Wordpress (1)
- Zimbra (2)
Komentar Terbaru
- daneyyy on Android SDK install Offline
- Nico MS on Buku Membuat Aplikasi iPhone Android & Blackberry Itu Gampang
- Yuan Yudistira on 30 Menit Membuat Aplikasi Android Dengan PhoneGap
- Yuan Yudistira on Buku Membuat Aplikasi iPhone Android & Blackberry Itu Gampang
- murtitangkas on 30 Menit Membuat Aplikasi Android Dengan PhoneGap
- murtitangkas on Buku Membuat Aplikasi iPhone Android & Blackberry Itu Gampang
- Yuan Yudistira on Buku Membuat Aplikasi iPhone Android & Blackberry Itu Gampang
- Nadira on Buku Membuat Aplikasi iPhone Android & Blackberry Itu Gampang
- ahmad rusmana on Panduan Membuat Web Duplikasi / MLM dengan PHP
- herwanto on commercial SSL Certificate Zimbra, Install dgn command line






