In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Linux file system
Common hard disk as shown above, each disk is divided into multiple tracks, each track is divided into multiple sectors, each sector 512 bytes, is the smallest storage unit of the hard disk, but at the operating system level will be multiple sectors into blocks (block), the operating system is the smallest unit to store data, usually 8 sectors to form a 4K byte block.
For Linux file systems, you need to consider the following:
The file system needs to be strictly organized so that files can be stored in blocks. The file system needs to have an index area to find out where multiple blocks of a file exist. If files are read and written frequently recently, cache layer files should be organized in the form of folders to facilitate management and query. The Linux kernel maintains a set of data structures in its own memory. Keep which files are opened and used by which processes
Everything in Linux is a file, and there are the following files (as can be seen from the first bit of the ls-l result):
-for ordinary file d for folder c for character device file b for block device file s for socket socket file l for soft link
Inode and block storage
Let's take the EXT series format as an example to see if the file exists on the hard drive. First of all, the file will be divided into blocks and scattered on the hard disk, so we need an index structure to help us find these blocks and record some meta-information of the file, which is inode, where I stands for index. The inode data structure is as follows:
Struct ext4_inode {_ _ le16 itimatide; / * File mode * / _ _ le16 iambiuid; / * Low 16 bits of Owner Uid * / _ _ le32 itransitilo./ * Size in bytes * / _ _ le32 itimeme; / * Access time * / _ _ le32 itimetime./ * Inode Change time * / _ le32 itimetime./ * Modification time * / _ le32 itimetime./ * Deletion Time * / _ _ le16 i_gid / * Low 16 bits of Group Id * / _ _ le16 iTunes links links transactions; / * Links count * / _ _ le32 iCompletesblocksblocks; / * Blocks count * / _ _ le32 iorders; / * File flags * / union {struct {_ _ le32 itransactions version;} linux1; struct {_ _ u32 hourly transactions;} hurd1; struct {_ _ u32 _ le32 icycles reserves 1;} masix1;} osd1 / * OS dependent 1 * / _ _ le32 iBun [EXT4 _ N_BLOCKS]; / * Pointers to blocks * / _ _ le32 iGeneration; / * File version (for NFS) * / _ _ le32 iSuppli fileholders; / * File ACL * / _ _ le32 iDepositesizeblocks highways; _ _ le32 itemobsoblocks faddr; / * Obsoleted fragment address * / union {struct {_ le16 l_i_blocks_high / * were l_i_reserved1 * / _ _ le16 lumbago fileholders; _ _ le16 lags utilisation highs; / * these 2 fields * / _ _ le16 lumbago gidbits highways; / * were reserved2 [0] * / _ _ le16 lumbago checklists; * crc32c (uuid+inum+inode) LE * / _ _ le16 lumped reserves;} linux2; struct {_ _ le16 h_i_reserved1 / * Obsoleted fragment number/size which are removed in ext4 * / _ _ u16 hobbies highways; _ _ u16 hobbies m_i_reserved2 highways; _ _ U16 hobbies m_i_reserved2 highways; _ _ u32 hobbies authors;} hurd2; struct {_ _ le16 hackers reserves 1; / * Obsoleted fragment number/size which are removed in ext4 * / _ _ le16 massively loaded fileholders high; _ _ U32 m_i_reserved2 [2];} masix2 } osd2; / * OS dependent 2 * / _ _ le16 iTunes checksumption; / * crc32c (uuid+inum+inode) BE * / _ _ le32 iTunes ctimetables; / * extra Change time (nsec)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.