Sistema de arquivos
Da Wikipedia (adaptado):
Em computação, sistema de arquivos é a forma de organização de dados em algum meio de armazenamento de dados em massa. Ele controla como os dados são armazenados e recuperados, possibilitando ao sistema operacional decodificar os dados armazenados e lê-los ou gravá-los. Sem um sistema de arquivos, as informações colocadas em um meio de armazenamento seriam um grande corpo de dados, sem nenhuma maneira de dizer onde uma parte da informação termina e a próxima começa. Ao separar os dados em pedaços e dar um nome a cada peça, a informação é facilmente isolada e identificada. Tomando seu nome a partir do modo como os sistemas de informação baseados em papel são nomeados, cada grupo de dados é chamado de "arquivo".
Existem muitos tipos diferentes de sistemas de arquivos. Cada um tem estrutura e lógica diferentes, propriedades de velocidade, flexibilidade, segurança, tamanho e muito mais.
Arquivos e diretórios são colocados no topo do sistema de arquivos, portanto, é comum referir-se à própria estrutura de arquivos/diretórios como " sistema de arquivos". No GNU/Linux, o Padrão de Hierarquia de Sistemas de Arquivo (Filesystem Hierarchy Standard) define o esquema de nomenclatura e hierarquia entre arquivos e diretórios.
Os sistemas de arquivos geralmente ficam em cima partições de disco rígido ou volumes LVM. No Debian, ext4 é o sistema de arquivos padrão para novas instalações.
GNU/Linux pode ser instalado em qualquer sistema de arquivos que suporta algumas construções especiais (permissões de arquivo, links simbólicos e arquivos de dispositivo).
Muitos sistemas de arquivos são diários (journaling), o que significa que são capazes de evitar perda de dados em falhas do sistema ou em falhas de energia.
Contents
Montando um sistema de arquivos
No GNU/Linux, o conteúdo de um sistema de arquivos pode ser disponibilizado sob um diretório ao se montar o sistema de arquivos sobre o diretório. Aqui estão algumas maneiras de montar um sistema de arquivos:
Comando mount. Por exemplo, mount /dev/sdd1 /mn/ tornará disponível o conteúdo da primeira partição do dispositivo de disco /dev/sdd no diretório /mnt/.
Editar o arquivo fstab
Convertendo um sistema de arquivos
- Sistemas de arquivo ISO podem ser montados em loopback
fstransform pode conveter entre ext2, ext3, ext4, jfs, minix, reiserfs, xfs
btrfs-convert pode converter entre ext2, ext3, ext4, reiserfs (quando reconstruído com libreiserfscore-dev), ntfs (com ntfs2btrfs) para BTRFS
ntfs2btrfs pode converter NTFS para BTRFS
Sistemas de arquivo disponíveis no núcleo Linux do Debian
Nota0: Debian HURD e Debian kFreeBSD têm outros sistemas de arquivos.
Nota1: a lista de funcionalidades está incompleta no momento.
Nota2: Esta tabela foi atualizada até o kernel 2.6.28.
Nome do sistema de arquivo |
Funcionalidades? |
Documentações |
Descrição |
Distribuições |
File systems often used as linux system partition |
|
|||
R |
(default filesystem in Debian) Fourth Extended Filesystem with extents |
>= Squeeze |
||
ext2 |
RS |
Second Extended Filesystem |
All? |
|
RS |
Second Extended Filesystem with journaling extensions |
All? |
||
R |
Fourth Extended Filesystem with extents |
Etch-n-Half ~ Lenny |
||
jfs |
R |
The Journaled Filesystem (JFS) |
All? |
|
xfs |
R |
SGI XFS Filesystem |
All? |
|
reiserfs |
R |
ReiserFS journaled filesystem |
All? |
|
Outros sistemas de arquivos |
|
|||
9p |
|
Plan 9 9p remote filesystem protocol |
All? |
|
adfs |
|
Acorn (and Risc OS) Advanced Disc Filing System |
All? |
|
affs |
I |
Amiga filesystem support for Linux |
All? |
|
apfs |
I |
kernel module with apfs-dkms |
Apple filesystem support for Linux |
NEW |
kafs |
N |
AFS Client File System |
All? |
|
autofs4 |
|
Auto-mount filesystems. See autofs |
All? |
|
autofs |
|
Auto-mount filesystems. See autofs |
All? |
|
befs |
I |
BeOS File System (BeFS) driver |
All? |
|
bfs |
I |
SCO UnixWare BFS filesystem for Linux |
All? |
|
RS |
B-Tree filesystem |
>= Jessie |
||
cifs |
N I |
VFS to access servers complying with the SNIA CIFS Specification e.g. Samba and Windows |
All? |
|
coda |
|
Coda Distributed File System VFS interface |
All? |
|
configfs |
|
Simple RAM filesystem for user driven kernel subsystem configuration. |
All? |
|
cramfs |
|
cram a filesystem onto a small ROM |
All? |
|
dlm |
|
Distributed Lock Manager |
All? |
|
ecryptfs |
|
eCryptfs |
All? |
|
efs |
|
SGI EFS, Extent File System (Irix <0.6) |
All? |
|
fat |
I |
MS & DR DOS FAT filesystem |
All? |
|
freevxfs |
|
Veritas Filesystem (VxFS) driver |
All? |
|
fuse |
Filesystem in Userspace (backend for various filesystems) |
All? |
||
gfs2 |
N |
Global File System |
All? |
|
hfs |
I |
Macintosh HFS Filesystem |
All? |
|
hfsplus |
I |
HFSPlus / Extended Macintosh Filesystem |
All? |
|
hpfs |
I |
High Performance Filesys (OS/2's HPFS) |
All? |
|
isofs |
CD |
CD/DVD filesystem (ISO-9660 / ECMA-119) |
All? |
|
jbd2 |
|
|
Generic filesystem journal-writing code (for ext4) |
Squeeze |
jbd |
|
|
Generic filesystem journal-writing code (for ext2/ext3) |
All? |
jffs2 |
MTD |
The Journalling Flash File System, v2 |
All? |
|
minix |
|
|
Minix native filesystem. (was used in Linux before ExtFS!) |
All? |
msdos |
I |
MS-DOS filesystem support |
All? |
|
ncpfs |
|
Netware NCP network protocol |
All? |
|
N |
Networks Filesystem |
All? |
||
I |
NTFS 1.2/3.x driver - Copyright (c) 2001-2007 Anton Altaparmakov |
All? |
||
ocfs2 |
|
OCFS2 1.3.3 |
All? |
|
omfs |
|
OMFS (ReplayTV/Karma) Optimized MPEG Filesystem |
>= Squeeze |
|
qnx4 |
|
QNX (OS) Filesystem |
All? |
|
romfs |
|
ROM filesystem. See genromfs |
<= Etch |
|
sysv |
|
System V, V7 and Coherent and Xenix filesystems |
All? |
|
ubifs |
MTD |
UBIFS - UBI File System |
=> Squeeze |
|
udf |
CD |
Universal Disk Format Filesystem |
All? |
|
ufs |
|
Unix filesystem, used in BSDs, SunOS, Nextstep, Openstep... |
All? |
|
vfat |
I |
VFAT filesystem support |
All? |
|
|
The Z File System |
=> Stretch (DKMS) |
||
Features Legend :
Root: Suitable for system file system (like root and /usr...).
Interoperability: The filesystem is mostly implemented for Interoperability.
Distributed: file system.
Network Filesystem.
Sparsefile support
CD: Suitable for CD and/or DVD, etc.
MTD: Suitable for MTD devices.
Dicas:
Para listar os tipos de sistemas de arquivos suportados por seu núcleo, leia seu arquivo config, executando:
awk '/# File systems/,/# Partition Types/' /boot/config-$(uname -r)* | pager
- Para listar os módulos de sistemas de arquivos disponíveis no seu núcleo:
find /lib/modules/$(uname -r)/kernel/fs/
Para listar os sistemas de arquivos suportados pelo seu núcleo sendo executado e módulos atualmente carregados:cat /proc/filesystems
Sistemas de arquivos FUSE
Você pode obter a lista de sistemas de arquivos suportada através do FUSE observando as dependências reversas do pacote fuse-utils. No momento desta escrita:
Package name |
Description |
Distributions |
FUSE filesystem for APT source repositories |
All |
|
virtual filesystem to access archives, disk images, remote locations |
All |
|
implements a filesystem representing a live Beagle query |
Sid |
|
EncFS system tray applet for GNOME |
All |
|
filesystem to access FTP hosts based on FUSE and cURL |
All |
|
mount a WebDAV resource as a regular file system |
All |
|
encrypted virtual filesystem |
All |
|
virtual filesystem for flickr online photosharing service |
All |
|
user-space directory concatenation |
? |
|
File System in User Space - Module for ext2 |
All |
|
File System in User Space - Module for FAT |
All |
|
FUSE module to mount ISO filesystem images |
All |
|
File System in User Space - Module for ISO9660 |
All |
|
filesystem client based on the SMB file transfer protocol |
All |
|
clustered file-system |
All |
|
Use your GMail account as a filesystem |
? |
|
filesystem to mount digital cameras |
All |
|
PAM module to automatically mount encfs filesystems on login |
All |
|
PAM module that can mount volumes for a user session |
All |
|
Fuse based remote filesystem for LTSP thin clients |
All |
|
file system for unifying several mount points into one |
All |
|
FUSE filesystem for Media Transfer Protocol devices |
All |
|
userspace filesystem client for MythTV |
All |
|
read/write NTFS driver for FUSE |
>= Wheezy |
|
ntfsprogs (depreciated) |
tools for doing neat things in NTFS partitions from Linux |
All |
mount filesystem of ObexFTP capable devices |
All |
|
Access EPOC device (Psion PDA) over a serial link |
All |
|
maps media files to an arbitrary directory structure |
All |
|
Read-Only Filesystem for FUSE |
All |
|
Full-featured file system for online data storage |
All |
|
filesystem client based on SSH File Transfer Protocol |
All |
|
View-OS in user space - ext2 module for UMFUSE |
All |
|
View-OS in user space - FAT module for UMFUSE |
All |
|
View-OS in user space - ISO9660 module for UMFUSE |
All |
|
Fuse implementation of unionfs |
All |
|
View and edit Wikipedia articles as if they were real files |
All |
|
implementation of Sun's ZFS filesystem in userspace |
>=Squeeze |
Sistemas de arquivo especiais
Algumas amostras de caso de uso de sistemas de arquivos especiais:
- aufs, unionfs
- pode ser usado para montar dois sistemas de arquivos, um em cima do outro. Isso normalmente é usado para montar um ramdisk em cima de um cdrom (apenas para leitura!)... então é virtualmente possível "escrever" e modificar os arquivos (claro, nesta situação os dados são perdidos na reinicialização).
- xmount
permite montagem de imagens .vmdk (VMware) e .vdi(VirtualBox).
Veja também
Documentos na documentação de módulos do núcleo /usr/share/doc/linux-doc-2.6.26/Documentation/filesystems/ (no pacote linux-doc-2.6 ou posteriores).
ToDo: Alguns módulos fornecem dois sistemas de arquivos (para mount -t), ou seja, carregar sysv fornece sysv e v7 em /proc/filesystems.
CategorySystemAdministration CategoryStorage
FUSE doesn't provide any filesystem it-self. see 'apt-cache rdepends fuse-utils' (1)

awk '/# File systems/,/# Partition Types/' /boot/config-2.6.28-1-686 # File systems # CONFIG_EXT2_FS=m CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=m CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_EXT4_FS=m CONFIG_EXT4DEV_COMPAT=y CONFIG_EXT4_FS_XATTR=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y CONFIG_JBD=m # CONFIG_JBD_DEBUG is not set CONFIG_JBD2=m # CONFIG_JBD2_DEBUG is not set CONFIG_FS_MBCACHE=m CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_FS_POSIX_ACL=y CONFIG_FILE_LOCKING=y CONFIG_XFS_FS=m CONFIG_XFS_QUOTA=y CONFIG_XFS_POSIX_ACL=y CONFIG_XFS_RT=y # CONFIG_XFS_DEBUG is not set CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=m CONFIG_OCFS2_FS=m CONFIG_OCFS2_FS_O2CB=m CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m CONFIG_OCFS2_FS_STATS=y CONFIG_OCFS2_DEBUG_MASKLOG=y # CONFIG_OCFS2_DEBUG_FS is not set # CONFIG_OCFS2_COMPAT_JBD is not set CONFIG_DNOTIFY=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y CONFIG_PRINT_QUOTA_WARNING=y CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m CONFIG_FUSE_FS=m CONFIG_GENERIC_ACL=y
# # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=m CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_UDF_FS=m CONFIG_UDF_NLS=y
# # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="utf8" CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set CONFIG_NTFS_RW=y
# # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_PROC_SYSCTL=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_SYSFS=y CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_CONFIGFS_FS=m
# # Miscellaneous filesystems # CONFIG_ADFS_FS=m # CONFIG_ADFS_FS_RW is not set CONFIG_AFFS_FS=m CONFIG_ECRYPT_FS=m CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m CONFIG_BEFS_FS=m # CONFIG_BEFS_DEBUG is not set CONFIG_BFS_FS=m CONFIG_EFS_FS=m CONFIG_JFFS2_FS=m CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y # CONFIG_JFFS2_FS_WBUF_VERIFY is not set CONFIG_JFFS2_SUMMARY=y CONFIG_JFFS2_FS_XATTR=y CONFIG_JFFS2_FS_POSIX_ACL=y CONFIG_JFFS2_FS_SECURITY=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_LZO=y CONFIG_JFFS2_RTIME=y # CONFIG_JFFS2_RUBIN is not set # CONFIG_JFFS2_CMODE_NONE is not set CONFIG_JFFS2_CMODE_PRIORITY=y # CONFIG_JFFS2_CMODE_SIZE is not set # CONFIG_JFFS2_CMODE_FAVOURLZO is not set CONFIG_UBIFS_FS=m CONFIG_UBIFS_FS_XATTR=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y # CONFIG_UBIFS_FS_DEBUG is not set CONFIG_CRAMFS=m CONFIG_VXFS_FS=m CONFIG_MINIX_FS=m CONFIG_OMFS_FS=m CONFIG_HPFS_FS=m CONFIG_QNX4FS_FS=m CONFIG_ROMFS_FS=m CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # CONFIG_UFS_DEBUG is not set CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m CONFIG_NFS_V3=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y CONFIG_NFSD=m CONFIG_NFSD_V2_ACL=y CONFIG_NFSD_V3=y CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_NFS_ACL_SUPPORT=m CONFIG_NFS_COMMON=y CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_SUNRPC_XPRT_RDMA=m # CONFIG_SUNRPC_REGISTER_V4 is not set CONFIG_RPCSEC_GSS_KRB5=m CONFIG_RPCSEC_GSS_SPKM3=m # CONFIG_SMB_FS is not set CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set CONFIG_CIFS_WEAK_PW_HASH=y CONFIG_CIFS_UPCALL=y CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_DEBUG2 is not set CONFIG_CIFS_EXPERIMENTAL=y CONFIG_CIFS_DFS_UPCALL=y CONFIG_NCP_FS=m # CONFIG_NCPFS_PACKET_SIGNING is not set # CONFIG_NCPFS_IOCTL_LOCKING is not set # CONFIG_NCPFS_STRONG is not set CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y # CONFIG_NCPFS_SMALLDOS is not set CONFIG_NCPFS_NLS=y CONFIG_NCPFS_EXTRAS=y CONFIG_CODA_FS=m CONFIG_AFS_FS=m # CONFIG_AFS_DEBUG is not set CONFIG_9P_FS=m
# # Partition Types