Là một hệ thống tập tin chỉ là một bó của các thư mục? (Giải thích về hệ thống tệp)

Mục lục:

Là một hệ thống tập tin chỉ là một bó của các thư mục? (Giải thích về hệ thống tệp)
Là một hệ thống tập tin chỉ là một bó của các thư mục? (Giải thích về hệ thống tệp)

Video: Là một hệ thống tập tin chỉ là một bó của các thư mục? (Giải thích về hệ thống tệp)

Video: Là một hệ thống tập tin chỉ là một bó của các thư mục? (Giải thích về hệ thống tệp)
Video: 5 cách TĂNG TỐC MÁY TÍNH, chạy ĐẢM BẢO MƯỢT (2022) - YouTube 2024, Tháng tư
Anonim
Trên bề mặt, hệ thống tập tin của hệ điều hành của bạn có thể trông giống như một đống thư mục lớn, nhưng chắc chắn có nhiều thứ hơn thế. Đọc tiếp khi chúng tôi điều tra những gì nằm bên dưới bề mặt của hệ thống tệp.
Trên bề mặt, hệ thống tập tin của hệ điều hành của bạn có thể trông giống như một đống thư mục lớn, nhưng chắc chắn có nhiều thứ hơn thế. Đọc tiếp khi chúng tôi điều tra những gì nằm bên dưới bề mặt của hệ thống tệp.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Người đọc siêu người dùng P_Q tò mò về các hệ thống tệp, anh viết:

I have used Windows since childhood, and when I hear the phrase “Windows files system” I think of directories (folders) within directories, a folder called SYSTEM, a folder called PROGRAM FILES, etc. Is this what the system is? Just the layout of the folders?

And then I recently started using Linux, and my reference book says in the Linux filesystem everything starts at root and branches off from there. How is that really different from Windows? I mean, it seems the Linux system and the Windows system are just two ways of setting up a directory tree. Is this what file system means?

Việc này có đơn giản đưa vào hệ thống tệp một cách chính xác nhất để mô tả nó không? Hãy đào sâu hơn một chút.

Câu trả lời

Người đóng góp SuperUser Tom Wijsman cung cấp một cái nhìn sâu sắc về cấu trúc của các hệ thống tệp trong cả hệ điều hành Windows và Linux. Anh ấy viết:

Just the layout of the folders?

Sounds too good to be true…

Let’s take the FAT32 file system as an example. I can install Windows XP on it, but I can also use it on a memory card. On a memory card, you don’t have those folders that you sum up.

So… Don’t confuse the directory layout of a family of operating systems with a file system.

Is this what a file system means?

No… It refers to the underlying bits and bytes that make your directory structure work.

The underlying bits and bytes? Show me FAT32!

Let’s look at what FAT32 looks like, it has:

  • Some header sectors in the beginning, like Volume ID and Reserved Sectors
  • Two File Allocation Tables, allowing us to figure out where our files are.
  • Clusters containing all our directory and file data.
  • Some very small unused space that we can’t use.
A FAT table consists of a lot of entries that look like this, allowing us to determine where the directory or file is stored in the clusters space, as well as some attributes and size.
A FAT table consists of a lot of entries that look like this, allowing us to determine where the directory or file is stored in the clusters space, as well as some attributes and size.

A directory entry would point to a list of directory/file entries…

In the clusters space, we can now travel our clusters to find the data we need. A cluster essentially contains data and information where the next fragments are
In the clusters space, we can now travel our clusters to find the data we need. A cluster essentially contains data and information where the next fragments are
Image
Image

Do other file systems differ? Show me NTFS!

I’m going to show you an image so you can notice the differences, the rest is homework for the reader: More information can be found on this blog archive or Google.

The main idea is that NTFS is a huge improvement over FAT32 that is more robust/efficient. Having a better idea of (un)used space by using a bitmap to further help against fragmentation. And so on…

Image
Image

What about the file systems on Linux? Show me ext2/3!

The idea is that ext2/ext3 use super blocks and inodes; this allows for soft and hardlinks, directories that are files, files with multiple names and so on. The main gist is abstracting away to allow the file system to be capable of doing more meta-ish stuff…

Image
Image

Để đọc thêm về các hệ thống tệp, hãy đảm bảo kiểm tra các bài viết Cách làm như sau:

  • HTG giải thích: Cấu trúc thư mục Linux được giải thích
  • HTG giải thích: Hệ thống tập tin Linux nào bạn nên chọn?
  • Tôi nên sử dụng hệ thống tệp nào cho ổ USB của mình?

Có cái gì để thêm vào lời giải thích? Âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Đề xuất: