A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de sites de perguntas e respostas conduzido pela comunidade.
A questão
Leitor SuperUser P_Q está curioso sobre sistemas de arquivos, ele escreve:
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?
Isto é simples de assumir o sistema de arquivos a maneira mais precisa de descrevê-lo? Vamos cavar um pouco mais.
A resposta
O colaborador do SuperUser Tom Wijsman oferece uma visão perspicaz da estrutura dos sistemas de arquivos nos sistemas operacionais Windows e Linux. Ele escreve:
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 directory entry would point to a list of directory/file entries…
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…
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…
Para mais informações sobre sistemas de arquivos, verifique os seguintes artigos How-To Geek:
- HTG explica: A estrutura de diretórios do Linux explicada
- HTG explica: Qual sistema de arquivos Linux você deve escolher?
- Qual sistema de arquivos devo usar para o meu drive USB?
Tem algo a acrescentar à explicação? Soe fora nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.