Operating System Learning Notes

Source: Internet
Author: User

understanding of the principles of file system learningOn demand The open file properties are only put into memory.
The key point is to record the number of disk addresses that a file uses. A file may account for multiple disk blocks, which may be one. The key is the size of the file.

File name, disk block address, multiple.
Continuous allocation: One file occupies 3 blocks of disk. are continuously together.
Read the performance is very good, read the contents of a file once the operation, find the first disk block, the following disk block will know. No further rotation is necessary.
The disadvantage is that there is more disk fragmentation. To avoid fragmentation, do more defragmentation (not shown, too expensive). So this way is not suitable for changing the size of the file. Fits a fixed size. such as CD files.
list allocation: resolves disk fragmentation. The file occupies three disk blocks, these three disk blocks can be anywhere, it is convenient to expand the capacity of the file. For example, to add a file, to add a disk block, anywhere to drag a disk block to hang up. There is a pointer to the disk block address.
The disadvantage is that random reads and writes consume performance. For example, to read the contents of a 6th disk block of a file, you must find the first disk block from the file and then follow the sequence second, third .... Fifth read all to know where the sixth disk block is.
In order to improve speed. Put the list of files in memory.
Stores the linked list in memory.
Number of files. How many linked list items do you want?
To address the excessive memory consumption problem (disk capacity is much larger than memory.)




Question, how is this list item designed?
Linked list such data structure to look at:
File names, directories are special files.
directory under which subdirectories are implemented. The file ends up in the directory Why does window need to be partitioned and Linux systems not partitioned?

Now I understand the principle.

Window is partitioned. That's because it needs to differentiate between different file systems. When you request a file, given the path, the operating system can know which file system to request, that is, because of the partition. A partition can have only one file system. window determines the file system by letter (C,D,E,F, etc.).

Linux does not require partitioning. Because it does an abstraction layer. To manage all file systems.
The operating system obtains data for this abstraction layer.
Use the Mount method. A and B two disks can be mounted to the same directory. When reading a file, it is the abstraction layer operation of all file systems that can be understood as an interface.

Operating System Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.