Файловата система е само една група от папки? (Обяснени файлови системи)

Съдържание:

Файловата система е само една група от папки? (Обяснени файлови системи)
Файловата система е само една група от папки? (Обяснени файлови системи)

Видео: Файловата система е само една група от папки? (Обяснени файлови системи)

Видео: Файловата система е само една група от папки? (Обяснени файлови системи)
Видео: BlitzWolf BW-IS22 - Сигнализация, wi-fi + GSM, Tuya Smart, интеграция и управление в Home Assistant - YouTube 2024, Април
Anonim
На повърхността файловата система на операционната ви система може просто да изглежда като голяма купчина папки, но със сигурност има повече от нея. Прочетете, докато разследваме какво се крие под повърхността на файловата система.
На повърхността файловата система на операционната ви система може просто да изглежда като голяма купчина папки, но със сигурност има повече от нея. Прочетете, докато разследваме какво се крие под повърхността на файловата система.

Днешната сесия за въпроси и отговори ни идва с любезното съдействие на SuperUser - подразделение на Stack Exchange - обединяване на уеб сайтове с въпроси и отговори.

Въпроса

Reader на SuperUser P_Q е любопитен за файловите системи, пише:

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?

Дали това просто взема на файловата система най-точния начин за описване? Нека да копаем малко по-надълбоко.

Отговорът

Сътрудникът на SuperUser Tom Wijsman предлага проницателен поглед върху структурата на файловите системи в операционните системи Windows и Linux. Той пише:

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

За повече четене на файлови системи, не забравяйте да проверите следните статии "Как да" Geek:

  • HTG обяснява: Структурата на директорията на Linux е обяснена
  • HTG обяснява: коя Linux файлова система трябва да избереш?
  • Каква файлова система трябва да използвам за моя USB диск?

Имате ли нещо, което да добавите към обяснението? Звучи в коментарите. Искате ли да прочетете повече отговори от други потребители на Stack Exchange? Вижте цялата тема на дискусията тук.

Препоръчано: