Commit 0150aedd authored by Jonathan Corbet's avatar Jonathan Corbet

Merge branch 'mauro' into docs-next

Mauro sez:

  There are lots of plain text documents under Documentation/filesystems.
  Manually convert several of those to ReST and add them to the index file.
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parents 3eb30c51 9a610812
v9fs: Plan 9 Resource Sharing for Linux .. SPDX-License-Identifier: GPL-2.0
=======================================
ABOUT =======================================
v9fs: Plan 9 Resource Sharing for Linux
=======================================
About
===== =====
v9fs is a Unix implementation of the Plan 9 9p remote filesystem protocol. v9fs is a Unix implementation of the Plan 9 9p remote filesystem protocol.
...@@ -14,32 +17,34 @@ and Maya Gokhale. Additional development by Greg Watson ...@@ -14,32 +17,34 @@ and Maya Gokhale. Additional development by Greg Watson
The best detailed explanation of the Linux implementation and applications of The best detailed explanation of the Linux implementation and applications of
the 9p client is available in the form of a USENIX paper: the 9p client is available in the form of a USENIX paper:
http://www.usenix.org/events/usenix05/tech/freenix/hensbergen.html http://www.usenix.org/events/usenix05/tech/freenix/hensbergen.html
Other applications are described in the following papers: Other applications are described in the following papers:
* XCPU & Clustering * XCPU & Clustering
http://xcpu.org/papers/xcpu-talk.pdf http://xcpu.org/papers/xcpu-talk.pdf
* KVMFS: control file system for KVM * KVMFS: control file system for KVM
http://xcpu.org/papers/kvmfs.pdf http://xcpu.org/papers/kvmfs.pdf
* CellFS: A New Programming Model for the Cell BE * CellFS: A New Programming Model for the Cell BE
http://xcpu.org/papers/cellfs-talk.pdf http://xcpu.org/papers/cellfs-talk.pdf
* PROSE I/O: Using 9p to enable Application Partitions * PROSE I/O: Using 9p to enable Application Partitions
http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf
* VirtFS: A Virtualization Aware File System pass-through * VirtFS: A Virtualization Aware File System pass-through
http://goo.gl/3WPDg http://goo.gl/3WPDg
USAGE Usage
===== =====
For remote file server: For remote file server::
mount -t 9p 10.10.1.2 /mnt/9 mount -t 9p 10.10.1.2 /mnt/9
For Plan 9 From User Space applications (http://swtch.com/plan9) For Plan 9 From User Space applications (http://swtch.com/plan9)::
mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER
For server running on QEMU host with virtio transport: For server running on QEMU host with virtio transport::
mount -t 9p -o trans=virtio <mount_tag> /mnt/9 mount -t 9p -o trans=virtio <mount_tag> /mnt/9
...@@ -48,18 +53,22 @@ mount points. Each 9P export is seen by the client as a virtio device with an ...@@ -48,18 +53,22 @@ mount points. Each 9P export is seen by the client as a virtio device with an
associated "mount_tag" property. Available mount tags can be associated "mount_tag" property. Available mount tags can be
seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files. seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files.
OPTIONS Options
======= =======
============= ===============================================================
trans=name select an alternative transport. Valid options are trans=name select an alternative transport. Valid options are
currently: currently:
unix - specifying a named pipe mount point
tcp - specifying a normal TCP/IP connection ======== ============================================
fd - used passed file descriptors for connection unix specifying a named pipe mount point
(see rfdno and wfdno) tcp specifying a normal TCP/IP connection
virtio - connect to the next virtio channel available fd used passed file descriptors for connection
(from QEMU with trans_virtio module) (see rfdno and wfdno)
rdma - connect to a specified RDMA channel virtio connect to the next virtio channel available
(from QEMU with trans_virtio module)
rdma connect to a specified RDMA channel
======== ============================================
uname=name user name to attempt mount as on the remote server. The uname=name user name to attempt mount as on the remote server. The
server may override or ignore this value. Certain user server may override or ignore this value. Certain user
...@@ -69,28 +78,36 @@ OPTIONS ...@@ -69,28 +78,36 @@ OPTIONS
offering several exported file systems. offering several exported file systems.
cache=mode specifies a caching policy. By default, no caches are used. cache=mode specifies a caching policy. By default, no caches are used.
none = default no cache policy, metadata and data
none
default no cache policy, metadata and data
alike are synchronous. alike are synchronous.
loose = no attempts are made at consistency, loose
no attempts are made at consistency,
intended for exclusive, read-only mounts intended for exclusive, read-only mounts
fscache = use FS-Cache for a persistent, read-only fscache
use FS-Cache for a persistent, read-only
cache backend. cache backend.
mmap = minimal cache that is only used for read-write mmap
minimal cache that is only used for read-write
mmap. Northing else is cached, like cache=none mmap. Northing else is cached, like cache=none
debug=n specifies debug level. The debug level is a bitmask. debug=n specifies debug level. The debug level is a bitmask.
0x01 = display verbose error messages
0x02 = developer debug (DEBUG_CURRENT) ===== ================================
0x04 = display 9p trace 0x01 display verbose error messages
0x08 = display VFS trace 0x02 developer debug (DEBUG_CURRENT)
0x10 = display Marshalling debug 0x04 display 9p trace
0x20 = display RPC debug 0x08 display VFS trace
0x40 = display transport debug 0x10 display Marshalling debug
0x80 = display allocation debug 0x20 display RPC debug
0x100 = display protocol message debug 0x40 display transport debug
0x200 = display Fid debug 0x80 display allocation debug
0x400 = display packet debug 0x100 display protocol message debug
0x800 = display fscache tracing debug 0x200 display Fid debug
0x400 display packet debug
0x800 display fscache tracing debug
===== ================================
rfdno=n the file descriptor for reading with trans=fd rfdno=n the file descriptor for reading with trans=fd
...@@ -103,9 +120,12 @@ OPTIONS ...@@ -103,9 +120,12 @@ OPTIONS
noextend force legacy mode (no 9p2000.u or 9p2000.L semantics) noextend force legacy mode (no 9p2000.u or 9p2000.L semantics)
version=name Select 9P protocol version. Valid options are: version=name Select 9P protocol version. Valid options are:
9p2000 - Legacy mode (same as noextend)
9p2000.u - Use 9P2000.u protocol ======== ==============================
9p2000.L - Use 9P2000.L protocol 9p2000 Legacy mode (same as noextend)
9p2000.u Use 9P2000.u protocol
9p2000.L Use 9P2000.L protocol
======== ==============================
dfltuid attempt to mount as a particular uid dfltuid attempt to mount as a particular uid
...@@ -118,22 +138,27 @@ OPTIONS ...@@ -118,22 +138,27 @@ OPTIONS
hosts. This functionality will be expanded in later versions. hosts. This functionality will be expanded in later versions.
access there are four access modes. access there are four access modes.
user = if a user tries to access a file on v9fs user
if a user tries to access a file on v9fs
filesystem for the first time, v9fs sends an filesystem for the first time, v9fs sends an
attach command (Tattach) for that user. attach command (Tattach) for that user.
This is the default mode. This is the default mode.
<uid> = allows only user with uid=<uid> to access <uid>
allows only user with uid=<uid> to access
the files on the mounted filesystem the files on the mounted filesystem
any = v9fs does single attach and performs all any
v9fs does single attach and performs all
operations as one user operations as one user
client = ACL based access check on the 9p client clien
ACL based access check on the 9p client
side for access validation side for access validation
cachetag cache tag to use the specified persistent cache. cachetag cache tag to use the specified persistent cache.
cache tags for existing cache sessions can be listed at cache tags for existing cache sessions can be listed at
/sys/fs/9p/caches. (applies only to cache=fscache) /sys/fs/9p/caches. (applies only to cache=fscache)
============= ===============================================================
RESOURCES Resources
========= =========
Protocol specifications are maintained on github: Protocol specifications are maintained on github:
...@@ -158,4 +183,3 @@ http://plan9.bell-labs.com/plan9 ...@@ -158,4 +183,3 @@ http://plan9.bell-labs.com/plan9
For information on Plan 9 from User Space (Plan 9 applications and libraries For information on Plan 9 from User Space (Plan 9 applications and libraries
ported to Linux/BSD/OSX/etc) check out http://swtch.com/plan9 ported to Linux/BSD/OSX/etc) check out http://swtch.com/plan9
.. SPDX-License-Identifier: GPL-2.0
===============================
Acorn Disc Filing System - ADFS
===============================
Filesystems supported by ADFS Filesystems supported by ADFS
----------------------------- -----------------------------
...@@ -25,6 +31,7 @@ directory updates, specifically updating the access mode and timestamp. ...@@ -25,6 +31,7 @@ directory updates, specifically updating the access mode and timestamp.
Mount options for ADFS Mount options for ADFS
---------------------- ----------------------
============ ======================================================
uid=nnn All files in the partition will be owned by uid=nnn All files in the partition will be owned by
user id nnn. Default 0 (root). user id nnn. Default 0 (root).
gid=nnn All files in the partition will be in group gid=nnn All files in the partition will be in group
...@@ -36,22 +43,23 @@ Mount options for ADFS ...@@ -36,22 +43,23 @@ Mount options for ADFS
ftsuffix=n When ftsuffix=0, no file type suffix will be applied. ftsuffix=n When ftsuffix=0, no file type suffix will be applied.
When ftsuffix=1, a hexadecimal suffix corresponding to When ftsuffix=1, a hexadecimal suffix corresponding to
the RISC OS file type will be added. Default 0. the RISC OS file type will be added. Default 0.
============ ======================================================
Mapping of ADFS permissions to Linux permissions Mapping of ADFS permissions to Linux permissions
------------------------------------------------ ------------------------------------------------
ADFS permissions consist of the following: ADFS permissions consist of the following:
Owner read - Owner read
Owner write - Owner write
Other read - Other read
Other write - Other write
(In older versions, an 'execute' permission did exist, but this (In older versions, an 'execute' permission did exist, but this
does not hold the same meaning as the Linux 'execute' permission does not hold the same meaning as the Linux 'execute' permission
and is now obsolete). and is now obsolete).
The mapping is performed as follows: The mapping is performed as follows::
Owner read -> -r--r--r-- Owner read -> -r--r--r--
Owner write -> --w--w---w Owner write -> --w--w---w
...@@ -66,17 +74,18 @@ Mapping of ADFS permissions to Linux permissions ...@@ -66,17 +74,18 @@ Mapping of ADFS permissions to Linux permissions
Possible other mode permissions -> ----rwxrwx Possible other mode permissions -> ----rwxrwx
Hence, with the default masks, if a file is owner read/write, and Hence, with the default masks, if a file is owner read/write, and
not a UnixExec filetype, then the permissions will be: not a UnixExec filetype, then the permissions will be::
-rw------- -rw-------
However, if the masks were ownmask=0770,othmask=0007, then this would However, if the masks were ownmask=0770,othmask=0007, then this would
be modified to: be modified to::
-rw-rw---- -rw-rw----
There is no restriction on what you can do with these masks. You may There is no restriction on what you can do with these masks. You may
wish that either read bits give read access to the file for all, but wish that either read bits give read access to the file for all, but
keep the default write protection (ownmask=0755,othmask=0577): keep the default write protection (ownmask=0755,othmask=0577)::
-rw-r--r-- -rw-r--r--
......
.. SPDX-License-Identifier: GPL-2.0
=============================
Overview of Amiga Filesystems Overview of Amiga Filesystems
============================= =============================
Not all varieties of the Amiga filesystems are supported for reading and Not all varieties of the Amiga filesystems are supported for reading and
writing. The Amiga currently knows six different filesystems: writing. The Amiga currently knows six different filesystems:
============== ===============================================================
DOS\0 The old or original filesystem, not really suited for DOS\0 The old or original filesystem, not really suited for
hard disks and normally not used on them, either. hard disks and normally not used on them, either.
Supported read/write. Supported read/write.
...@@ -23,6 +27,7 @@ DOS\4 The original filesystem with directory cache. The directory ...@@ -23,6 +27,7 @@ DOS\4 The original filesystem with directory cache. The directory
sense on hard disks. Supported read only. sense on hard disks. Supported read only.
DOS\5 The Fast File System with directory cache. Supported read only. DOS\5 The Fast File System with directory cache. Supported read only.
============== ===============================================================
All of the above filesystems allow block sizes from 512 to 32K bytes. All of the above filesystems allow block sizes from 512 to 32K bytes.
Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
...@@ -36,14 +41,18 @@ are supported, too. ...@@ -36,14 +41,18 @@ are supported, too.
Mount options for the AFFS Mount options for the AFFS
========================== ==========================
protect If this option is set, the protection bits cannot be altered. protect
If this option is set, the protection bits cannot be altered.
setuid[=uid] This sets the owner of all files and directories in the file setuid[=uid]
This sets the owner of all files and directories in the file
system to uid or the uid of the current user, respectively. system to uid or the uid of the current user, respectively.
setgid[=gid] Same as above, but for gid. setgid[=gid]
Same as above, but for gid.
mode=mode Sets the mode flags to the given (octal) value, regardless mode=mode
Sets the mode flags to the given (octal) value, regardless
of the original permissions. Directories will get an x of the original permissions. Directories will get an x
permission if the corresponding r bit is set. permission if the corresponding r bit is set.
This is useful since most of the plain AmigaOS files This is useful since most of the plain AmigaOS files
...@@ -53,33 +62,41 @@ nofilenametruncate ...@@ -53,33 +62,41 @@ nofilenametruncate
The file system will return an error when filename exceeds The file system will return an error when filename exceeds
standard maximum filename length (30 characters). standard maximum filename length (30 characters).
reserved=num Sets the number of reserved blocks at the start of the reserved=num
Sets the number of reserved blocks at the start of the
partition to num. You should never need this option. partition to num. You should never need this option.
Default is 2. Default is 2.
root=block Sets the block number of the root block. This should never root=block
Sets the block number of the root block. This should never
be necessary. be necessary.
bs=blksize Sets the blocksize to blksize. Valid block sizes are 512, bs=blksize
Sets the blocksize to blksize. Valid block sizes are 512,
1024, 2048 and 4096. Like the root option, this should 1024, 2048 and 4096. Like the root option, this should
never be necessary, as the affs can figure it out itself. never be necessary, as the affs can figure it out itself.
quiet The file system will not return an error for disallowed quiet
The file system will not return an error for disallowed
mode changes. mode changes.
verbose The volume name, file system type and block size will verbose
The volume name, file system type and block size will
be written to the syslog when the filesystem is mounted. be written to the syslog when the filesystem is mounted.
mufs The filesystem is really a muFS, also it doesn't mufs
The filesystem is really a muFS, also it doesn't
identify itself as one. This option is necessary if identify itself as one. This option is necessary if
the filesystem wasn't formatted as muFS, but is used the filesystem wasn't formatted as muFS, but is used
as one. as one.
prefix=path Path will be prefixed to every absolute path name of prefix=path
Path will be prefixed to every absolute path name of
symbolic links on an AFFS partition. Default = "/". symbolic links on an AFFS partition. Default = "/".
(See below.) (See below.)
volume=name When symbolic links with an absolute path are created volume=name
When symbolic links with an absolute path are created
on an AFFS partition, name will be prepended as the on an AFFS partition, name will be prepended as the
volume name. Default = "" (empty string). volume name. Default = "" (empty string).
(See below.) (See below.)
...@@ -119,7 +136,7 @@ The Linux rwxrwxrwx file mode is handled as follows: ...@@ -119,7 +136,7 @@ The Linux rwxrwxrwx file mode is handled as follows:
- All other flags (suid, sgid, ...) are ignored and will - All other flags (suid, sgid, ...) are ignored and will
not be retained. not be retained.
Newly created files and directories will get the user and group ID Newly created files and directories will get the user and group ID
of the current user and a mode according to the umask. of the current user and a mode according to the umask.
...@@ -148,11 +165,13 @@ might be "User", "WB" and "Graphics", the mount points /amiga/User, ...@@ -148,11 +165,13 @@ might be "User", "WB" and "Graphics", the mount points /amiga/User,
Examples Examples
======== ========
Command line: Command line::
mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
mount /dev/sda3 /Amiga -t affs mount /dev/sda3 /Amiga -t affs
/etc/fstab entry: /etc/fstab entry::
/dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0 /dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
IMPORTANT NOTE IMPORTANT NOTE
...@@ -170,7 +189,8 @@ before booting Windows! ...@@ -170,7 +189,8 @@ before booting Windows!
If the damage is already done, the following should fix the RDB If the damage is already done, the following should fix the RDB
(where <disk> is the device name). (where <disk> is the device name).
DO AT YOUR OWN RISK:
DO AT YOUR OWN RISK::
dd if=/dev/<disk> of=rdb.tmp count=1 dd if=/dev/<disk> of=rdb.tmp count=1
cp rdb.tmp rdb.fixed cp rdb.tmp rdb.fixed
...@@ -189,10 +209,14 @@ By default, filenames are truncated to 30 characters without warning. ...@@ -189,10 +209,14 @@ By default, filenames are truncated to 30 characters without warning.
'nofilenametruncate' mount option can change that behavior. 'nofilenametruncate' mount option can change that behavior.
Case is ignored by the affs in filename matching, but Linux shells Case is ignored by the affs in filename matching, but Linux shells
do care about the case. Example (with /wb being an affs mounted fs): do care about the case. Example (with /wb being an affs mounted fs)::
rm /wb/WRONGCASE rm /wb/WRONGCASE
will remove /mnt/wrongcase, but
will remove /mnt/wrongcase, but::
rm /wb/WR* rm /wb/WR*
will not since the names are matched by the shell. will not since the names are matched by the shell.
The block allocation is designed for hard disk partitions. If more The block allocation is designed for hard disk partitions. If more
...@@ -219,4 +243,4 @@ due to an incompatibility with the Amiga floppy controller. ...@@ -219,4 +243,4 @@ due to an incompatibility with the Amiga floppy controller.
If you are interested in an Amiga Emulator for Linux, look at If you are interested in an Amiga Emulator for Linux, look at
http://web.archive.org/web/*/http://www.freiburg.linux.de/~uae/ http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/
==================== .. SPDX-License-Identifier: GPL-2.0
kAFS: AFS FILESYSTEM
====================
Contents: ====================
kAFS: AFS FILESYSTEM
====================
.. Contents:
- Overview. - Overview.
- Usage. - Usage.
...@@ -14,8 +16,7 @@ Contents: ...@@ -14,8 +16,7 @@ Contents:
- The @sys substitution. - The @sys substitution.
======== Overview
OVERVIEW
======== ========
This filesystem provides a fairly simple secure AFS filesystem driver. It is This filesystem provides a fairly simple secure AFS filesystem driver. It is
...@@ -35,35 +36,33 @@ It does not yet support the following AFS features: ...@@ -35,35 +36,33 @@ It does not yet support the following AFS features:
(*) pioctl() system call. (*) pioctl() system call.
=========== Compilation
COMPILATION
=========== ===========
The filesystem should be enabled by turning on the kernel configuration The filesystem should be enabled by turning on the kernel configuration
options: options::
CONFIG_AF_RXRPC - The RxRPC protocol transport CONFIG_AF_RXRPC - The RxRPC protocol transport
CONFIG_RXKAD - The RxRPC Kerberos security handler CONFIG_RXKAD - The RxRPC Kerberos security handler
CONFIG_AFS - The AFS filesystem CONFIG_AFS - The AFS filesystem
Additionally, the following can be turned on to aid debugging: Additionally, the following can be turned on to aid debugging::
CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled
CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled
They permit the debugging messages to be turned on dynamically by manipulating They permit the debugging messages to be turned on dynamically by manipulating
the masks in the following files: the masks in the following files::
/sys/module/af_rxrpc/parameters/debug /sys/module/af_rxrpc/parameters/debug
/sys/module/kafs/parameters/debug /sys/module/kafs/parameters/debug
===== Usage
USAGE
===== =====
When inserting the driver modules the root cell must be specified along with a When inserting the driver modules the root cell must be specified along with a
list of volume location server IP addresses: list of volume location server IP addresses::
modprobe rxrpc modprobe rxrpc
modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91 modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
...@@ -77,14 +76,14 @@ The second module is the kerberos RxRPC security driver, and the third module ...@@ -77,14 +76,14 @@ The second module is the kerberos RxRPC security driver, and the third module
is the actual filesystem driver for the AFS filesystem. is the actual filesystem driver for the AFS filesystem.
Once the module has been loaded, more modules can be added by the following Once the module has been loaded, more modules can be added by the following
procedure: procedure::
echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
Where the parameters to the "add" command are the name of a cell and a list of Where the parameters to the "add" command are the name of a cell and a list of
volume location servers within that cell, with the latter separated by colons. volume location servers within that cell, with the latter separated by colons.
Filesystems can be mounted anywhere by commands similar to the following: Filesystems can be mounted anywhere by commands similar to the following::
mount -t afs "%cambridge.redhat.com:root.afs." /afs mount -t afs "%cambridge.redhat.com:root.afs." /afs
mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge
...@@ -104,8 +103,7 @@ named volume will be looked up in the cell specified during modprobe. ...@@ -104,8 +103,7 @@ named volume will be looked up in the cell specified during modprobe.
Additional cells can be added through /proc (see later section). Additional cells can be added through /proc (see later section).
=========== Mountpoints
MOUNTPOINTS
=========== ===========
AFS has a concept of mountpoints. In AFS terms, these are specially formatted AFS has a concept of mountpoints. In AFS terms, these are specially formatted
...@@ -123,42 +121,40 @@ culled first. If all are culled, then the requested volume will also be ...@@ -123,42 +121,40 @@ culled first. If all are culled, then the requested volume will also be
unmounted, otherwise error EBUSY will be returned. unmounted, otherwise error EBUSY will be returned.
This can be used by the administrator to attempt to unmount the whole AFS tree This can be used by the administrator to attempt to unmount the whole AFS tree
mounted on /afs in one go by doing: mounted on /afs in one go by doing::
umount /afs umount /afs
============ Dynamic Root
DYNAMIC ROOT
============ ============
A mount option is available to create a serverless mount that is only usable A mount option is available to create a serverless mount that is only usable
for dynamic lookup. Creating such a mount can be done by, for example: for dynamic lookup. Creating such a mount can be done by, for example::
mount -t afs none /afs -o dyn mount -t afs none /afs -o dyn
This creates a mount that just has an empty directory at the root. Attempting This creates a mount that just has an empty directory at the root. Attempting
to look up a name in this directory will cause a mountpoint to be created that to look up a name in this directory will cause a mountpoint to be created that
looks up a cell of the same name, for example: looks up a cell of the same name, for example::
ls /afs/grand.central.org/ ls /afs/grand.central.org/
=============== Proc Filesystem
PROC FILESYSTEM
=============== ===============
The AFS modules creates a "/proc/fs/afs/" directory and populates it: The AFS modules creates a "/proc/fs/afs/" directory and populates it:
(*) A "cells" file that lists cells currently known to the afs module and (*) A "cells" file that lists cells currently known to the afs module and
their usage counts: their usage counts::
[root@andromeda ~]# cat /proc/fs/afs/cells [root@andromeda ~]# cat /proc/fs/afs/cells
USE NAME USE NAME
3 cambridge.redhat.com 3 cambridge.redhat.com
(*) A directory per cell that contains files that list volume location (*) A directory per cell that contains files that list volume location
servers, volumes, and active servers known within that cell. servers, volumes, and active servers known within that cell::
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
USE ADDR STATE USE ADDR STATE
...@@ -171,8 +167,7 @@ The AFS modules creates a "/proc/fs/afs/" directory and populates it: ...@@ -171,8 +167,7 @@ The AFS modules creates a "/proc/fs/afs/" directory and populates it:
1 Val 20000000 20000001 20000002 root.afs 1 Val 20000000 20000001 20000002 root.afs
================= The Cell Database
THE CELL DATABASE
================= =================
The filesystem maintains an internal database of all the cells it knows and the The filesystem maintains an internal database of all the cells it knows and the
...@@ -181,7 +176,7 @@ the system belongs is added to the database when modprobe is performed by the ...@@ -181,7 +176,7 @@ the system belongs is added to the database when modprobe is performed by the
"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on "rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
the kernel command line. the kernel command line.
Further cells can be added by commands similar to the following: Further cells can be added by commands similar to the following::
echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells
echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
...@@ -189,8 +184,7 @@ Further cells can be added by commands similar to the following: ...@@ -189,8 +184,7 @@ Further cells can be added by commands similar to the following:
No other cell database operations are available at this time. No other cell database operations are available at this time.
======== Security
SECURITY
======== ========
Secure operations are initiated by acquiring a key using the klog program. A Secure operations are initiated by acquiring a key using the klog program. A
...@@ -198,17 +192,17 @@ very primitive klog program is available at: ...@@ -198,17 +192,17 @@ very primitive klog program is available at:
http://people.redhat.com/~dhowells/rxrpc/klog.c http://people.redhat.com/~dhowells/rxrpc/klog.c
This should be compiled by: This should be compiled by::
make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils" make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"
And then run as: And then run as::
./klog ./klog
Assuming it's successful, this adds a key of type RxRPC, named for the service Assuming it's successful, this adds a key of type RxRPC, named for the service
and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or
by cat'ing /proc/keys: by cat'ing /proc/keys::
[root@andromeda ~]# keyctl show [root@andromeda ~]# keyctl show
Session Keyring Session Keyring
...@@ -232,20 +226,19 @@ socket), then the operations on the file will be made with key that was used to ...@@ -232,20 +226,19 @@ socket), then the operations on the file will be made with key that was used to
open the file. open the file.
===================== The @sys Substitution
THE @SYS SUBSTITUTION
===================== =====================
The list of up to 16 @sys substitutions for the current network namespace can The list of up to 16 @sys substitutions for the current network namespace can
be configured by writing a list to /proc/fs/afs/sysname: be configured by writing a list to /proc/fs/afs/sysname::
[root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname [root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname
or cleared entirely by writing an empty list: or cleared entirely by writing an empty list::
[root@andromeda ~]# echo >/proc/fs/afs/sysname [root@andromeda ~]# echo >/proc/fs/afs/sysname
The current list for current network namespace can be retrieved by: The current list for current network namespace can be retrieved by::
[root@andromeda ~]# cat /proc/fs/afs/sysname [root@andromeda ~]# cat /proc/fs/afs/sysname
foo foo
......
.. SPDX-License-Identifier: GPL-2.0
====================================================================
Miscellaneous Device control operations for the autofs kernel module Miscellaneous Device control operations for the autofs kernel module
==================================================================== ====================================================================
...@@ -36,24 +38,24 @@ For example, there are two types of automount maps, direct (in the kernel ...@@ -36,24 +38,24 @@ For example, there are two types of automount maps, direct (in the kernel
module source you will see a third type called an offset, which is just module source you will see a third type called an offset, which is just
a direct mount in disguise) and indirect. a direct mount in disguise) and indirect.
Here is a master map with direct and indirect map entries: Here is a master map with direct and indirect map entries::
/- /etc/auto.direct /- /etc/auto.direct
/test /etc/auto.indirect /test /etc/auto.indirect
and the corresponding map files: and the corresponding map files::
/etc/auto.direct: /etc/auto.direct:
/automount/dparse/g6 budgie:/autofs/export1 /automount/dparse/g6 budgie:/autofs/export1
/automount/dparse/g1 shark:/autofs/export1 /automount/dparse/g1 shark:/autofs/export1
and so on. and so on.
/etc/auto.indirect: /etc/auto.indirect::
g1 shark:/autofs/export1 g1 shark:/autofs/export1
g6 budgie:/autofs/export1 g6 budgie:/autofs/export1
and so on. and so on.
For the above indirect map an autofs file system is mounted on /test and For the above indirect map an autofs file system is mounted on /test and
mounts are triggered for each sub-directory key by the inode lookup mounts are triggered for each sub-directory key by the inode lookup
...@@ -69,23 +71,23 @@ use the follow_link inode operation to trigger the mount. ...@@ -69,23 +71,23 @@ use the follow_link inode operation to trigger the mount.
But, each entry in direct and indirect maps can have offsets (making But, each entry in direct and indirect maps can have offsets (making
them multi-mount map entries). them multi-mount map entries).
For example, an indirect mount map entry could also be: For example, an indirect mount map entry could also be::
g1 \ g1 \
/ shark:/autofs/export5/testing/test \ / shark:/autofs/export5/testing/test \
/s1 shark:/autofs/export/testing/test/s1 \ /s1 shark:/autofs/export/testing/test/s1 \
/s2 shark:/autofs/export5/testing/test/s2 \ /s2 shark:/autofs/export5/testing/test/s2 \
/s1/ss1 shark:/autofs/export1 \ /s1/ss1 shark:/autofs/export1 \
/s2/ss2 shark:/autofs/export2 /s2/ss2 shark:/autofs/export2
and a similarly a direct mount map entry could also be: and a similarly a direct mount map entry could also be::
/automount/dparse/g1 \ /automount/dparse/g1 \
/ shark:/autofs/export5/testing/test \ / shark:/autofs/export5/testing/test \
/s1 shark:/autofs/export/testing/test/s1 \ /s1 shark:/autofs/export/testing/test/s1 \
/s2 shark:/autofs/export5/testing/test/s2 \ /s2 shark:/autofs/export5/testing/test/s2 \
/s1/ss1 shark:/autofs/export2 \ /s1/ss1 shark:/autofs/export2 \
/s2/ss2 shark:/autofs/export2 /s2/ss2 shark:/autofs/export2
One of the issues with version 4 of autofs was that, when mounting an One of the issues with version 4 of autofs was that, when mounting an
entry with a large number of offsets, possibly with nesting, we needed entry with a large number of offsets, possibly with nesting, we needed
...@@ -170,32 +172,32 @@ autofs Miscellaneous Device mount control interface ...@@ -170,32 +172,32 @@ autofs Miscellaneous Device mount control interface
The control interface is opening a device node, typically /dev/autofs. The control interface is opening a device node, typically /dev/autofs.
All the ioctls use a common structure to pass the needed parameter All the ioctls use a common structure to pass the needed parameter
information and return operation results: information and return operation results::
struct autofs_dev_ioctl { struct autofs_dev_ioctl {
__u32 ver_major; __u32 ver_major;
__u32 ver_minor; __u32 ver_minor;
__u32 size; /* total size of data passed in __u32 size; /* total size of data passed in
* including this struct */ * including this struct */
__s32 ioctlfd; /* automount command fd */ __s32 ioctlfd; /* automount command fd */
/* Command parameters */ /* Command parameters */
union { union {
struct args_protover protover; struct args_protover protover;
struct args_protosubver protosubver; struct args_protosubver protosubver;
struct args_openmount openmount; struct args_openmount openmount;
struct args_ready ready; struct args_ready ready;
struct args_fail fail; struct args_fail fail;
struct args_setpipefd setpipefd; struct args_setpipefd setpipefd;
struct args_timeout timeout; struct args_timeout timeout;
struct args_requester requester; struct args_requester requester;
struct args_expire expire; struct args_expire expire;
struct args_askumount askumount; struct args_askumount askumount;
struct args_ismountpoint ismountpoint; struct args_ismountpoint ismountpoint;
}; };
char path[0]; char path[0];
}; };
The ioctlfd field is a mount point file descriptor of an autofs mount The ioctlfd field is a mount point file descriptor of an autofs mount
point. It is returned by the open call and is used by all calls except point. It is returned by the open call and is used by all calls except
...@@ -212,7 +214,7 @@ is used account for the increased structure length when translating the ...@@ -212,7 +214,7 @@ is used account for the increased structure length when translating the
structure sent from user space. structure sent from user space.
This structure can be initialized before setting specific fields by using This structure can be initialized before setting specific fields by using
the void function call init_autofs_dev_ioctl(struct autofs_dev_ioctl *). the void function call init_autofs_dev_ioctl(``struct autofs_dev_ioctl *``).
All of the ioctls perform a copy of this structure from user space to All of the ioctls perform a copy of this structure from user space to
kernel space and return -EINVAL if the size parameter is smaller than kernel space and return -EINVAL if the size parameter is smaller than
......
.. SPDX-License-Identifier: GPL-2.0
=========================
BeOS filesystem for Linux BeOS filesystem for Linux
=========================
Document last updated: Dec 6, 2001 Document last updated: Dec 6, 2001
WARNING Warning
======= =======
Make sure you understand that this is alpha software. This means that the Make sure you understand that this is alpha software. This means that the
implementation is neither complete nor well-tested. implementation is neither complete nor well-tested.
I DISCLAIM ALL RESPONSIBILITY FOR ANY POSSIBLE BAD EFFECTS OF THIS CODE! I DISCLAIM ALL RESPONSIBILITY FOR ANY POSSIBLE BAD EFFECTS OF THIS CODE!
LICENSE License
===== =======
This software is covered by the GNU General Public License. This software is covered by the GNU General Public License.
See the file COPYING for the complete text of the license. See the file COPYING for the complete text of the license.
Or the GNU website: <http://www.gnu.org/licenses/licenses.html> Or the GNU website: <http://www.gnu.org/licenses/licenses.html>
AUTHOR Author
===== ======
The largest part of the code written by Will Dyson <will_dyson@pobox.com> The largest part of the code written by Will Dyson <will_dyson@pobox.com>
He has been working on the code since Aug 13, 2001. See the changelog for He has been working on the code since Aug 13, 2001. See the changelog for
details. details.
Original Author: Makoto Kato <m_kato@ga2.so-net.ne.jp> Original Author: Makoto Kato <m_kato@ga2.so-net.ne.jp>
His original code can still be found at: His original code can still be found at:
<http://hp.vector.co.jp/authors/VA008030/bfs/> <http://hp.vector.co.jp/authors/VA008030/bfs/>
Does anyone know of a more current email address for Makoto? He doesn't Does anyone know of a more current email address for Makoto? He doesn't
respond to the address given above... respond to the address given above...
This filesystem doesn't have a maintainer. This filesystem doesn't have a maintainer.
WHAT IS THIS DRIVER? What is this Driver?
================== ====================
This module implements the native filesystem of BeOS http://www.beincorporated.com/ This module implements the native filesystem of BeOS http://www.beincorporated.com/
for the linux 2.4.1 and later kernels. Currently it is a read-only for the linux 2.4.1 and later kernels. Currently it is a read-only
implementation. implementation.
Which is it, BFS or BEFS? Which is it, BFS or BEFS?
================ =========================
Be, Inc said, "BeOS Filesystem is officially called BFS, not BeFS". Be, Inc said, "BeOS Filesystem is officially called BFS, not BeFS".
But Unixware Boot Filesystem is called bfs, too. And they are already in But Unixware Boot Filesystem is called bfs, too. And they are already in
the kernel. Because of this naming conflict, on Linux the BeOS the kernel. Because of this naming conflict, on Linux the BeOS
filesystem is called befs. filesystem is called befs.
HOW TO INSTALL How to Install
============== ==============
step 1. Install the BeFS patch into the source code tree of linux. step 1. Install the BeFS patch into the source code tree of linux.
...@@ -54,16 +60,16 @@ is called patch-befs-xxx, you would do the following: ...@@ -54,16 +60,16 @@ is called patch-befs-xxx, you would do the following:
patch -p1 < /path/to/patch-befs-xxx patch -p1 < /path/to/patch-befs-xxx
if the patching step fails (i.e. there are rejected hunks), you can try to if the patching step fails (i.e. there are rejected hunks), you can try to
figure it out yourself (it shouldn't be hard), or mail the maintainer figure it out yourself (it shouldn't be hard), or mail the maintainer
(Will Dyson <will_dyson@pobox.com>) for help. (Will Dyson <will_dyson@pobox.com>) for help.
step 2. Configuration & make kernel step 2. Configuration & make kernel
The linux kernel has many compile-time options. Most of them are beyond the The linux kernel has many compile-time options. Most of them are beyond the
scope of this document. I suggest the Kernel-HOWTO document as a good general scope of this document. I suggest the Kernel-HOWTO document as a good general
reference on this topic. http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO-4.html reference on this topic. http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO-4.html
However, to use the BeFS module, you must enable it at configure time. However, to use the BeFS module, you must enable it at configure time::
cd /foo/bar/linux cd /foo/bar/linux
make menuconfig (or xconfig) make menuconfig (or xconfig)
...@@ -82,35 +88,40 @@ step 3. Install ...@@ -82,35 +88,40 @@ step 3. Install
See the kernel howto <http://www.linux.com/howto/Kernel-HOWTO.html> for See the kernel howto <http://www.linux.com/howto/Kernel-HOWTO.html> for
instructions on this critical step. instructions on this critical step.
USING BFS Using BFS
========= =========
To use the BeOS filesystem, use filesystem type 'befs'. To use the BeOS filesystem, use filesystem type 'befs'.
ex) ex::
mount -t befs /dev/fd0 /beos mount -t befs /dev/fd0 /beos
MOUNT OPTIONS Mount Options
============= =============
============= ===========================================================
uid=nnn All files in the partition will be owned by user id nnn. uid=nnn All files in the partition will be owned by user id nnn.
gid=nnn All files in the partition will be in group nnn. gid=nnn All files in the partition will be in group nnn.
iocharset=xxx Use xxx as the name of the NLS translation table. iocharset=xxx Use xxx as the name of the NLS translation table.
debug The driver will output debugging information to the syslog. debug The driver will output debugging information to the syslog.
============= ===========================================================
HOW TO GET LASTEST VERSION How to Get Lastest Version
========================== ==========================
The latest version is currently available at: The latest version is currently available at:
<http://befs-driver.sourceforge.net/> <http://befs-driver.sourceforge.net/>
ANY KNOWN BUGS? Any Known Bugs?
=========== ===============
As of Jan 20, 2002: As of Jan 20, 2002:
None None
SPECIAL THANKS Special Thanks
============== ==============
Dominic Giampalo ... Writing "Practical file system design with Be filesystem" Dominic Giampalo ... Writing "Practical file system design with Be filesystem"
Hiroyuki Yamada ... Testing LinuxPPC. Hiroyuki Yamada ... Testing LinuxPPC.
......
BFS FILESYSTEM FOR LINUX .. SPDX-License-Identifier: GPL-2.0
========================
BFS Filesystem for Linux
======================== ========================
The BFS filesystem is used by SCO UnixWare OS for the /stand slice, which The BFS filesystem is used by SCO UnixWare OS for the /stand slice, which
...@@ -9,22 +12,22 @@ In order to access /stand partition under Linux you obviously need to ...@@ -9,22 +12,22 @@ In order to access /stand partition under Linux you obviously need to
know the partition number and the kernel must support UnixWare disk slices know the partition number and the kernel must support UnixWare disk slices
(CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not (CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not
depend on having UnixWare disklabel support because one can also mount depend on having UnixWare disklabel support because one can also mount
BFS filesystem via loopback: BFS filesystem via loopback::
# losetup /dev/loop0 stand.img # losetup /dev/loop0 stand.img
# mount -t bfs /dev/loop0 /mnt/stand # mount -t bfs /dev/loop0 /mnt/stand
where stand.img is a file containing the image of BFS filesystem. where stand.img is a file containing the image of BFS filesystem.
When you have finished using it and umounted you need to also deallocate When you have finished using it and umounted you need to also deallocate
/dev/loop0 device by: /dev/loop0 device by::
# losetup -d /dev/loop0 # losetup -d /dev/loop0
You can simplify mounting by just typing: You can simplify mounting by just typing::
# mount -t bfs -o loop stand.img /mnt/stand # mount -t bfs -o loop stand.img /mnt/stand
this will allocate the first available loopback device (and load loop.o this will allocate the first available loopback device (and load loop.o
kernel module if necessary) automatically. If the loopback driver is not kernel module if necessary) automatically. If the loopback driver is not
loaded automatically, make sure that you have compiled the module and loaded automatically, make sure that you have compiled the module and
that modprobe is functioning. Beware that umount will not deallocate that modprobe is functioning. Beware that umount will not deallocate
...@@ -33,21 +36,21 @@ that modprobe is functioning. Beware that umount will not deallocate ...@@ -33,21 +36,21 @@ that modprobe is functioning. Beware that umount will not deallocate
losetup(8). Read losetup(8) manpage for more info. losetup(8). Read losetup(8) manpage for more info.
To create the BFS image under UnixWare you need to find out first which To create the BFS image under UnixWare you need to find out first which
slice contains it. The command prtvtoc(1M) is your friend: slice contains it. The command prtvtoc(1M) is your friend::
# prtvtoc /dev/rdsk/c0b0t0d0s0 # prtvtoc /dev/rdsk/c0b0t0d0s0
(assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you (assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you
look for the slice with tag "STAND", which is usually slice 10. With this look for the slice with tag "STAND", which is usually slice 10. With this
information you can use dd(1) to create the BFS image: information you can use dd(1) to create the BFS image::
# umount /stand # umount /stand
# dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512 # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
Just in case, you can verify that you have done the right thing by checking Just in case, you can verify that you have done the right thing by checking
the magic number: the magic number::
# od -Ad -tx4 stand.img | more # od -Ad -tx4 stand.img | more
The first 4 bytes should be 0x1badface. The first 4 bytes should be 0x1badface.
......
.. SPDX-License-Identifier: GPL-2.0
=====
BTRFS BTRFS
===== =====
......
.. SPDX-License-Identifier: GPL-2.0
============================
Ceph Distributed File System Ceph Distributed File System
============================ ============================
...@@ -15,6 +18,7 @@ Basic features include: ...@@ -15,6 +18,7 @@ Basic features include:
* Easy deployment: most FS components are userspace daemons * Easy deployment: most FS components are userspace daemons
Also, Also,
* Flexible snapshots (on any directory) * Flexible snapshots (on any directory)
* Recursive accounting (nested files, directories, bytes) * Recursive accounting (nested files, directories, bytes)
...@@ -63,7 +67,7 @@ no 'du' or similar recursive scan of the file system is required. ...@@ -63,7 +67,7 @@ no 'du' or similar recursive scan of the file system is required.
Finally, Ceph also allows quotas to be set on any directory in the system. Finally, Ceph also allows quotas to be set on any directory in the system.
The quota can restrict the number of bytes or the number of files stored The quota can restrict the number of bytes or the number of files stored
beneath that point in the directory hierarchy. Quotas can be set using beneath that point in the directory hierarchy. Quotas can be set using
extended attributes 'ceph.quota.max_files' and 'ceph.quota.max_bytes', eg: extended attributes 'ceph.quota.max_files' and 'ceph.quota.max_bytes', eg::
setfattr -n ceph.quota.max_bytes -v 100000000 /some/dir setfattr -n ceph.quota.max_bytes -v 100000000 /some/dir
getfattr -n ceph.quota.max_bytes /some/dir getfattr -n ceph.quota.max_bytes /some/dir
...@@ -76,7 +80,7 @@ from writing as much data as it needs. ...@@ -76,7 +80,7 @@ from writing as much data as it needs.
Mount Syntax Mount Syntax
============ ============
The basic mount syntax is: The basic mount syntax is::
# mount -t ceph monip[:port][,monip2[:port]...]:/[subdir] mnt # mount -t ceph monip[:port][,monip2[:port]...]:/[subdir] mnt
...@@ -84,7 +88,7 @@ You only need to specify a single monitor, as the client will get the ...@@ -84,7 +88,7 @@ You only need to specify a single monitor, as the client will get the
full list when it connects. (However, if the monitor you specify full list when it connects. (However, if the monitor you specify
happens to be down, the mount won't succeed.) The port can be left happens to be down, the mount won't succeed.) The port can be left
off if the monitor is using the default. So if the monitor is at off if the monitor is using the default. So if the monitor is at
1.2.3.4, 1.2.3.4::
# mount -t ceph 1.2.3.4:/ /mnt/ceph # mount -t ceph 1.2.3.4:/ /mnt/ceph
...@@ -163,14 +167,14 @@ Mount Options ...@@ -163,14 +167,14 @@ Mount Options
available modes are "no" and "clean". The default is "no". available modes are "no" and "clean". The default is "no".
* no: never attempt to reconnect when client detects that it has been * no: never attempt to reconnect when client detects that it has been
blacklisted. Operations will generally fail after being blacklisted. blacklisted. Operations will generally fail after being blacklisted.
* clean: client reconnects to the ceph cluster automatically when it * clean: client reconnects to the ceph cluster automatically when it
detects that it has been blacklisted. During reconnect, client drops detects that it has been blacklisted. During reconnect, client drops
dirty data/metadata, invalidates page caches and writable file handles. dirty data/metadata, invalidates page caches and writable file handles.
After reconnect, file locks become stale because the MDS loses track After reconnect, file locks become stale because the MDS loses track
of them. If an inode contains any stale file locks, read/write on the of them. If an inode contains any stale file locks, read/write on the
inode is not allowed until applications release all stale file locks. inode is not allowed until applications release all stale file locks.
More Information More Information
================ ================
...@@ -179,8 +183,8 @@ For more information on Ceph, see the home page at ...@@ -179,8 +183,8 @@ For more information on Ceph, see the home page at
https://ceph.com/ https://ceph.com/
The Linux kernel client source tree is available at The Linux kernel client source tree is available at
https://github.com/ceph/ceph-client.git - https://github.com/ceph/ceph-client.git
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git - git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
and the source for the full system is at and the source for the full system is at
https://github.com/ceph/ceph.git https://github.com/ceph/ceph.git
.. SPDX-License-Identifier: GPL-2.0
Cramfs - cram a filesystem onto a small ROM ===========================================
Cramfs - cram a filesystem onto a small ROM
===========================================
cramfs is designed to be simple and small, and to compress things well. cramfs is designed to be simple and small, and to compress things well.
It uses the zlib routines to compress a file one page at a time, and It uses the zlib routines to compress a file one page at a time, and
allows random page access. The meta-data is not compressed, but is allows random page access. The meta-data is not compressed, but is
expressed in a very terse representation to make it use much less expressed in a very terse representation to make it use much less
diskspace than traditional filesystems. diskspace than traditional filesystems.
You can't write to a cramfs filesystem (making it compressible and You can't write to a cramfs filesystem (making it compressible and
compact also makes it _very_ hard to update on-the-fly), so you have to compact also makes it _very_ hard to update on-the-fly), so you have to
...@@ -28,9 +31,9 @@ issue. ...@@ -28,9 +31,9 @@ issue.
Hard links are supported, but hard linked files Hard links are supported, but hard linked files
will still have a link count of 1 in the cramfs image. will still have a link count of 1 in the cramfs image.
Cramfs directories have no `.' or `..' entries. Directories (like Cramfs directories have no ``.`` or ``..`` entries. Directories (like
every other file on cramfs) always have a link count of 1. (There's every other file on cramfs) always have a link count of 1. (There's
no need to use -noleaf in `find', btw.) no need to use -noleaf in ``find``, btw.)
No timestamps are stored in a cramfs, so these default to the epoch No timestamps are stored in a cramfs, so these default to the epoch
(1970 GMT). Recently-accessed files may have updated timestamps, but (1970 GMT). Recently-accessed files may have updated timestamps, but
...@@ -70,9 +73,9 @@ MTD drivers are cfi_cmdset_0001 (Intel/Sharp CFI flash) or physmap ...@@ -70,9 +73,9 @@ MTD drivers are cfi_cmdset_0001 (Intel/Sharp CFI flash) or physmap
(Flash device in physical memory map). MTD partitions based on such devices (Flash device in physical memory map). MTD partitions based on such devices
are fine too. Then that device should be specified with the "mtd:" prefix are fine too. Then that device should be specified with the "mtd:" prefix
as the mount device argument. For example, to mount the MTD device named as the mount device argument. For example, to mount the MTD device named
"fs_partition" on the /mnt directory: "fs_partition" on the /mnt directory::
$ mount -t cramfs mtd:fs_partition /mnt $ mount -t cramfs mtd:fs_partition /mnt
To boot a kernel with this as root filesystem, suffice to specify To boot a kernel with this as root filesystem, suffice to specify
something like "root=mtd:fs_partition" on the kernel command line. something like "root=mtd:fs_partition" on the kernel command line.
...@@ -90,6 +93,7 @@ https://github.com/npitre/cramfs-tools ...@@ -90,6 +93,7 @@ https://github.com/npitre/cramfs-tools
For /usr/share/magic For /usr/share/magic
-------------------- --------------------
===== ======================= =======================
0 ulelong 0x28cd3d45 Linux cramfs offset 0 0 ulelong 0x28cd3d45 Linux cramfs offset 0
>4 ulelong x size %d >4 ulelong x size %d
>8 ulelong x flags 0x%x >8 ulelong x flags 0x%x
...@@ -110,6 +114,7 @@ For /usr/share/magic ...@@ -110,6 +114,7 @@ For /usr/share/magic
>552 ulelong x fsid.blocks %d >552 ulelong x fsid.blocks %d
>556 ulelong x fsid.files %d >556 ulelong x fsid.files %d
>560 string >\0 name "%.16s" >560 string >\0 name "%.16s"
===== ======================= =======================
Hacker Notes Hacker Notes
......
Copyright 2009 Jonathan Corbet <corbet@lwn.net> .. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=======
DebugFS
=======
Copyright |copy| 2009 Jonathan Corbet <corbet@lwn.net>
Debugfs exists as a simple way for kernel developers to make information Debugfs exists as a simple way for kernel developers to make information
available to user space. Unlike /proc, which is only meant for information available to user space. Unlike /proc, which is only meant for information
...@@ -6,11 +13,11 @@ about a process, or sysfs, which has strict one-value-per-file rules, ...@@ -6,11 +13,11 @@ about a process, or sysfs, which has strict one-value-per-file rules,
debugfs has no rules at all. Developers can put any information they want debugfs has no rules at all. Developers can put any information they want
there. The debugfs filesystem is also intended to not serve as a stable there. The debugfs filesystem is also intended to not serve as a stable
ABI to user space; in theory, there are no stability constraints placed on ABI to user space; in theory, there are no stability constraints placed on
files exported there. The real world is not always so simple, though [1]; files exported there. The real world is not always so simple, though [1]_;
even debugfs interfaces are best designed with the idea that they will need even debugfs interfaces are best designed with the idea that they will need
to be maintained forever. to be maintained forever.
Debugfs is typically mounted with a command like: Debugfs is typically mounted with a command like::
mount -t debugfs none /sys/kernel/debug mount -t debugfs none /sys/kernel/debug
...@@ -23,7 +30,7 @@ Note that the debugfs API is exported GPL-only to modules. ...@@ -23,7 +30,7 @@ Note that the debugfs API is exported GPL-only to modules.
Code using debugfs should include <linux/debugfs.h>. Then, the first order Code using debugfs should include <linux/debugfs.h>. Then, the first order
of business will be to create at least one directory to hold a set of of business will be to create at least one directory to hold a set of
debugfs files: debugfs files::
struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
...@@ -36,7 +43,7 @@ something went wrong. If ERR_PTR(-ENODEV) is returned, that is an ...@@ -36,7 +43,7 @@ something went wrong. If ERR_PTR(-ENODEV) is returned, that is an
indication that the kernel has been built without debugfs support and none indication that the kernel has been built without debugfs support and none
of the functions described below will work. of the functions described below will work.
The most general way to create a file within a debugfs directory is with: The most general way to create a file within a debugfs directory is with::
struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *debugfs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data, struct dentry *parent, void *data,
...@@ -53,7 +60,7 @@ ERR_PTR(-ERROR) on error, or ERR_PTR(-ENODEV) if debugfs support is ...@@ -53,7 +60,7 @@ ERR_PTR(-ERROR) on error, or ERR_PTR(-ENODEV) if debugfs support is
missing. missing.
Create a file with an initial size, the following function can be used Create a file with an initial size, the following function can be used
instead: instead::
struct dentry *debugfs_create_file_size(const char *name, umode_t mode, struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
struct dentry *parent, void *data, struct dentry *parent, void *data,
...@@ -66,7 +73,7 @@ as the function debugfs_create_file. ...@@ -66,7 +73,7 @@ as the function debugfs_create_file.
In a number of cases, the creation of a set of file operations is not In a number of cases, the creation of a set of file operations is not
actually necessary; the debugfs code provides a number of helper functions actually necessary; the debugfs code provides a number of helper functions
for simple situations. Files containing a single integer value can be for simple situations. Files containing a single integer value can be
created with any of: created with any of::
void debugfs_create_u8(const char *name, umode_t mode, void debugfs_create_u8(const char *name, umode_t mode,
struct dentry *parent, u8 *value); struct dentry *parent, u8 *value);
...@@ -80,7 +87,7 @@ created with any of: ...@@ -80,7 +87,7 @@ created with any of:
These files support both reading and writing the given value; if a specific These files support both reading and writing the given value; if a specific
file should not be written to, simply set the mode bits accordingly. The file should not be written to, simply set the mode bits accordingly. The
values in these files are in decimal; if hexadecimal is more appropriate, values in these files are in decimal; if hexadecimal is more appropriate,
the following functions can be used instead: the following functions can be used instead::
void debugfs_create_x8(const char *name, umode_t mode, void debugfs_create_x8(const char *name, umode_t mode,
struct dentry *parent, u8 *value); struct dentry *parent, u8 *value);
...@@ -94,7 +101,7 @@ the following functions can be used instead: ...@@ -94,7 +101,7 @@ the following functions can be used instead:
These functions are useful as long as the developer knows the size of the These functions are useful as long as the developer knows the size of the
value to be exported. Some types can have different widths on different value to be exported. Some types can have different widths on different
architectures, though, complicating the situation somewhat. There are architectures, though, complicating the situation somewhat. There are
functions meant to help out in such special cases: functions meant to help out in such special cases::
void debugfs_create_size_t(const char *name, umode_t mode, void debugfs_create_size_t(const char *name, umode_t mode,
struct dentry *parent, size_t *value); struct dentry *parent, size_t *value);
...@@ -103,7 +110,7 @@ As might be expected, this function will create a debugfs file to represent ...@@ -103,7 +110,7 @@ As might be expected, this function will create a debugfs file to represent
a variable of type size_t. a variable of type size_t.
Similarly, there are helpers for variables of type unsigned long, in decimal Similarly, there are helpers for variables of type unsigned long, in decimal
and hexadecimal: and hexadecimal::
struct dentry *debugfs_create_ulong(const char *name, umode_t mode, struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
struct dentry *parent, struct dentry *parent,
...@@ -111,7 +118,7 @@ and hexadecimal: ...@@ -111,7 +118,7 @@ and hexadecimal:
void debugfs_create_xul(const char *name, umode_t mode, void debugfs_create_xul(const char *name, umode_t mode,
struct dentry *parent, unsigned long *value); struct dentry *parent, unsigned long *value);
Boolean values can be placed in debugfs with: Boolean values can be placed in debugfs with::
struct dentry *debugfs_create_bool(const char *name, umode_t mode, struct dentry *debugfs_create_bool(const char *name, umode_t mode,
struct dentry *parent, bool *value); struct dentry *parent, bool *value);
...@@ -120,7 +127,7 @@ A read on the resulting file will yield either Y (for non-zero values) or ...@@ -120,7 +127,7 @@ A read on the resulting file will yield either Y (for non-zero values) or
N, followed by a newline. If written to, it will accept either upper- or N, followed by a newline. If written to, it will accept either upper- or
lower-case values, or 1 or 0. Any other input will be silently ignored. lower-case values, or 1 or 0. Any other input will be silently ignored.
Also, atomic_t values can be placed in debugfs with: Also, atomic_t values can be placed in debugfs with::
void debugfs_create_atomic_t(const char *name, umode_t mode, void debugfs_create_atomic_t(const char *name, umode_t mode,
struct dentry *parent, atomic_t *value) struct dentry *parent, atomic_t *value)
...@@ -129,7 +136,7 @@ A read of this file will get atomic_t values, and a write of this file ...@@ -129,7 +136,7 @@ A read of this file will get atomic_t values, and a write of this file
will set atomic_t values. will set atomic_t values.
Another option is exporting a block of arbitrary binary data, with Another option is exporting a block of arbitrary binary data, with
this structure and function: this structure and function::
struct debugfs_blob_wrapper { struct debugfs_blob_wrapper {
void *data; void *data;
...@@ -151,7 +158,7 @@ If you want to dump a block of registers (something that happens quite ...@@ -151,7 +158,7 @@ If you want to dump a block of registers (something that happens quite
often during development, even if little such code reaches mainline. often during development, even if little such code reaches mainline.
Debugfs offers two functions: one to make a registers-only file, and Debugfs offers two functions: one to make a registers-only file, and
another to insert a register block in the middle of another sequential another to insert a register block in the middle of another sequential
file. file::
struct debugfs_reg32 { struct debugfs_reg32 {
char *name; char *name;
...@@ -175,7 +182,7 @@ The "base" argument may be 0, but you may want to build the reg32 array ...@@ -175,7 +182,7 @@ The "base" argument may be 0, but you may want to build the reg32 array
using __stringify, and a number of register names (macros) are actually using __stringify, and a number of register names (macros) are actually
byte offsets over a base for the register block. byte offsets over a base for the register block.
If you want to dump an u32 array in debugfs, you can create file with: If you want to dump an u32 array in debugfs, you can create file with::
void debugfs_create_u32_array(const char *name, umode_t mode, void debugfs_create_u32_array(const char *name, umode_t mode,
struct dentry *parent, struct dentry *parent,
...@@ -185,7 +192,7 @@ The "array" argument provides data, and the "elements" argument is ...@@ -185,7 +192,7 @@ The "array" argument provides data, and the "elements" argument is
the number of elements in the array. Note: Once array is created its the number of elements in the array. Note: Once array is created its
size can not be changed. size can not be changed.
There is a helper function to create device related seq_file: There is a helper function to create device related seq_file::
struct dentry *debugfs_create_devm_seqfile(struct device *dev, struct dentry *debugfs_create_devm_seqfile(struct device *dev,
const char *name, const char *name,
...@@ -197,14 +204,14 @@ The "dev" argument is the device related to this debugfs file, and ...@@ -197,14 +204,14 @@ The "dev" argument is the device related to this debugfs file, and
the "read_fn" is a function pointer which to be called to print the the "read_fn" is a function pointer which to be called to print the
seq_file content. seq_file content.
There are a couple of other directory-oriented helper functions: There are a couple of other directory-oriented helper functions::
struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *debugfs_rename(struct dentry *old_dir,
struct dentry *old_dentry, struct dentry *old_dentry,
struct dentry *new_dir, struct dentry *new_dir,
const char *new_name); const char *new_name);
struct dentry *debugfs_create_symlink(const char *name, struct dentry *debugfs_create_symlink(const char *name,
struct dentry *parent, struct dentry *parent,
const char *target); const char *target);
...@@ -219,7 +226,7 @@ module is unloaded without explicitly removing debugfs entries, the result ...@@ -219,7 +226,7 @@ module is unloaded without explicitly removing debugfs entries, the result
will be a lot of stale pointers and no end of highly antisocial behavior. will be a lot of stale pointers and no end of highly antisocial behavior.
So all debugfs users - at least those which can be built as modules - must So all debugfs users - at least those which can be built as modules - must
be prepared to remove all files and directories they create there. A file be prepared to remove all files and directories they create there. A file
can be removed with: can be removed with::
void debugfs_remove(struct dentry *dentry); void debugfs_remove(struct dentry *dentry);
...@@ -229,7 +236,7 @@ be removed. ...@@ -229,7 +236,7 @@ be removed.
Once upon a time, debugfs users were required to remember the dentry Once upon a time, debugfs users were required to remember the dentry
pointer for every debugfs file they created so that all files could be pointer for every debugfs file they created so that all files could be
cleaned up. We live in more civilized times now, though, and debugfs users cleaned up. We live in more civilized times now, though, and debugfs users
can call: can call::
void debugfs_remove_recursive(struct dentry *dentry); void debugfs_remove_recursive(struct dentry *dentry);
...@@ -237,5 +244,4 @@ If this function is passed a pointer for the dentry corresponding to the ...@@ -237,5 +244,4 @@ If this function is passed a pointer for the dentry corresponding to the
top-level directory, the entire hierarchy below that directory will be top-level directory, the entire hierarchy below that directory will be
removed. removed.
Notes: .. [1] http://lwn.net/Articles/309298/
[1] http://lwn.net/Articles/309298/
dlmfs .. SPDX-License-Identifier: GPL-2.0
================== .. include:: <isonum.txt>
=====
DLMFS
=====
A minimal DLM userspace interface implemented via a virtual file A minimal DLM userspace interface implemented via a virtual file
system. system.
dlmfs is built with OCFS2 as it requires most of its infrastructure. dlmfs is built with OCFS2 as it requires most of its infrastructure.
Project web page: http://ocfs2.wiki.kernel.org :Project web page: http://ocfs2.wiki.kernel.org
Tools web page: https://github.com/markfasheh/ocfs2-tools :Tools web page: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/ :OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
All code copyright 2005 Oracle except when otherwise noted. All code copyright 2005 Oracle except when otherwise noted.
CREDITS Credits
======= =======
Some code taken from ramfs which is Copyright (C) 2000 Linus Torvalds Some code taken from ramfs which is Copyright |copy| 2000 Linus Torvalds
and Transmeta Corp. and Transmeta Corp.
Mark Fasheh <mark.fasheh@oracle.com> Mark Fasheh <mark.fasheh@oracle.com>
...@@ -96,14 +101,19 @@ operation. If the lock succeeds, you'll get an fd. ...@@ -96,14 +101,19 @@ operation. If the lock succeeds, you'll get an fd.
open(2) with O_CREAT to ensure the resource inode is created - dlmfs does open(2) with O_CREAT to ensure the resource inode is created - dlmfs does
not automatically create inodes for existing lock resources. not automatically create inodes for existing lock resources.
============ ===========================
Open Flag Lock Request Type Open Flag Lock Request Type
--------- ----------------- ============ ===========================
O_RDONLY Shared Read O_RDONLY Shared Read
O_RDWR Exclusive O_RDWR Exclusive
============ ===========================
============ ===========================
Open Flag Resulting Locking Behavior Open Flag Resulting Locking Behavior
--------- -------------------------- ============ ===========================
O_NONBLOCK Trylock operation O_NONBLOCK Trylock operation
============ ===========================
You must provide exactly one of O_RDONLY or O_RDWR. You must provide exactly one of O_RDONLY or O_RDWR.
......
.. SPDX-License-Identifier: GPL-2.0
======================================================
eCryptfs: A stacked cryptographic filesystem for Linux eCryptfs: A stacked cryptographic filesystem for Linux
======================================================
eCryptfs is free software. Please see the file COPYING for details. eCryptfs is free software. Please see the file COPYING for details.
For documentation, please see the files in the doc/ subdirectory. For For documentation, please see the files in the doc/ subdirectory. For
building and installation instructions please see the INSTALL file. building and installation instructions please see the INSTALL file.
Maintainer: Phillip Hellewell :Maintainer: Phillip Hellewell
Lead developer: Michael A. Halcrow <mhalcrow@us.ibm.com> :Lead developer: Michael A. Halcrow <mhalcrow@us.ibm.com>
Developers: Michael C. Thompson :Developers: Michael C. Thompson
Kent Yoder Kent Yoder
Web Site: http://ecryptfs.sf.net :Web Site: http://ecryptfs.sf.net
This software is currently undergoing development. Make sure to This software is currently undergoing development. Make sure to
maintain a backup copy of any data you write into eCryptfs. maintain a backup copy of any data you write into eCryptfs.
...@@ -19,13 +23,15 @@ SourceForge site: ...@@ -19,13 +23,15 @@ SourceForge site:
http://sourceforge.net/projects/ecryptfs/ http://sourceforge.net/projects/ecryptfs/
Userspace requirements include: Userspace requirements include:
- David Howells' userspace keyring headers and libraries (version
1.0 or higher), obtainable from - David Howells' userspace keyring headers and libraries (version
http://people.redhat.com/~dhowells/keyutils/ 1.0 or higher), obtainable from
- Libgcrypt http://people.redhat.com/~dhowells/keyutils/
- Libgcrypt
NOTES Notes
=====
In the beta/experimental releases of eCryptfs, when you upgrade In the beta/experimental releases of eCryptfs, when you upgrade
eCryptfs, you should copy the files to an unencrypted location and eCryptfs, you should copy the files to an unencrypted location and
...@@ -33,20 +39,21 @@ then copy the files back into the new eCryptfs mount to migrate the ...@@ -33,20 +39,21 @@ then copy the files back into the new eCryptfs mount to migrate the
files. files.
MOUNT-WIDE PASSPHRASE Mount-wide Passphrase
=====================
Create a new directory into which eCryptfs will write its encrypted Create a new directory into which eCryptfs will write its encrypted
files (i.e., /root/crypt). Then, create the mount point directory files (i.e., /root/crypt). Then, create the mount point directory
(i.e., /mnt/crypt). Now it's time to mount eCryptfs: (i.e., /mnt/crypt). Now it's time to mount eCryptfs::
mount -t ecryptfs /root/crypt /mnt/crypt mount -t ecryptfs /root/crypt /mnt/crypt
You should be prompted for a passphrase and a salt (the salt may be You should be prompted for a passphrase and a salt (the salt may be
blank). blank).
Try writing a new file: Try writing a new file::
echo "Hello, World" > /mnt/crypt/hello.txt echo "Hello, World" > /mnt/crypt/hello.txt
The operation will complete. Notice that there is a new file in The operation will complete. Notice that there is a new file in
/root/crypt that is at least 12288 bytes in size (depending on your /root/crypt that is at least 12288 bytes in size (depending on your
...@@ -59,10 +66,13 @@ keyctl clear @u ...@@ -59,10 +66,13 @@ keyctl clear @u
Then umount /mnt/crypt and mount again per the instructions given Then umount /mnt/crypt and mount again per the instructions given
above. above.
cat /mnt/crypt/hello.txt ::
cat /mnt/crypt/hello.txt
NOTES Notes
=====
eCryptfs version 0.1 should only be mounted on (1) empty directories eCryptfs version 0.1 should only be mounted on (1) empty directories
or (2) directories containing files only created by eCryptfs. If you or (2) directories containing files only created by eCryptfs. If you
......
.. SPDX-License-Identifier: GPL-2.0
=======================================
efivarfs - a (U)EFI variable filesystem efivarfs - a (U)EFI variable filesystem
=======================================
The efivarfs filesystem was created to address the shortcomings of The efivarfs filesystem was created to address the shortcomings of
using entries in sysfs to maintain EFI variables. The old sysfs EFI using entries in sysfs to maintain EFI variables. The old sysfs EFI
...@@ -11,7 +14,7 @@ than a single page, sysfs isn't the best interface for this. ...@@ -11,7 +14,7 @@ than a single page, sysfs isn't the best interface for this.
Variables can be created, deleted and modified with the efivarfs Variables can be created, deleted and modified with the efivarfs
filesystem. filesystem.
efivarfs is typically mounted like this, efivarfs is typically mounted like this::
mount -t efivarfs none /sys/firmware/efi/efivars mount -t efivarfs none /sys/firmware/efi/efivars
......
.. SPDX-License-Identifier: GPL-2.0
The Second Extended Filesystem The Second Extended Filesystem
============================== ==============================
...@@ -14,8 +16,9 @@ Options ...@@ -14,8 +16,9 @@ Options
Most defaults are determined by the filesystem superblock, and can be Most defaults are determined by the filesystem superblock, and can be
set using tune2fs(8). Kernel-determined defaults are indicated by (*). set using tune2fs(8). Kernel-determined defaults are indicated by (*).
bsddf (*) Makes `df' act like BSD. ==================== === ================================================
minixdf Makes `df' act like Minix. bsddf (*) Makes ``df`` act like BSD.
minixdf Makes ``df`` act like Minix.
check=none, nocheck (*) Don't do extra checking of bitmaps on mount check=none, nocheck (*) Don't do extra checking of bitmaps on mount
(check=normal and check=strict options removed) (check=normal and check=strict options removed)
...@@ -62,6 +65,7 @@ quota, usrquota Enable user disk quota support ...@@ -62,6 +65,7 @@ quota, usrquota Enable user disk quota support
grpquota Enable group disk quota support grpquota Enable group disk quota support
(requires CONFIG_QUOTA). (requires CONFIG_QUOTA).
==================== === ================================================
noquota option ls silently ignored by ext2. noquota option ls silently ignored by ext2.
...@@ -294,9 +298,9 @@ respective fsck programs. ...@@ -294,9 +298,9 @@ respective fsck programs.
If you're exceptionally paranoid, there are 3 ways of making metadata If you're exceptionally paranoid, there are 3 ways of making metadata
writes synchronous on ext2: writes synchronous on ext2:
per-file if you have the program source: use the O_SYNC flag to open() - per-file if you have the program source: use the O_SYNC flag to open()
per-file if you don't have the source: use "chattr +S" on the file - per-file if you don't have the source: use "chattr +S" on the file
per-filesystem: add the "sync" option to mount (or in /etc/fstab) - per-filesystem: add the "sync" option to mount (or in /etc/fstab)
the first and last are not ext2 specific but do force the metadata to the first and last are not ext2 specific but do force the metadata to
be written synchronously. See also Journaling below. be written synchronously. See also Journaling below.
...@@ -316,10 +320,12 @@ Most of these limits could be overcome with slight changes in the on-disk ...@@ -316,10 +320,12 @@ Most of these limits could be overcome with slight changes in the on-disk
format and using a compatibility flag to signal the format change (at format and using a compatibility flag to signal the format change (at
the expense of some compatibility). the expense of some compatibility).
Filesystem block size: 1kB 2kB 4kB 8kB ===================== ======= ======= ======= ========
Filesystem block size 1kB 2kB 4kB 8kB
File size limit: 16GB 256GB 2048GB 2048GB ===================== ======= ======= ======= ========
Filesystem size limit: 2047GB 8192GB 16384GB 32768GB File size limit 16GB 256GB 2048GB 2048GB
Filesystem size limit 2047GB 8192GB 16384GB 32768GB
===================== ======= ======= ======= ========
There is a 2.4 kernel limit of 2048GB for a single block device, so no There is a 2.4 kernel limit of 2048GB for a single block device, so no
filesystem larger than that can be created at this time. There is also filesystem larger than that can be created at this time. There is also
...@@ -370,19 +376,24 @@ ext4 and journaling. ...@@ -370,19 +376,24 @@ ext4 and journaling.
References References
========== ==========
======================= ===============================================
The kernel source file:/usr/src/linux/fs/ext2/ The kernel source file:/usr/src/linux/fs/ext2/
e2fsprogs (e2fsck) http://e2fsprogs.sourceforge.net/ e2fsprogs (e2fsck) http://e2fsprogs.sourceforge.net/
Design & Implementation http://e2fsprogs.sourceforge.net/ext2intro.html Design & Implementation http://e2fsprogs.sourceforge.net/ext2intro.html
Journaling (ext3) ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/ Journaling (ext3) ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/
Filesystem Resizing http://ext2resize.sourceforge.net/ Filesystem Resizing http://ext2resize.sourceforge.net/
Compression (*) http://e2compr.sourceforge.net/ Compression [1]_ http://e2compr.sourceforge.net/
======================= ===============================================
Implementations for: Implementations for:
======================= ===========================================================
Windows 95/98/NT/2000 http://www.chrysocome.net/explore2fs Windows 95/98/NT/2000 http://www.chrysocome.net/explore2fs
Windows 95 (*) http://www.yipton.net/content.html#FSDEXT2 Windows 95 [1]_ http://www.yipton.net/content.html#FSDEXT2
DOS client (*) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ DOS client [1]_ ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/
OS/2 (+) ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/ OS/2 [2]_ ftp://metalab.unc.edu/pub/Linux/system/filesystems/ext2/
RISC OS client http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/ RISC OS client http://www.esw-heim.tu-clausthal.de/~marco/smorbrod/IscaFS/
======================= ===========================================================
(*) no longer actively developed/supported (as of Apr 2001) .. [1] no longer actively developed/supported (as of Apr 2001)
(+) no longer actively developed/supported (as of Mar 2009) .. [2] no longer actively developed/supported (as of Mar 2009)
.. SPDX-License-Identifier: GPL-2.0
===============
Ext3 Filesystem Ext3 Filesystem
=============== ===============
......
uevents and GFS2 .. SPDX-License-Identifier: GPL-2.0
==================
================
uevents and GFS2
================
During the lifetime of a GFS2 mount, a number of uevents are generated. During the lifetime of a GFS2 mount, a number of uevents are generated.
This document explains what the events are and what they are used This document explains what the events are and what they are used
for (by gfs_controld in gfs2-utils). for (by gfs_controld in gfs2-utils).
A list of GFS2 uevents A list of GFS2 uevents
----------------------- ======================
1. ADD 1. ADD
------
The ADD event occurs at mount time. It will always be the first The ADD event occurs at mount time. It will always be the first
uevent generated by the newly created filesystem. If the mount uevent generated by the newly created filesystem. If the mount
...@@ -21,6 +25,7 @@ with no journal assigned), and read-only (with journal assigned) status ...@@ -21,6 +25,7 @@ with no journal assigned), and read-only (with journal assigned) status
of the filesystem respectively. of the filesystem respectively.
2. ONLINE 2. ONLINE
---------
The ONLINE uevent is generated after a successful mount or remount. It The ONLINE uevent is generated after a successful mount or remount. It
has the same environment variables as the ADD uevent. The ONLINE has the same environment variables as the ADD uevent. The ONLINE
...@@ -29,6 +34,7 @@ RDONLY are a relatively recent addition (2.6.32-rc+) and will not ...@@ -29,6 +34,7 @@ RDONLY are a relatively recent addition (2.6.32-rc+) and will not
be generated by older kernels. be generated by older kernels.
3. CHANGE 3. CHANGE
---------
The CHANGE uevent is used in two places. One is when reporting the The CHANGE uevent is used in two places. One is when reporting the
successful mount of the filesystem by the first node (FIRSTMOUNT=Done). successful mount of the filesystem by the first node (FIRSTMOUNT=Done).
...@@ -52,6 +58,7 @@ cluster. For this reason the ONLINE uevent was used when adding a new ...@@ -52,6 +58,7 @@ cluster. For this reason the ONLINE uevent was used when adding a new
uevent for a successful mount or remount. uevent for a successful mount or remount.
4. OFFLINE 4. OFFLINE
----------
The OFFLINE uevent is only generated due to filesystem errors and is used The OFFLINE uevent is only generated due to filesystem errors and is used
as part of the "withdraw" mechanism. Currently this doesn't give any as part of the "withdraw" mechanism. Currently this doesn't give any
...@@ -59,6 +66,7 @@ information about what the error is, which is something that needs to ...@@ -59,6 +66,7 @@ information about what the error is, which is something that needs to
be fixed. be fixed.
5. REMOVE 5. REMOVE
---------
The REMOVE uevent is generated at the end of an unsuccessful mount The REMOVE uevent is generated at the end of an unsuccessful mount
or at the end of a umount of the filesystem. All REMOVE uevents will or at the end of a umount of the filesystem. All REMOVE uevents will
...@@ -68,9 +76,10 @@ kobject subsystem. ...@@ -68,9 +76,10 @@ kobject subsystem.
Information common to all GFS2 uevents (uevent environment variables) Information common to all GFS2 uevents (uevent environment variables)
---------------------------------------------------------------------- =====================================================================
1. LOCKTABLE= 1. LOCKTABLE=
--------------
The LOCKTABLE is a string, as supplied on the mount command The LOCKTABLE is a string, as supplied on the mount command
line (locktable=) or via fstab. It is used as a filesystem label line (locktable=) or via fstab. It is used as a filesystem label
...@@ -78,6 +87,7 @@ as well as providing the information for a lock_dlm mount to be ...@@ -78,6 +87,7 @@ as well as providing the information for a lock_dlm mount to be
able to join the cluster. able to join the cluster.
2. LOCKPROTO= 2. LOCKPROTO=
-------------
The LOCKPROTO is a string, and its value depends on what is set The LOCKPROTO is a string, and its value depends on what is set
on the mount command line, or via fstab. It will be either on the mount command line, or via fstab. It will be either
...@@ -85,12 +95,14 @@ lock_nolock or lock_dlm. In the future other lock managers ...@@ -85,12 +95,14 @@ lock_nolock or lock_dlm. In the future other lock managers
may be supported. may be supported.
3. JOURNALID= 3. JOURNALID=
-------------
If a journal is in use by the filesystem (journals are not If a journal is in use by the filesystem (journals are not
assigned for spectator mounts) then this will give the assigned for spectator mounts) then this will give the
numeric journal id in all GFS2 uevents. numeric journal id in all GFS2 uevents.
4. UUID= 4. UUID=
--------
With recent versions of gfs2-utils, mkfs.gfs2 writes a UUID With recent versions of gfs2-utils, mkfs.gfs2 writes a UUID
into the filesystem superblock. If it exists, this will into the filesystem superblock. If it exists, this will
......
.. SPDX-License-Identifier: GPL-2.0
==================
Global File System Global File System
------------------ ==================
https://fedorahosted.org/cluster/wiki/HomePage https://fedorahosted.org/cluster/wiki/HomePage
...@@ -14,16 +17,18 @@ on one machine show up immediately on all other machines in the cluster. ...@@ -14,16 +17,18 @@ on one machine show up immediately on all other machines in the cluster.
GFS uses interchangeable inter-node locking mechanisms, the currently GFS uses interchangeable inter-node locking mechanisms, the currently
supported mechanisms are: supported mechanisms are:
lock_nolock -- allows gfs to be used as a local file system lock_nolock
- allows gfs to be used as a local file system
lock_dlm -- uses a distributed lock manager (dlm) for inter-node locking lock_dlm
The dlm is found at linux/fs/dlm/ - uses a distributed lock manager (dlm) for inter-node locking.
The dlm is found at linux/fs/dlm/
Lock_dlm depends on user space cluster management systems found Lock_dlm depends on user space cluster management systems found
at the URL above. at the URL above.
To use gfs as a local file system, no external clustering systems are To use gfs as a local file system, no external clustering systems are
needed, simply: needed, simply::
$ mkfs -t gfs2 -p lock_nolock -j 1 /dev/block_device $ mkfs -t gfs2 -p lock_nolock -j 1 /dev/block_device
$ mount -t gfs2 /dev/block_device /dir $ mount -t gfs2 /dev/block_device /dir
...@@ -37,9 +42,12 @@ GFS2 is not on-disk compatible with previous versions of GFS, but it ...@@ -37,9 +42,12 @@ GFS2 is not on-disk compatible with previous versions of GFS, but it
is pretty close. is pretty close.
The following man pages can be found at the URL above: The following man pages can be found at the URL above:
============ =============================================
fsck.gfs2 to repair a filesystem fsck.gfs2 to repair a filesystem
gfs2_grow to expand a filesystem online gfs2_grow to expand a filesystem online
gfs2_jadd to add journals to a filesystem online gfs2_jadd to add journals to a filesystem online
tunegfs2 to manipulate, examine and tune a filesystem tunegfs2 to manipulate, examine and tune a filesystem
gfs2_convert to convert a gfs filesystem to gfs2 in-place gfs2_convert to convert a gfs filesystem to gfs2 in-place
mkfs.gfs2 to make a filesystem mkfs.gfs2 to make a filesystem
============ =============================================
Note: This filesystem doesn't have a maintainer. .. SPDX-License-Identifier: GPL-2.0
==================================
Macintosh HFS Filesystem for Linux Macintosh HFS Filesystem for Linux
================================== ==================================
HFS stands for ``Hierarchical File System'' and is the filesystem used
.. Note:: This filesystem doesn't have a maintainer.
HFS stands for ``Hierarchical File System`` and is the filesystem used
by the Mac Plus and all later Macintosh models. Earlier Macintosh by the Mac Plus and all later Macintosh models. Earlier Macintosh
models used MFS (``Macintosh File System''), which is not supported, models used MFS (``Macintosh File System``), which is not supported,
MacOS 8.1 and newer support a filesystem called HFS+ that's similar to MacOS 8.1 and newer support a filesystem called HFS+ that's similar to
HFS but is extended in various areas. Use the hfsplus filesystem driver HFS but is extended in various areas. Use the hfsplus filesystem driver
to access such filesystems from Linux. to access such filesystems from Linux.
...@@ -49,25 +54,25 @@ Writing to HFS Filesystems ...@@ -49,25 +54,25 @@ Writing to HFS Filesystems
HFS is not a UNIX filesystem, thus it does not have the usual features you'd HFS is not a UNIX filesystem, thus it does not have the usual features you'd
expect: expect:
o You can't modify the set-uid, set-gid, sticky or executable bits or the uid * You can't modify the set-uid, set-gid, sticky or executable bits or the uid
and gid of files. and gid of files.
o You can't create hard- or symlinks, device files, sockets or FIFOs. * You can't create hard- or symlinks, device files, sockets or FIFOs.
HFS does on the other have the concepts of multiple forks per file. These HFS does on the other have the concepts of multiple forks per file. These
non-standard forks are represented as hidden additional files in the normal non-standard forks are represented as hidden additional files in the normal
filesystems namespace which is kind of a cludge and makes the semantics for filesystems namespace which is kind of a cludge and makes the semantics for
the a little strange: the a little strange:
o You can't create, delete or rename resource forks of files or the * You can't create, delete or rename resource forks of files or the
Finder's metadata. Finder's metadata.
o They are however created (with default values), deleted and renamed * They are however created (with default values), deleted and renamed
along with the corresponding data fork or directory. along with the corresponding data fork or directory.
o Copying files to a different filesystem will loose those attributes * Copying files to a different filesystem will loose those attributes
that are essential for MacOS to work. that are essential for MacOS to work.
Creating HFS filesystems Creating HFS filesystems
=================================== ========================
The hfsutils package from Robert Leslie contains a program called The hfsutils package from Robert Leslie contains a program called
hformat that can be used to create HFS filesystem. See hformat that can be used to create HFS filesystem. See
......
.. SPDX-License-Identifier: GPL-2.0
======================================
Macintosh HFSPlus Filesystem for Linux Macintosh HFSPlus Filesystem for Linux
====================================== ======================================
......
...@@ -46,9 +46,53 @@ Documentation for filesystem implementations. ...@@ -46,9 +46,53 @@ Documentation for filesystem implementations.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
9p
adfs
affs
afs
autofs autofs
autofs-mount-control
befs
bfs
btrfs
ceph
cramfs
debugfs
dlmfs
ecryptfs
efivarfs
erofs
ext2
ext3
f2fs
gfs2
gfs2-uevents
hfs
hfsplus
hpfs
fuse fuse
inotify
isofs
nilfs2
nfs/index
ntfs
ocfs2
ocfs2-online-filecheck
omfs
orangefs
overlayfs overlayfs
proc
qnx6
ramfs-rootfs-initramfs
relay
romfs
squashfs
sysfs
sysv-fs
tmpfs
ubifs
ubifs-authentication.rst
udf
virtiofs virtiofs
vfat vfat
nfs/index zonefs
inotify .. SPDX-License-Identifier: GPL-2.0
a powerful yet simple file change notification system
===============================================================
Inotify - A Powerful yet Simple File Change Notification System
===============================================================
Document started 15 Mar 2005 by Robert Love <rml@novell.com> Document started 15 Mar 2005 by Robert Love <rml@novell.com>
Document updated 4 Jan 2015 by Zhang Zhen <zhenzhang.zhang@huawei.com> Document updated 4 Jan 2015 by Zhang Zhen <zhenzhang.zhang@huawei.com>
--Deleted obsoleted interface, just refer to manpages for user interface.
- Deleted obsoleted interface, just refer to manpages for user interface.
(i) Rationale (i) Rationale
Q: What is the design decision behind not tying the watch to the open fd of Q:
What is the design decision behind not tying the watch to the open fd of
the watched object? the watched object?
A: Watches are associated with an open inotify device, not an open file. A:
Watches are associated with an open inotify device, not an open file.
This solves the primary problem with dnotify: keeping the file open pins This solves the primary problem with dnotify: keeping the file open pins
the file and thus, worse, pins the mount. Dnotify is therefore infeasible the file and thus, worse, pins the mount. Dnotify is therefore infeasible
for use on a desktop system with removable media as the media cannot be for use on a desktop system with removable media as the media cannot be
unmounted. Watching a file should not require that it be open. unmounted. Watching a file should not require that it be open.
Q: What is the design decision behind using an-fd-per-instance as opposed to Q:
What is the design decision behind using an-fd-per-instance as opposed to
an fd-per-watch? an fd-per-watch?
A: An fd-per-watch quickly consumes more file descriptors than are allowed, A:
An fd-per-watch quickly consumes more file descriptors than are allowed,
more fd's than are feasible to manage, and more fd's than are optimally more fd's than are feasible to manage, and more fd's than are optimally
select()-able. Yes, root can bump the per-process fd limit and yes, users select()-able. Yes, root can bump the per-process fd limit and yes, users
can use epoll, but requiring both is a silly and extraneous requirement. can use epoll, but requiring both is a silly and extraneous requirement.
...@@ -29,8 +38,8 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed, ...@@ -29,8 +38,8 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed,
spaces is thus sensible. The current design is what user-space developers spaces is thus sensible. The current design is what user-space developers
want: Users initialize inotify, once, and add n watches, requiring but one want: Users initialize inotify, once, and add n watches, requiring but one
fd and no twiddling with fd limits. Initializing an inotify instance two fd and no twiddling with fd limits. Initializing an inotify instance two
thousand times is silly. If we can implement user-space's preferences thousand times is silly. If we can implement user-space's preferences
cleanly--and we can, the idr layer makes stuff like this trivial--then we cleanly--and we can, the idr layer makes stuff like this trivial--then we
should. should.
There are other good arguments. With a single fd, there is a single There are other good arguments. With a single fd, there is a single
...@@ -65,9 +74,11 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed, ...@@ -65,9 +74,11 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed,
need not be a one-fd-per-process mapping; it is one-fd-per-queue and a need not be a one-fd-per-process mapping; it is one-fd-per-queue and a
process can easily want more than one queue. process can easily want more than one queue.
Q: Why the system call approach? Q:
Why the system call approach?
A: The poor user-space interface is the second biggest problem with dnotify. A:
The poor user-space interface is the second biggest problem with dnotify.
Signals are a terrible, terrible interface for file notification. Or for Signals are a terrible, terrible interface for file notification. Or for
anything, for that matter. The ideal solution, from all perspectives, is a anything, for that matter. The ideal solution, from all perspectives, is a
file descriptor-based one that allows basic file I/O and poll/select. file descriptor-based one that allows basic file I/O and poll/select.
......
.. SPDX-License-Identifier: GPL-2.0
==================
ISO9660 Filesystem
==================
Mount options that are the same as for msdos and vfat partitions. Mount options that are the same as for msdos and vfat partitions.
========= ========================================================
gid=nnn All files in the partition will be in group nnn. gid=nnn All files in the partition will be in group nnn.
uid=nnn All files in the partition will be owned by user id nnn. uid=nnn All files in the partition will be owned by user id nnn.
umask=nnn The permission mask (see umask(1)) for the partition. umask=nnn The permission mask (see umask(1)) for the partition.
========= ========================================================
Mount options that are the same as vfat partitions. These are only useful Mount options that are the same as vfat partitions. These are only useful
when using discs encoded using Microsoft's Joliet extensions. when using discs encoded using Microsoft's Joliet extensions.
iocharset=name Character set to use for converting from Unicode to
============== =============================================================
iocharset=name Character set to use for converting from Unicode to
ASCII. Joliet filenames are stored in Unicode format, but ASCII. Joliet filenames are stored in Unicode format, but
Unix for the most part doesn't know how to deal with Unicode. Unix for the most part doesn't know how to deal with Unicode.
There is also an option of doing UTF-8 translations with the There is also an option of doing UTF-8 translations with the
utf8 option. utf8 option.
utf8 Encode Unicode names in UTF-8 format. Default is no. utf8 Encode Unicode names in UTF-8 format. Default is no.
============== =============================================================
Mount options unique to the isofs filesystem. Mount options unique to the isofs filesystem.
block=512 Set the block size for the disk to 512 bytes
block=1024 Set the block size for the disk to 1024 bytes ================= ============================================================
block=2048 Set the block size for the disk to 2048 bytes block=512 Set the block size for the disk to 512 bytes
check=relaxed Matches filenames with different cases block=1024 Set the block size for the disk to 1024 bytes
check=strict Matches only filenames with the exact same case block=2048 Set the block size for the disk to 2048 bytes
cruft Try to handle badly formatted CDs. check=relaxed Matches filenames with different cases
map=off Do not map non-Rock Ridge filenames to lower case check=strict Matches only filenames with the exact same case
map=normal Map non-Rock Ridge filenames to lower case cruft Try to handle badly formatted CDs.
map=acorn As map=normal but also apply Acorn extensions if present map=off Do not map non-Rock Ridge filenames to lower case
mode=xxx Sets the permissions on files to xxx unless Rock Ridge map=normal Map non-Rock Ridge filenames to lower case
extensions set the permissions otherwise map=acorn As map=normal but also apply Acorn extensions if present
dmode=xxx Sets the permissions on directories to xxx unless Rock Ridge mode=xxx Sets the permissions on files to xxx unless Rock Ridge
extensions set the permissions otherwise extensions set the permissions otherwise
dmode=xxx Sets the permissions on directories to xxx unless Rock Ridge
extensions set the permissions otherwise
overriderockperm Set permissions on files and directories according to overriderockperm Set permissions on files and directories according to
'mode' and 'dmode' even though Rock Ridge extensions are 'mode' and 'dmode' even though Rock Ridge extensions are
present. present.
nojoliet Ignore Joliet extensions if they are present. nojoliet Ignore Joliet extensions if they are present.
norock Ignore Rock Ridge extensions if they are present. norock Ignore Rock Ridge extensions if they are present.
hide Completely strip hidden files from the file system. hide Completely strip hidden files from the file system.
showassoc Show files marked with the 'associated' bit showassoc Show files marked with the 'associated' bit
unhide Deprecated; showing hidden files is now default; unhide Deprecated; showing hidden files is now default;
If given, it is a synonym for 'showassoc' which will If given, it is a synonym for 'showassoc' which will
recreate previous unhide behavior recreate previous unhide behavior
session=x Select number of session on multisession CD session=x Select number of session on multisession CD
sbsector=xxx Session begins from sector xxx sbsector=xxx Session begins from sector xxx
================= ============================================================
Recommended documents about ISO 9660 standard are located at: Recommended documents about ISO 9660 standard are located at:
http://www.y-adagio.com/
ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf - http://www.y-adagio.com/
Quoting from the PDF "This 2nd Edition of Standard ECMA-119 is technically - ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf
Quoting from the PDF "This 2nd Edition of Standard ECMA-119 is technically
identical with ISO 9660.", so it is a valid and gratis substitute of the identical with ISO 9660.", so it is a valid and gratis substitute of the
official ISO specification. official ISO specification.
.. SPDX-License-Identifier: GPL-2.0
======
NILFS2 NILFS2
------ ======
NILFS2 is a log-structured file system (LFS) supporting continuous NILFS2 is a log-structured file system (LFS) supporting continuous
snapshotting. In addition to versioning capability of the entire file snapshotting. In addition to versioning capability of the entire file
...@@ -25,9 +28,9 @@ available from the following download page. At least "mkfs.nilfs2", ...@@ -25,9 +28,9 @@ available from the following download page. At least "mkfs.nilfs2",
cleaner or garbage collector) are required. Details on the tools are cleaner or garbage collector) are required. Details on the tools are
described in the man pages included in the package. described in the man pages included in the package.
Project web page: https://nilfs.sourceforge.io/ :Project web page: https://nilfs.sourceforge.io/
Download page: https://nilfs.sourceforge.io/en/download.html :Download page: https://nilfs.sourceforge.io/en/download.html
List info: http://vger.kernel.org/vger-lists.html#linux-nilfs :List info: http://vger.kernel.org/vger-lists.html#linux-nilfs
Caveats Caveats
======= =======
...@@ -47,6 +50,7 @@ Mount options ...@@ -47,6 +50,7 @@ Mount options
NILFS2 supports the following mount options: NILFS2 supports the following mount options:
(*) == default (*) == default
======================= =======================================================
barrier(*) This enables/disables the use of write barriers. This barrier(*) This enables/disables the use of write barriers. This
nobarrier requires an IO stack which can support barriers, and nobarrier requires an IO stack which can support barriers, and
if nilfs gets an error on a barrier write, it will if nilfs gets an error on a barrier write, it will
...@@ -79,6 +83,7 @@ discard This enables/disables the use of discard/TRIM commands. ...@@ -79,6 +83,7 @@ discard This enables/disables the use of discard/TRIM commands.
nodiscard(*) The discard/TRIM commands are sent to the underlying nodiscard(*) The discard/TRIM commands are sent to the underlying
block device when blocks are freed. This is useful block device when blocks are freed. This is useful
for SSD devices and sparse/thinly-provisioned LUNs. for SSD devices and sparse/thinly-provisioned LUNs.
======================= =======================================================
Ioctls Ioctls
====== ======
...@@ -87,9 +92,11 @@ There is some NILFS2 specific functionality which can be accessed by application ...@@ -87,9 +92,11 @@ There is some NILFS2 specific functionality which can be accessed by application
through the system call interfaces. The list of all NILFS2 specific ioctls are through the system call interfaces. The list of all NILFS2 specific ioctls are
shown in the table below. shown in the table below.
Table of NILFS2 specific ioctls Table of NILFS2 specific ioctls:
..............................................................................
============================== ===============================================
Ioctl Description Ioctl Description
============================== ===============================================
NILFS_IOCTL_CHANGE_CPMODE Change mode of given checkpoint between NILFS_IOCTL_CHANGE_CPMODE Change mode of given checkpoint between
checkpoint and snapshot state. This ioctl is checkpoint and snapshot state. This ioctl is
used in chcp and mkcp utilities. used in chcp and mkcp utilities.
...@@ -142,11 +149,12 @@ Table of NILFS2 specific ioctls ...@@ -142,11 +149,12 @@ Table of NILFS2 specific ioctls
NILFS_IOCTL_SET_ALLOC_RANGE Define lower limit of segments in bytes and NILFS_IOCTL_SET_ALLOC_RANGE Define lower limit of segments in bytes and
upper limit of segments in bytes. This ioctl upper limit of segments in bytes. This ioctl
is used by nilfs_resize utility. is used by nilfs_resize utility.
============================== ===============================================
NILFS2 usage NILFS2 usage
============ ============
To use nilfs2 as a local file system, simply: To use nilfs2 as a local file system, simply::
# mkfs -t nilfs2 /dev/block_device # mkfs -t nilfs2 /dev/block_device
# mount -t nilfs2 /dev/block_device /dir # mount -t nilfs2 /dev/block_device /dir
...@@ -157,18 +165,20 @@ This will also invoke the cleaner through the mount helper program ...@@ -157,18 +165,20 @@ This will also invoke the cleaner through the mount helper program
Checkpoints and snapshots are managed by the following commands. Checkpoints and snapshots are managed by the following commands.
Their manpages are included in the nilfs-utils package above. Their manpages are included in the nilfs-utils package above.
==== ===========================================================
lscp list checkpoints or snapshots. lscp list checkpoints or snapshots.
mkcp make a checkpoint or a snapshot. mkcp make a checkpoint or a snapshot.
chcp change an existing checkpoint to a snapshot or vice versa. chcp change an existing checkpoint to a snapshot or vice versa.
rmcp invalidate specified checkpoint(s). rmcp invalidate specified checkpoint(s).
==== ===========================================================
To mount a snapshot, To mount a snapshot::
# mount -t nilfs2 -r -o cp=<cno> /dev/block_device /snap_dir # mount -t nilfs2 -r -o cp=<cno> /dev/block_device /snap_dir
where <cno> is the checkpoint number of the snapshot. where <cno> is the checkpoint number of the snapshot.
To unmount the NILFS2 mount point or snapshot, simply: To unmount the NILFS2 mount point or snapshot, simply::
# umount /dir # umount /dir
...@@ -181,7 +191,7 @@ Disk format ...@@ -181,7 +191,7 @@ Disk format
A nilfs2 volume is equally divided into a number of segments except A nilfs2 volume is equally divided into a number of segments except
for the super block (SB) and segment #0. A segment is the container for the super block (SB) and segment #0. A segment is the container
of logs. Each log is composed of summary information blocks, payload of logs. Each log is composed of summary information blocks, payload
blocks, and an optional super root block (SR): blocks, and an optional super root block (SR)::
______________________________________________________ ______________________________________________________
| |SB| | Segment | Segment | Segment | ... | Segment | | | |SB| | Segment | Segment | Segment | ... | Segment | |
...@@ -200,7 +210,7 @@ blocks, and an optional super root block (SR): ...@@ -200,7 +210,7 @@ blocks, and an optional super root block (SR):
|_blocks__|_________________|__| |_blocks__|_________________|__|
The payload blocks are organized per file, and each file consists of The payload blocks are organized per file, and each file consists of
data blocks and B-tree node blocks: data blocks and B-tree node blocks::
|<--- File-A --->|<--- File-B --->| |<--- File-A --->|<--- File-B --->|
_______________________________________________________________ _______________________________________________________________
...@@ -213,7 +223,7 @@ files without data blocks or B-tree node blocks. ...@@ -213,7 +223,7 @@ files without data blocks or B-tree node blocks.
The organization of the blocks is recorded in the summary information The organization of the blocks is recorded in the summary information
blocks, which contains a header structure (nilfs_segment_summary), per blocks, which contains a header structure (nilfs_segment_summary), per
file structures (nilfs_finfo), and per block structures (nilfs_binfo): file structures (nilfs_finfo), and per block structures (nilfs_binfo)::
_________________________________________________________________________ _________________________________________________________________________
| Summary | finfo | binfo | ... | binfo | finfo | binfo | ... | binfo |... | Summary | finfo | binfo | ... | binfo | finfo | binfo | ... | binfo |...
...@@ -223,7 +233,7 @@ file structures (nilfs_finfo), and per block structures (nilfs_binfo): ...@@ -223,7 +233,7 @@ file structures (nilfs_finfo), and per block structures (nilfs_binfo):
The logs include regular files, directory files, symbolic link files The logs include regular files, directory files, symbolic link files
and several meta data files. The mata data files are the files used and several meta data files. The mata data files are the files used
to maintain file system meta data. The current version of NILFS2 uses to maintain file system meta data. The current version of NILFS2 uses
the following meta data files: the following meta data files::
1) Inode file (ifile) -- Stores on-disk inodes 1) Inode file (ifile) -- Stores on-disk inodes
2) Checkpoint file (cpfile) -- Stores checkpoints 2) Checkpoint file (cpfile) -- Stores checkpoints
...@@ -232,7 +242,7 @@ the following meta data files: ...@@ -232,7 +242,7 @@ the following meta data files:
(DAT) block numbers. This file serves to (DAT) block numbers. This file serves to
make on-disk blocks relocatable. make on-disk blocks relocatable.
The following figure shows a typical organization of the logs: The following figure shows a typical organization of the logs::
_________________________________________________________________________ _________________________________________________________________________
| Summary | regular file | file | ... | ifile | cpfile | sufile | DAT |SR| | Summary | regular file | file | ... | ifile | cpfile | sufile | DAT |SR|
...@@ -250,7 +260,7 @@ three special inodes, inodes for the DAT, cpfile, and sufile. Inodes ...@@ -250,7 +260,7 @@ three special inodes, inodes for the DAT, cpfile, and sufile. Inodes
of regular files, directories, symlinks and other special files, are of regular files, directories, symlinks and other special files, are
included in the ifile. The inode of ifile itself is included in the included in the ifile. The inode of ifile itself is included in the
corresponding checkpoint entry in the cpfile. Thus, the hierarchy corresponding checkpoint entry in the cpfile. Thus, the hierarchy
among NILFS2 files can be depicted as follows: among NILFS2 files can be depicted as follows::
Super block (SB) Super block (SB)
| |
......
OCFS2 online file check .. SPDX-License-Identifier: GPL-2.0
-----------------------
=====================================
OCFS2 file system - online file check
=====================================
This document will describe OCFS2 online file check feature. This document will describe OCFS2 online file check feature.
...@@ -40,7 +43,7 @@ When there are errors in the OCFS2 filesystem, they are usually accompanied ...@@ -40,7 +43,7 @@ When there are errors in the OCFS2 filesystem, they are usually accompanied
by the inode number which caused the error. This inode number would be the by the inode number which caused the error. This inode number would be the
input to check/fix the file. input to check/fix the file.
There is a sysfs directory for each OCFS2 file system mounting: There is a sysfs directory for each OCFS2 file system mounting::
/sys/fs/ocfs2/<devname>/filecheck /sys/fs/ocfs2/<devname>/filecheck
...@@ -50,34 +53,36 @@ communicate with kernel space, tell which file(inode number) will be checked or ...@@ -50,34 +53,36 @@ communicate with kernel space, tell which file(inode number) will be checked or
fixed. Currently, three operations are supported, which includes checking fixed. Currently, three operations are supported, which includes checking
inode, fixing inode and setting the size of result record history. inode, fixing inode and setting the size of result record history.
1. If you want to know what error exactly happened to <inode> before fixing, do 1. If you want to know what error exactly happened to <inode> before fixing, do::
# echo "<inode>" > /sys/fs/ocfs2/<devname>/filecheck/check
# cat /sys/fs/ocfs2/<devname>/filecheck/check
The output is like this::
# echo "<inode>" > /sys/fs/ocfs2/<devname>/filecheck/check INO DONE ERROR
# cat /sys/fs/ocfs2/<devname>/filecheck/check 39502 1 GENERATION
The output is like this: <INO> lists the inode numbers.
INO DONE ERROR <DONE> indicates whether the operation has been finished.
39502 1 GENERATION <ERROR> says what kind of errors was found. For the detailed error numbers,
please refer to the file linux/fs/ocfs2/filecheck.h.
<INO> lists the inode numbers. 2. If you determine to fix this inode, do::
<DONE> indicates whether the operation has been finished.
<ERROR> says what kind of errors was found. For the detailed error numbers,
please refer to the file linux/fs/ocfs2/filecheck.h.
2. If you determine to fix this inode, do # echo "<inode>" > /sys/fs/ocfs2/<devname>/filecheck/fix
# cat /sys/fs/ocfs2/<devname>/filecheck/fix
# echo "<inode>" > /sys/fs/ocfs2/<devname>/filecheck/fix The output is like this:::
# cat /sys/fs/ocfs2/<devname>/filecheck/fix
The output is like this: INO DONE ERROR
INO DONE ERROR 39502 1 SUCCESS
39502 1 SUCCESS
This time, the <ERROR> column indicates whether this fix is successful or not. This time, the <ERROR> column indicates whether this fix is successful or not.
3. The record cache is used to store the history of check/fix results. It's 3. The record cache is used to store the history of check/fix results. It's
default size is 10, and can be adjust between the range of 10 ~ 100. You can default size is 10, and can be adjust between the range of 10 ~ 100. You can
adjust the size like this: adjust the size like this::
# echo "<size>" > /sys/fs/ocfs2/<devname>/filecheck/set # echo "<size>" > /sys/fs/ocfs2/<devname>/filecheck/set
......
.. SPDX-License-Identifier: GPL-2.0
================
OCFS2 filesystem OCFS2 filesystem
================== ================
OCFS2 is a general purpose extent based shared disk cluster file OCFS2 is a general purpose extent based shared disk cluster file
system with many similarities to ext3. It supports 64 bit inode system with many similarities to ext3. It supports 64 bit inode
numbers, and has automatically extending metadata groups which may numbers, and has automatically extending metadata groups which may
...@@ -14,22 +18,26 @@ OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/ ...@@ -14,22 +18,26 @@ OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
All code copyright 2005 Oracle except when otherwise noted. All code copyright 2005 Oracle except when otherwise noted.
CREDITS: Credits
=======
Lots of code taken from ext3 and other projects. Lots of code taken from ext3 and other projects.
Authors in alphabetical order: Authors in alphabetical order:
Joel Becker <joel.becker@oracle.com>
Zach Brown <zach.brown@oracle.com> - Joel Becker <joel.becker@oracle.com>
Mark Fasheh <mfasheh@suse.com> - Zach Brown <zach.brown@oracle.com>
Kurt Hackel <kurt.hackel@oracle.com> - Mark Fasheh <mfasheh@suse.com>
Tao Ma <tao.ma@oracle.com> - Kurt Hackel <kurt.hackel@oracle.com>
Sunil Mushran <sunil.mushran@oracle.com> - Tao Ma <tao.ma@oracle.com>
Manish Singh <manish.singh@oracle.com> - Sunil Mushran <sunil.mushran@oracle.com>
Tiger Yang <tiger.yang@oracle.com> - Manish Singh <manish.singh@oracle.com>
- Tiger Yang <tiger.yang@oracle.com>
Caveats Caveats
======= =======
Features which OCFS2 does not support yet: Features which OCFS2 does not support yet:
- Directory change notification (F_NOTIFY) - Directory change notification (F_NOTIFY)
- Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
...@@ -37,8 +45,10 @@ Mount options ...@@ -37,8 +45,10 @@ Mount options
============= =============
OCFS2 supports the following mount options: OCFS2 supports the following mount options:
(*) == default (*) == default
======================= ========================================================
barrier=1 This enables/disables barriers. barrier=0 disables it, barrier=1 This enables/disables barriers. barrier=0 disables it,
barrier=1 enables it. barrier=1 enables it.
errors=remount-ro(*) Remount the filesystem read-only on an error. errors=remount-ro(*) Remount the filesystem read-only on an error.
...@@ -104,3 +114,4 @@ journal_async_commit Commit block can be written to disk without waiting ...@@ -104,3 +114,4 @@ journal_async_commit Commit block can be written to disk without waiting
for descriptor blocks. If enabled older kernels cannot for descriptor blocks. If enabled older kernels cannot
mount the device. This will enable 'journal_checksum' mount the device. This will enable 'journal_checksum'
internally. internally.
======================= ========================================================
.. SPDX-License-Identifier: GPL-2.0
================================
Optimized MPEG Filesystem (OMFS) Optimized MPEG Filesystem (OMFS)
================================
Overview Overview
======== ========
...@@ -29,11 +33,13 @@ Options ...@@ -29,11 +33,13 @@ Options
OMFS supports the following mount-time options: OMFS supports the following mount-time options:
uid=n - make all files owned by specified user ============ ========================================
gid=n - make all files owned by specified group uid=n make all files owned by specified user
umask=xxx - set permission umask to xxx gid=n make all files owned by specified group
fmask=xxx - set umask to xxx for files umask=xxx set permission umask to xxx
dmask=xxx - set umask to xxx for directories fmask=xxx set umask to xxx for files
dmask=xxx set umask to xxx for directories
============ ========================================
Disk format Disk format
=========== ===========
...@@ -46,34 +52,34 @@ have a smaller size than a data block, but since they are both addressed by the ...@@ -46,34 +52,34 @@ have a smaller size than a data block, but since they are both addressed by the
same 64-bit block number, any remaining space in the smaller sysblock is same 64-bit block number, any remaining space in the smaller sysblock is
unused. unused.
Sysblock header information: Sysblock header information::
struct omfs_header { struct omfs_header {
__be64 h_self; /* FS block where this is located */ __be64 h_self; /* FS block where this is located */
__be32 h_body_size; /* size of useful data after header */ __be32 h_body_size; /* size of useful data after header */
__be16 h_crc; /* crc-ccitt of body_size bytes */ __be16 h_crc; /* crc-ccitt of body_size bytes */
char h_fill1[2]; char h_fill1[2];
u8 h_version; /* version, always 1 */ u8 h_version; /* version, always 1 */
char h_type; /* OMFS_INODE_X */ char h_type; /* OMFS_INODE_X */
u8 h_magic; /* OMFS_IMAGIC */ u8 h_magic; /* OMFS_IMAGIC */
u8 h_check_xor; /* XOR of header bytes before this */ u8 h_check_xor; /* XOR of header bytes before this */
__be32 h_fill2; __be32 h_fill2;
}; };
Files and directories are both represented by omfs_inode: Files and directories are both represented by omfs_inode::
struct omfs_inode { struct omfs_inode {
struct omfs_header i_head; /* header */ struct omfs_header i_head; /* header */
__be64 i_parent; /* parent containing this inode */ __be64 i_parent; /* parent containing this inode */
__be64 i_sibling; /* next inode in hash bucket */ __be64 i_sibling; /* next inode in hash bucket */
__be64 i_ctime; /* ctime, in milliseconds */ __be64 i_ctime; /* ctime, in milliseconds */
char i_fill1[35]; char i_fill1[35];
char i_type; /* OMFS_[DIR,FILE] */ char i_type; /* OMFS_[DIR,FILE] */
__be32 i_fill2; __be32 i_fill2;
char i_fill3[64]; char i_fill3[64];
char i_name[OMFS_NAMELEN]; /* filename */ char i_name[OMFS_NAMELEN]; /* filename */
__be64 i_size; /* size of file, in bytes */ __be64 i_size; /* size of file, in bytes */
}; };
Directories in OMFS are implemented as a large hash table. Filenames are Directories in OMFS are implemented as a large hash table. Filenames are
hashed then prepended into the bucket list beginning at OMFS_DIR_START. hashed then prepended into the bucket list beginning at OMFS_DIR_START.
...@@ -82,19 +88,19 @@ until a match is found on i_name. Empty buckets are represented by block ...@@ -82,19 +88,19 @@ until a match is found on i_name. Empty buckets are represented by block
pointers with all-1s (~0). pointers with all-1s (~0).
A file is an omfs_inode structure followed by an extent table beginning at A file is an omfs_inode structure followed by an extent table beginning at
OMFS_EXTENT_START: OMFS_EXTENT_START::
struct omfs_extent_entry { struct omfs_extent_entry {
__be64 e_cluster; /* start location of a set of blocks */ __be64 e_cluster; /* start location of a set of blocks */
__be64 e_blocks; /* number of blocks after e_cluster */ __be64 e_blocks; /* number of blocks after e_cluster */
}; };
struct omfs_extent { struct omfs_extent {
__be64 e_next; /* next extent table location */ __be64 e_next; /* next extent table location */
__be32 e_extent_count; /* total # extents in this table */ __be32 e_extent_count; /* total # extents in this table */
__be32 e_fill; __be32 e_fill;
struct omfs_extent_entry e_entry; /* start of extent entries */ struct omfs_extent_entry e_entry; /* start of extent entries */
}; };
Each extent holds the block offset followed by number of blocks allocated to Each extent holds the block offset followed by number of blocks allocated to
the extent. The final extent in each table is a terminator with e_cluster the extent. The final extent in each table is a terminator with e_cluster
......
.. SPDX-License-Identifier: GPL-2.0
===================
The QNX6 Filesystem The QNX6 Filesystem
=================== ===================
...@@ -14,10 +17,12 @@ Specification ...@@ -14,10 +17,12 @@ Specification
qnx6fs shares many properties with traditional Unix filesystems. It has the qnx6fs shares many properties with traditional Unix filesystems. It has the
concepts of blocks, inodes and directories. concepts of blocks, inodes and directories.
On QNX it is possible to create little endian and big endian qnx6 filesystems. On QNX it is possible to create little endian and big endian qnx6 filesystems.
This feature makes it possible to create and use a different endianness fs This feature makes it possible to create and use a different endianness fs
for the target (QNX is used on quite a range of embedded systems) platform for the target (QNX is used on quite a range of embedded systems) platform
running on a different endianness. running on a different endianness.
The Linux driver handles endianness transparently. (LE and BE) The Linux driver handles endianness transparently. (LE and BE)
Blocks Blocks
...@@ -26,6 +31,7 @@ Blocks ...@@ -26,6 +31,7 @@ Blocks
The space in the device or file is split up into blocks. These are a fixed The space in the device or file is split up into blocks. These are a fixed
size of 512, 1024, 2048 or 4096, which is decided when the filesystem is size of 512, 1024, 2048 or 4096, which is decided when the filesystem is
created. created.
Blockpointers are 32bit, so the maximum space that can be addressed is Blockpointers are 32bit, so the maximum space that can be addressed is
2^32 * 4096 bytes or 16TB 2^32 * 4096 bytes or 16TB
...@@ -50,6 +56,7 @@ Each of these root nodes holds information like total size of the stored ...@@ -50,6 +56,7 @@ Each of these root nodes holds information like total size of the stored
data and the addressing levels in that specific tree. data and the addressing levels in that specific tree.
If the level value is 0, up to 16 direct blocks can be addressed by each If the level value is 0, up to 16 direct blocks can be addressed by each
node. node.
Level 1 adds an additional indirect addressing level where each indirect Level 1 adds an additional indirect addressing level where each indirect
addressing block holds up to blocksize / 4 bytes pointers to data blocks. addressing block holds up to blocksize / 4 bytes pointers to data blocks.
Level 2 adds an additional indirect addressing block level (so, already up Level 2 adds an additional indirect addressing block level (so, already up
...@@ -57,11 +64,13 @@ to 16 * 256 * 256 = 1048576 blocks that can be addressed by such a tree). ...@@ -57,11 +64,13 @@ to 16 * 256 * 256 = 1048576 blocks that can be addressed by such a tree).
Unused block pointers are always set to ~0 - regardless of root node, Unused block pointers are always set to ~0 - regardless of root node,
indirect addressing blocks or inodes. indirect addressing blocks or inodes.
Data leaves are always on the lowest level. So no data is stored on upper Data leaves are always on the lowest level. So no data is stored on upper
tree levels. tree levels.
The first Superblock is located at 0x2000. (0x2000 is the bootblock size) The first Superblock is located at 0x2000. (0x2000 is the bootblock size)
The Audi MMI 3G first superblock directly starts at byte 0. The Audi MMI 3G first superblock directly starts at byte 0.
Second superblock position can either be calculated from the superblock Second superblock position can either be calculated from the superblock
information (total number of filesystem blocks) or by taking the highest information (total number of filesystem blocks) or by taking the highest
device address, zeroing the last 3 bytes and then subtracting 0x1000 from device address, zeroing the last 3 bytes and then subtracting 0x1000 from
...@@ -84,6 +93,7 @@ Object mode field is POSIX format. (which makes things easier) ...@@ -84,6 +93,7 @@ Object mode field is POSIX format. (which makes things easier)
There are also pointers to the first 16 blocks, if the object data can be There are also pointers to the first 16 blocks, if the object data can be
addressed with 16 direct blocks. addressed with 16 direct blocks.
For more than 16 blocks an indirect addressing in form of another tree is For more than 16 blocks an indirect addressing in form of another tree is
used. (scheme is the same as the one used for the superblock root nodes) used. (scheme is the same as the one used for the superblock root nodes)
...@@ -96,13 +106,18 @@ Directories ...@@ -96,13 +106,18 @@ Directories
A directory is a filesystem object and has an inode just like a file. A directory is a filesystem object and has an inode just like a file.
It is a specially formatted file containing records which associate each It is a specially formatted file containing records which associate each
name with an inode number. name with an inode number.
'.' inode number points to the directory inode '.' inode number points to the directory inode
'..' inode number points to the parent directory inode '..' inode number points to the parent directory inode
Eeach filename record additionally got a filename length field. Eeach filename record additionally got a filename length field.
One special case are long filenames or subdirectory names. One special case are long filenames or subdirectory names.
These got set a filename length field of 0xff in the corresponding directory These got set a filename length field of 0xff in the corresponding directory
record plus the longfile inode number also stored in that record. record plus the longfile inode number also stored in that record.
With that longfilename inode number, the longfilename tree can be walked With that longfilename inode number, the longfilename tree can be walked
starting with the superblock longfilename root node pointers. starting with the superblock longfilename root node pointers.
...@@ -111,6 +126,7 @@ Special files ...@@ -111,6 +126,7 @@ Special files
Symbolic links are also filesystem objects with inodes. They got a specific Symbolic links are also filesystem objects with inodes. They got a specific
bit in the inode mode field identifying them as symbolic link. bit in the inode mode field identifying them as symbolic link.
The directory entry file inode pointer points to the target file inode. The directory entry file inode pointer points to the target file inode.
Hard links got an inode, a directory entry, but a specific mode bit set, Hard links got an inode, a directory entry, but a specific mode bit set,
...@@ -126,9 +142,11 @@ Long filenames ...@@ -126,9 +142,11 @@ Long filenames
Long filenames are stored in a separate addressing tree. The staring point Long filenames are stored in a separate addressing tree. The staring point
is the longfilename root node in the active superblock. is the longfilename root node in the active superblock.
Each data block (tree leaves) holds one long filename. That filename is Each data block (tree leaves) holds one long filename. That filename is
limited to 510 bytes. The first two starting bytes are used as length field limited to 510 bytes. The first two starting bytes are used as length field
for the actual filename. for the actual filename.
If that structure shall fit for all allowed blocksizes, it is clear why there If that structure shall fit for all allowed blocksizes, it is clear why there
is a limit of 510 bytes for the actual filename stored. is a limit of 510 bytes for the actual filename stored.
...@@ -138,6 +156,7 @@ Bitmap ...@@ -138,6 +156,7 @@ Bitmap
The qnx6fs filesystem allocation bitmap is stored in a tree under bitmap The qnx6fs filesystem allocation bitmap is stored in a tree under bitmap
root node in the superblock and each bit in the bitmap represents one root node in the superblock and each bit in the bitmap represents one
filesystem block. filesystem block.
The first block is block 0, which starts 0x1000 after superblock start. The first block is block 0, which starts 0x1000 after superblock start.
So for a normal qnx6fs 0x3000 (bootblock + superblock) is the physical So for a normal qnx6fs 0x3000 (bootblock + superblock) is the physical
address at which block 0 is located. address at which block 0 is located.
...@@ -149,11 +168,14 @@ Bitmap system area ...@@ -149,11 +168,14 @@ Bitmap system area
------------------ ------------------
The bitmap itself is divided into three parts. The bitmap itself is divided into three parts.
First the system area, that is split into two halves. First the system area, that is split into two halves.
Then userspace. Then userspace.
The requirement for a static, fixed preallocated system area comes from how The requirement for a static, fixed preallocated system area comes from how
qnx6fs deals with writes. qnx6fs deals with writes.
Each superblock got it's own half of the system area. So superblock #1 Each superblock got it's own half of the system area. So superblock #1
always uses blocks from the lower half while superblock #2 just writes to always uses blocks from the lower half while superblock #2 just writes to
blocks represented by the upper half bitmap system area bits. blocks represented by the upper half bitmap system area bits.
......
ramfs, rootfs and initramfs .. SPDX-License-Identifier: GPL-2.0
===========================
Ramfs, rootfs and initramfs
===========================
October 17, 2005 October 17, 2005
Rob Landley <rob@landley.net> Rob Landley <rob@landley.net>
============================= =============================
...@@ -99,14 +105,14 @@ out of that. ...@@ -99,14 +105,14 @@ out of that.
All this differs from the old initrd in several ways: All this differs from the old initrd in several ways:
- The old initrd was always a separate file, while the initramfs archive is - The old initrd was always a separate file, while the initramfs archive is
linked into the linux kernel image. (The directory linux-*/usr is devoted linked into the linux kernel image. (The directory ``linux-*/usr`` is
to generating this archive during the build.) devoted to generating this archive during the build.)
- The old initrd file was a gzipped filesystem image (in some file format, - The old initrd file was a gzipped filesystem image (in some file format,
such as ext2, that needed a driver built into the kernel), while the new such as ext2, that needed a driver built into the kernel), while the new
initramfs archive is a gzipped cpio archive (like tar only simpler, initramfs archive is a gzipped cpio archive (like tar only simpler,
see cpio(1) and Documentation/driver-api/early-userspace/buffer-format.rst). The see cpio(1) and Documentation/driver-api/early-userspace/buffer-format.rst).
kernel's cpio extraction code is not only extremely small, it's also The kernel's cpio extraction code is not only extremely small, it's also
__init text and data that can be discarded during the boot process. __init text and data that can be discarded during the boot process.
- The program run by the old initrd (which was called /initrd, not /init) did - The program run by the old initrd (which was called /initrd, not /init) did
...@@ -139,7 +145,7 @@ and living in usr/Kconfig) can be used to specify a source for the ...@@ -139,7 +145,7 @@ and living in usr/Kconfig) can be used to specify a source for the
initramfs archive, which will automatically be incorporated into the initramfs archive, which will automatically be incorporated into the
resulting binary. This option can point to an existing gzipped cpio resulting binary. This option can point to an existing gzipped cpio
archive, a directory containing files to be archived, or a text file archive, a directory containing files to be archived, or a text file
specification such as the following example: specification such as the following example::
dir /dev 755 0 0 dir /dev 755 0 0
nod /dev/console 644 0 0 c 5 1 nod /dev/console 644 0 0 c 5 1
...@@ -175,12 +181,12 @@ or extracting your own preprepared cpio files to feed to the kernel build ...@@ -175,12 +181,12 @@ or extracting your own preprepared cpio files to feed to the kernel build
(instead of a config file or directory). (instead of a config file or directory).
The following command line can extract a cpio image (either by the above script The following command line can extract a cpio image (either by the above script
or by the kernel build) back into its component files: or by the kernel build) back into its component files::
cpio -i -d -H newc -F initramfs_data.cpio --no-absolute-filenames cpio -i -d -H newc -F initramfs_data.cpio --no-absolute-filenames
The following shell script can create a prebuilt cpio archive you can The following shell script can create a prebuilt cpio archive you can
use in place of the above config file: use in place of the above config file::
#!/bin/sh #!/bin/sh
...@@ -202,14 +208,17 @@ use in place of the above config file: ...@@ -202,14 +208,17 @@ use in place of the above config file:
exit 1 exit 1
fi fi
Note: The cpio man page contains some bad advice that will break your initramfs .. Note::
archive if you follow it. It says "A typical way to generate the list
of filenames is with the find command; you should give find the -depth option The cpio man page contains some bad advice that will break your initramfs
to minimize problems with permissions on directories that are unwritable or not archive if you follow it. It says "A typical way to generate the list
searchable." Don't do this when creating initramfs.cpio.gz images, it won't of filenames is with the find command; you should give find the -depth
work. The Linux kernel cpio extractor won't create files in a directory that option to minimize problems with permissions on directories that are
doesn't exist, so the directory entries must go before the files that go in unwritable or not searchable." Don't do this when creating
those directories. The above script gets them in the right order. initramfs.cpio.gz images, it won't work. The Linux kernel cpio extractor
won't create files in a directory that doesn't exist, so the directory
entries must go before the files that go in those directories.
The above script gets them in the right order.
External initramfs images: External initramfs images:
-------------------------- --------------------------
...@@ -236,9 +245,10 @@ An initramfs archive is a complete self-contained root filesystem for Linux. ...@@ -236,9 +245,10 @@ An initramfs archive is a complete self-contained root filesystem for Linux.
If you don't already understand what shared libraries, devices, and paths If you don't already understand what shared libraries, devices, and paths
you need to get a minimal root filesystem up and running, here are some you need to get a minimal root filesystem up and running, here are some
references: references:
http://www.tldp.org/HOWTO/Bootdisk-HOWTO/
http://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html - http://www.tldp.org/HOWTO/Bootdisk-HOWTO/
http://www.linuxfromscratch.org/lfs/view/stable/ - http://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html
- http://www.linuxfromscratch.org/lfs/view/stable/
The "klibc" package (http://www.kernel.org/pub/linux/libs/klibc) is The "klibc" package (http://www.kernel.org/pub/linux/libs/klibc) is
designed to be a tiny C library to statically link early userspace designed to be a tiny C library to statically link early userspace
...@@ -255,7 +265,7 @@ name lookups, even when otherwise statically linked.) ...@@ -255,7 +265,7 @@ name lookups, even when otherwise statically linked.)
A good first step is to get initramfs to run a statically linked "hello world" A good first step is to get initramfs to run a statically linked "hello world"
program as init, and test it under an emulator like qemu (www.qemu.org) or program as init, and test it under an emulator like qemu (www.qemu.org) or
User Mode Linux, like so: User Mode Linux, like so::
cat > hello.c << EOF cat > hello.c << EOF
#include <stdio.h> #include <stdio.h>
...@@ -326,8 +336,8 @@ the above threads) is: ...@@ -326,8 +336,8 @@ the above threads) is:
explained his reasoning: explained his reasoning:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1550.html - http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1550.html
http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1638.html - http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1638.html
and, most importantly, designed and implemented the initramfs code. and, most importantly, designed and implemented the initramfs code.
......
.. SPDX-License-Identifier: GPL-2.0
==================================
relay interface (formerly relayfs) relay interface (formerly relayfs)
================================== ==================================
...@@ -108,6 +111,7 @@ The relay interface implements basic file operations for user space ...@@ -108,6 +111,7 @@ The relay interface implements basic file operations for user space
access to relay channel buffer data. Here are the file operations access to relay channel buffer data. Here are the file operations
that are available and some comments regarding their behavior: that are available and some comments regarding their behavior:
=========== ============================================================
open() enables user to open an _existing_ channel buffer. open() enables user to open an _existing_ channel buffer.
mmap() results in channel buffer being mapped into the caller's mmap() results in channel buffer being mapped into the caller's
...@@ -136,13 +140,16 @@ poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are ...@@ -136,13 +140,16 @@ poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are
close() decrements the channel buffer's refcount. When the refcount close() decrements the channel buffer's refcount. When the refcount
reaches 0, i.e. when no process or kernel client has the reaches 0, i.e. when no process or kernel client has the
buffer open, the channel buffer is freed. buffer open, the channel buffer is freed.
=========== ============================================================
In order for a user application to make use of relay files, the In order for a user application to make use of relay files, the
host filesystem must be mounted. For example, host filesystem must be mounted. For example::
mount -t debugfs debugfs /sys/kernel/debug mount -t debugfs debugfs /sys/kernel/debug
NOTE: the host filesystem doesn't need to be mounted for kernel .. Note::
the host filesystem doesn't need to be mounted for kernel
clients to create or use channels - it only needs to be clients to create or use channels - it only needs to be
mounted when user space applications need access to the buffer mounted when user space applications need access to the buffer
data. data.
...@@ -154,7 +161,7 @@ The relay interface kernel API ...@@ -154,7 +161,7 @@ The relay interface kernel API
Here's a summary of the API the relay interface provides to in-kernel clients: Here's a summary of the API the relay interface provides to in-kernel clients:
TBD(curr. line MT:/API/) TBD(curr. line MT:/API/)
channel management functions: channel management functions::
relay_open(base_filename, parent, subbuf_size, n_subbufs, relay_open(base_filename, parent, subbuf_size, n_subbufs,
callbacks, private_data) callbacks, private_data)
...@@ -162,17 +169,17 @@ TBD(curr. line MT:/API/) ...@@ -162,17 +169,17 @@ TBD(curr. line MT:/API/)
relay_flush(chan) relay_flush(chan)
relay_reset(chan) relay_reset(chan)
channel management typically called on instigation of userspace: channel management typically called on instigation of userspace::
relay_subbufs_consumed(chan, cpu, subbufs_consumed) relay_subbufs_consumed(chan, cpu, subbufs_consumed)
write functions: write functions::
relay_write(chan, data, length) relay_write(chan, data, length)
__relay_write(chan, data, length) __relay_write(chan, data, length)
relay_reserve(chan, length) relay_reserve(chan, length)
callbacks: callbacks::
subbuf_start(buf, subbuf, prev_subbuf, prev_padding) subbuf_start(buf, subbuf, prev_subbuf, prev_padding)
buf_mapped(buf, filp) buf_mapped(buf, filp)
...@@ -180,7 +187,7 @@ TBD(curr. line MT:/API/) ...@@ -180,7 +187,7 @@ TBD(curr. line MT:/API/)
create_buf_file(filename, parent, mode, buf, is_global) create_buf_file(filename, parent, mode, buf, is_global)
remove_buf_file(dentry) remove_buf_file(dentry)
helper functions: helper functions::
relay_buf_full(buf) relay_buf_full(buf)
subbuf_start_reserve(buf, length) subbuf_start_reserve(buf, length)
...@@ -215,41 +222,41 @@ the file(s) created in create_buf_file() and is called during ...@@ -215,41 +222,41 @@ the file(s) created in create_buf_file() and is called during
relay_close(). relay_close().
Here are some typical definitions for these callbacks, in this case Here are some typical definitions for these callbacks, in this case
using debugfs: using debugfs::
/* /*
* create_buf_file() callback. Creates relay file in debugfs. * create_buf_file() callback. Creates relay file in debugfs.
*/ */
static struct dentry *create_buf_file_handler(const char *filename, static struct dentry *create_buf_file_handler(const char *filename,
struct dentry *parent, struct dentry *parent,
umode_t mode, umode_t mode,
struct rchan_buf *buf, struct rchan_buf *buf,
int *is_global) int *is_global)
{ {
return debugfs_create_file(filename, mode, parent, buf, return debugfs_create_file(filename, mode, parent, buf,
&relay_file_operations); &relay_file_operations);
} }
/* /*
* remove_buf_file() callback. Removes relay file from debugfs. * remove_buf_file() callback. Removes relay file from debugfs.
*/ */
static int remove_buf_file_handler(struct dentry *dentry) static int remove_buf_file_handler(struct dentry *dentry)
{ {
debugfs_remove(dentry); debugfs_remove(dentry);
return 0; return 0;
} }
/* /*
* relay interface callbacks * relay interface callbacks
*/ */
static struct rchan_callbacks relay_callbacks = static struct rchan_callbacks relay_callbacks =
{ {
.create_buf_file = create_buf_file_handler, .create_buf_file = create_buf_file_handler,
.remove_buf_file = remove_buf_file_handler, .remove_buf_file = remove_buf_file_handler,
}; };
And an example relay_open() invocation using them: And an example relay_open() invocation using them::
chan = relay_open("cpu", NULL, SUBBUF_SIZE, N_SUBBUFS, &relay_callbacks, NULL); chan = relay_open("cpu", NULL, SUBBUF_SIZE, N_SUBBUFS, &relay_callbacks, NULL);
...@@ -339,23 +346,23 @@ whether or not to actually move on to the next sub-buffer. ...@@ -339,23 +346,23 @@ whether or not to actually move on to the next sub-buffer.
To implement 'no-overwrite' mode, the userspace client would provide To implement 'no-overwrite' mode, the userspace client would provide
an implementation of the subbuf_start() callback something like the an implementation of the subbuf_start() callback something like the
following: following::
static int subbuf_start(struct rchan_buf *buf, static int subbuf_start(struct rchan_buf *buf,
void *subbuf, void *subbuf,
void *prev_subbuf, void *prev_subbuf,
unsigned int prev_padding) unsigned int prev_padding)
{ {
if (prev_subbuf) if (prev_subbuf)
*((unsigned *)prev_subbuf) = prev_padding; *((unsigned *)prev_subbuf) = prev_padding;
if (relay_buf_full(buf)) if (relay_buf_full(buf))
return 0; return 0;
subbuf_start_reserve(buf, sizeof(unsigned int)); subbuf_start_reserve(buf, sizeof(unsigned int));
return 1; return 1;
} }
If the current buffer is full, i.e. all sub-buffers remain unconsumed, If the current buffer is full, i.e. all sub-buffers remain unconsumed,
the callback returns 0 to indicate that the buffer switch should not the callback returns 0 to indicate that the buffer switch should not
...@@ -370,20 +377,20 @@ ready sub-buffers will relay_buf_full() return 0, in which case the ...@@ -370,20 +377,20 @@ ready sub-buffers will relay_buf_full() return 0, in which case the
buffer switch can continue. buffer switch can continue.
The implementation of the subbuf_start() callback for 'overwrite' mode The implementation of the subbuf_start() callback for 'overwrite' mode
would be very similar: would be very similar::
static int subbuf_start(struct rchan_buf *buf, static int subbuf_start(struct rchan_buf *buf,
void *subbuf, void *subbuf,
void *prev_subbuf, void *prev_subbuf,
size_t prev_padding) size_t prev_padding)
{ {
if (prev_subbuf) if (prev_subbuf)
*((unsigned *)prev_subbuf) = prev_padding; *((unsigned *)prev_subbuf) = prev_padding;
subbuf_start_reserve(buf, sizeof(unsigned int)); subbuf_start_reserve(buf, sizeof(unsigned int));
return 1; return 1;
} }
In this case, the relay_buf_full() check is meaningless and the In this case, the relay_buf_full() check is meaningless and the
callback always returns 1, causing the buffer switch to occur callback always returns 1, causing the buffer switch to occur
......
ROMFS - ROM FILE SYSTEM .. SPDX-License-Identifier: GPL-2.0
=======================
ROMFS - ROM File System
=======================
This is a quite dumb, read only filesystem, mainly for initial RAM This is a quite dumb, read only filesystem, mainly for initial RAM
disks of installation disks. It has grown up by the need of having disks of installation disks. It has grown up by the need of having
...@@ -51,9 +55,9 @@ the 16 byte padding for the name and the contents, also 16+14+15 = 45 ...@@ -51,9 +55,9 @@ the 16 byte padding for the name and the contents, also 16+14+15 = 45
bytes. This is quite rare however, since most file names are longer bytes. This is quite rare however, since most file names are longer
than 3 bytes, and shorter than 15 bytes. than 3 bytes, and shorter than 15 bytes.
The layout of the filesystem is the following: The layout of the filesystem is the following::
offset content offset content
+---+---+---+---+ +---+---+---+---+
0 | - | r | o | m | \ 0 | - | r | o | m | \
...@@ -84,9 +88,9 @@ the source. This algorithm was chosen because although it's not quite ...@@ -84,9 +88,9 @@ the source. This algorithm was chosen because although it's not quite
reliable, it does not require any tables, and it is very simple. reliable, it does not require any tables, and it is very simple.
The following bytes are now part of the file system; each file header The following bytes are now part of the file system; each file header
must begin on a 16 byte boundary. must begin on a 16 byte boundary::
offset content offset content
+---+---+---+---+ +---+---+---+---+
0 | next filehdr|X| The offset of the next file header 0 | next filehdr|X| The offset of the next file header
...@@ -114,7 +118,9 @@ file is user and group 0, this should never be a problem for the ...@@ -114,7 +118,9 @@ file is user and group 0, this should never be a problem for the
intended use. The mapping of the 8 possible values to file types is intended use. The mapping of the 8 possible values to file types is
the following: the following:
== =============== ============================================
mapping spec.info means mapping spec.info means
== =============== ============================================
0 hard link link destination [file header] 0 hard link link destination [file header]
1 directory first file's header 1 directory first file's header
2 regular file unused, must be zero [MBZ] 2 regular file unused, must be zero [MBZ]
...@@ -123,6 +129,7 @@ the following: ...@@ -123,6 +129,7 @@ the following:
5 char device - " - 5 char device - " -
6 socket unused, MBZ 6 socket unused, MBZ
7 fifo unused, MBZ 7 fifo unused, MBZ
== =============== ============================================
Note that hard links are specifically marked in this filesystem, but Note that hard links are specifically marked in this filesystem, but
they will behave as you can expect (i.e. share the inode number). they will behave as you can expect (i.e. share the inode number).
...@@ -158,24 +165,24 @@ to romfs-subscribe@shadow.banki.hu, the content is irrelevant. ...@@ -158,24 +165,24 @@ to romfs-subscribe@shadow.banki.hu, the content is irrelevant.
Pending issues: Pending issues:
- Permissions and owner information are pretty essential features of a - Permissions and owner information are pretty essential features of a
Un*x like system, but romfs does not provide the full possibilities. Un*x like system, but romfs does not provide the full possibilities.
I have never found this limiting, but others might. I have never found this limiting, but others might.
- The file system is read only, so it can be very small, but in case - The file system is read only, so it can be very small, but in case
one would want to write _anything_ to a file system, he still needs one would want to write _anything_ to a file system, he still needs
a writable file system, thus negating the size advantages. Possible a writable file system, thus negating the size advantages. Possible
solutions: implement write access as a compile-time option, or a new, solutions: implement write access as a compile-time option, or a new,
similarly small writable filesystem for RAM disks. similarly small writable filesystem for RAM disks.
- Since the files are only required to have alignment on a 16 byte - Since the files are only required to have alignment on a 16 byte
boundary, it is currently possibly suboptimal to read or execute files boundary, it is currently possibly suboptimal to read or execute files
from the filesystem. It might be resolved by reordering file data to from the filesystem. It might be resolved by reordering file data to
have most of it (i.e. except the start and the end) laying at "natural" have most of it (i.e. except the start and the end) laying at "natural"
boundaries, thus it would be possible to directly map a big portion of boundaries, thus it would be possible to directly map a big portion of
the file contents to the mm subsystem. the file contents to the mm subsystem.
- Compression might be an useful feature, but memory is quite a - Compression might be an useful feature, but memory is quite a
limiting factor in my eyes. limiting factor in my eyes.
- Where it is used? - Where it is used?
...@@ -183,4 +190,5 @@ limiting factor in my eyes. ...@@ -183,4 +190,5 @@ limiting factor in my eyes.
Have fun, Have fun,
Janos Farkas <chexum@shadow.banki.hu> Janos Farkas <chexum@shadow.banki.hu>
SQUASHFS 4.0 FILESYSTEM .. SPDX-License-Identifier: GPL-2.0
=======================
Squashfs 4.0 Filesystem
======================= =======================
Squashfs is a compressed read-only filesystem for Linux. Squashfs is a compressed read-only filesystem for Linux.
It uses zlib, lz4, lzo, or xz compression to compress files, inodes and It uses zlib, lz4, lzo, or xz compression to compress files, inodes and
directories. Inodes in the system are very small and all blocks are packed to directories. Inodes in the system are very small and all blocks are packed to
minimise data overhead. Block sizes greater than 4K are supported up to a minimise data overhead. Block sizes greater than 4K are supported up to a
...@@ -15,31 +19,33 @@ needed. ...@@ -15,31 +19,33 @@ needed.
Mailing list: squashfs-devel@lists.sourceforge.net Mailing list: squashfs-devel@lists.sourceforge.net
Web site: www.squashfs.org Web site: www.squashfs.org
1. FILESYSTEM FEATURES 1. Filesystem Features
---------------------- ----------------------
Squashfs filesystem features versus Cramfs: Squashfs filesystem features versus Cramfs:
============================== ========= ==========
Squashfs Cramfs Squashfs Cramfs
============================== ========= ==========
Max filesystem size: 2^64 256 MiB Max filesystem size 2^64 256 MiB
Max file size: ~ 2 TiB 16 MiB Max file size ~ 2 TiB 16 MiB
Max files: unlimited unlimited Max files unlimited unlimited
Max directories: unlimited unlimited Max directories unlimited unlimited
Max entries per directory: unlimited unlimited Max entries per directory unlimited unlimited
Max block size: 1 MiB 4 KiB Max block size 1 MiB 4 KiB
Metadata compression: yes no Metadata compression yes no
Directory indexes: yes no Directory indexes yes no
Sparse file support: yes no Sparse file support yes no
Tail-end packing (fragments): yes no Tail-end packing (fragments) yes no
Exportable (NFS etc.): yes no Exportable (NFS etc.) yes no
Hard link support: yes no Hard link support yes no
"." and ".." in readdir: yes no "." and ".." in readdir yes no
Real inode numbers: yes no Real inode numbers yes no
32-bit uids/gids: yes no 32-bit uids/gids yes no
File creation time: yes no File creation time yes no
Xattr support: yes no Xattr support yes no
ACL support: no no ACL support no no
============================== ========= ==========
Squashfs compresses data, inodes and directories. In addition, inode and Squashfs compresses data, inodes and directories. In addition, inode and
directory data are highly compacted, and packed on byte boundaries. Each directory data are highly compacted, and packed on byte boundaries. Each
...@@ -47,7 +53,7 @@ compressed inode is on average 8 bytes in length (the exact length varies on ...@@ -47,7 +53,7 @@ compressed inode is on average 8 bytes in length (the exact length varies on
file type, i.e. regular file, directory, symbolic link, and block/char device file type, i.e. regular file, directory, symbolic link, and block/char device
inodes have different sizes). inodes have different sizes).
2. USING SQUASHFS 2. Using Squashfs
----------------- -----------------
As squashfs is a read-only filesystem, the mksquashfs program must be used to As squashfs is a read-only filesystem, the mksquashfs program must be used to
...@@ -58,11 +64,11 @@ obtained from this site also. ...@@ -58,11 +64,11 @@ obtained from this site also.
The squashfs-tools development tree is now located on kernel.org The squashfs-tools development tree is now located on kernel.org
git://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git git://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git
3. SQUASHFS FILESYSTEM DESIGN 3. Squashfs Filesystem Design
----------------------------- -----------------------------
A squashfs filesystem consists of a maximum of nine parts, packed together on a A squashfs filesystem consists of a maximum of nine parts, packed together on a
byte alignment: byte alignment::
--------------- ---------------
| superblock | | superblock |
...@@ -229,15 +235,15 @@ location of the xattr list inside each inode, a 32-bit xattr id ...@@ -229,15 +235,15 @@ location of the xattr list inside each inode, a 32-bit xattr id
is stored. This xattr id is mapped into the location of the xattr is stored. This xattr id is mapped into the location of the xattr
list using a second xattr id lookup table. list using a second xattr id lookup table.
4. TODOS AND OUTSTANDING ISSUES 4. TODOs and Outstanding Issues
------------------------------- -------------------------------
4.1 Todo list 4.1 TODO list
------------- -------------
Implement ACL support. Implement ACL support.
4.2 Squashfs internal cache 4.2 Squashfs Internal Cache
--------------------------- ---------------------------
Blocks in Squashfs are compressed. To avoid repeatedly decompressing Blocks in Squashfs are compressed. To avoid repeatedly decompressing
......
.. SPDX-License-Identifier: GPL-2.0
==================
SystemV Filesystem
==================
It implements all of It implements all of
- Xenix FS, - Xenix FS,
- SystemV/386 FS, - SystemV/386 FS,
- Coherent FS. - Coherent FS.
To install: To install:
* Answer the 'System V and Coherent filesystem support' question with 'y' * Answer the 'System V and Coherent filesystem support' question with 'y'
when configuring the kernel. when configuring the kernel.
* To mount a disk or a partition, use * To mount a disk or a partition, use::
mount [-r] -t sysv device mountpoint mount [-r] -t sysv device mountpoint
The file system type names
The file system type names::
-t sysv -t sysv
-t xenix -t xenix
-t coherent -t coherent
may be used interchangeably, but the last two will eventually disappear. may be used interchangeably, but the last two will eventually disappear.
Bugs in the present implementation: Bugs in the present implementation:
- Coherent FS: - Coherent FS:
- The "free list interleave" n:m is currently ignored. - The "free list interleave" n:m is currently ignored.
- Only file systems with no filesystem name and no pack name are recognized. - Only file systems with no filesystem name and no pack name are recognized.
(See Coherent "man mkfs" for a description of these features.) (See Coherent "man mkfs" for a description of these features.)
- SystemV Release 2 FS: - SystemV Release 2 FS:
The superblock is only searched in the blocks 9, 15, 18, which The superblock is only searched in the blocks 9, 15, 18, which
corresponds to the beginning of track 1 on floppy disks. No support corresponds to the beginning of track 1 on floppy disks. No support
for this FS on hard disk yet. for this FS on hard disk yet.
...@@ -28,12 +43,14 @@ Bugs in the present implementation: ...@@ -28,12 +43,14 @@ Bugs in the present implementation:
These filesystems are rather similar. Here is a comparison with Minix FS: These filesystems are rather similar. Here is a comparison with Minix FS:
* Linux fdisk reports on partitions * Linux fdisk reports on partitions
- Minix FS 0x81 Linux/Minix - Minix FS 0x81 Linux/Minix
- Xenix FS ?? - Xenix FS ??
- SystemV FS ?? - SystemV FS ??
- Coherent FS 0x08 AIX bootable - Coherent FS 0x08 AIX bootable
* Size of a block or zone (data allocation unit on disk) * Size of a block or zone (data allocation unit on disk)
- Minix FS 1024 - Minix FS 1024
- Xenix FS 1024 (also 512 ??) - Xenix FS 1024 (also 512 ??)
- SystemV FS 1024 (also 512 and 2048) - SystemV FS 1024 (also 512 and 2048)
...@@ -45,37 +62,51 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -45,37 +62,51 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
all the block numbers (including the super block) are offset by one track. all the block numbers (including the super block) are offset by one track.
* Byte ordering of "short" (16 bit entities) on disk: * Byte ordering of "short" (16 bit entities) on disk:
- Minix FS little endian 0 1 - Minix FS little endian 0 1
- Xenix FS little endian 0 1 - Xenix FS little endian 0 1
- SystemV FS little endian 0 1 - SystemV FS little endian 0 1
- Coherent FS little endian 0 1 - Coherent FS little endian 0 1
Of course, this affects only the file system, not the data of files on it! Of course, this affects only the file system, not the data of files on it!
* Byte ordering of "long" (32 bit entities) on disk: * Byte ordering of "long" (32 bit entities) on disk:
- Minix FS little endian 0 1 2 3 - Minix FS little endian 0 1 2 3
- Xenix FS little endian 0 1 2 3 - Xenix FS little endian 0 1 2 3
- SystemV FS little endian 0 1 2 3 - SystemV FS little endian 0 1 2 3
- Coherent FS PDP-11 2 3 0 1 - Coherent FS PDP-11 2 3 0 1
Of course, this affects only the file system, not the data of files on it! Of course, this affects only the file system, not the data of files on it!
* Inode on disk: "short", 0 means non-existent, the root dir ino is: * Inode on disk: "short", 0 means non-existent, the root dir ino is:
- Minix FS 1
- Xenix FS, SystemV FS, Coherent FS 2 ================================= ==
Minix FS 1
Xenix FS, SystemV FS, Coherent FS 2
================================= ==
* Maximum number of hard links to a file: * Maximum number of hard links to a file:
- Minix FS 250
- Xenix FS ?? =========== =========
- SystemV FS ?? Minix FS 250
- Coherent FS >=10000 Xenix FS ??
SystemV FS ??
Coherent FS >=10000
=========== =========
* Free inode management: * Free inode management:
- Minix FS a bitmap
- Minix FS
a bitmap
- Xenix FS, SystemV FS, Coherent FS - Xenix FS, SystemV FS, Coherent FS
There is a cache of a certain number of free inodes in the super-block. There is a cache of a certain number of free inodes in the super-block.
When it is exhausted, new free inodes are found using a linear search. When it is exhausted, new free inodes are found using a linear search.
* Free block management: * Free block management:
- Minix FS a bitmap
- Minix FS
a bitmap
- Xenix FS, SystemV FS, Coherent FS - Xenix FS, SystemV FS, Coherent FS
Free blocks are organized in a "free list". Maybe a misleading term, Free blocks are organized in a "free list". Maybe a misleading term,
since it is not true that every free block contains a pointer to since it is not true that every free block contains a pointer to
...@@ -86,13 +117,18 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -86,13 +117,18 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
0 on Xenix FS and SystemV FS, with a block zeroed out on Coherent FS. 0 on Xenix FS and SystemV FS, with a block zeroed out on Coherent FS.
* Super-block location: * Super-block location:
- Minix FS block 1 = bytes 1024..2047
- Xenix FS block 1 = bytes 1024..2047 =========== ==========================
- SystemV FS bytes 512..1023 Minix FS block 1 = bytes 1024..2047
- Coherent FS block 1 = bytes 512..1023 Xenix FS block 1 = bytes 1024..2047
SystemV FS bytes 512..1023
Coherent FS block 1 = bytes 512..1023
=========== ==========================
* Super-block layout: * Super-block layout:
- Minix FS
- Minix FS::
unsigned short s_ninodes; unsigned short s_ninodes;
unsigned short s_nzones; unsigned short s_nzones;
unsigned short s_imap_blocks; unsigned short s_imap_blocks;
...@@ -101,7 +137,9 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -101,7 +137,9 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
unsigned short s_log_zone_size; unsigned short s_log_zone_size;
unsigned long s_max_size; unsigned long s_max_size;
unsigned short s_magic; unsigned short s_magic;
- Xenix FS, SystemV FS, Coherent FS
- Xenix FS, SystemV FS, Coherent FS::
unsigned short s_firstdatazone; unsigned short s_firstdatazone;
unsigned long s_nzones; unsigned long s_nzones;
unsigned short s_fzone_count; unsigned short s_fzone_count;
...@@ -120,23 +158,33 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -120,23 +158,33 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
unsigned short s_interleave_m,s_interleave_n; -- Coherent FS only unsigned short s_interleave_m,s_interleave_n; -- Coherent FS only
char s_fname[6]; char s_fname[6];
char s_fpack[6]; char s_fpack[6];
then they differ considerably: then they differ considerably:
Xenix FS
Xenix FS::
char s_clean; char s_clean;
char s_fill[371]; char s_fill[371];
long s_magic; long s_magic;
long s_type; long s_type;
SystemV FS
SystemV FS::
long s_fill[12 or 14]; long s_fill[12 or 14];
long s_state; long s_state;
long s_magic; long s_magic;
long s_type; long s_type;
Coherent FS
Coherent FS::
unsigned long s_unique; unsigned long s_unique;
Note that Coherent FS has no magic. Note that Coherent FS has no magic.
* Inode layout: * Inode layout:
- Minix FS
- Minix FS::
unsigned short i_mode; unsigned short i_mode;
unsigned short i_uid; unsigned short i_uid;
unsigned long i_size; unsigned long i_size;
...@@ -144,7 +192,9 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -144,7 +192,9 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
unsigned char i_gid; unsigned char i_gid;
unsigned char i_nlinks; unsigned char i_nlinks;
unsigned short i_zone[7+1+1]; unsigned short i_zone[7+1+1];
- Xenix FS, SystemV FS, Coherent FS
- Xenix FS, SystemV FS, Coherent FS::
unsigned short i_mode; unsigned short i_mode;
unsigned short i_nlink; unsigned short i_nlink;
unsigned short i_uid; unsigned short i_uid;
...@@ -155,38 +205,55 @@ These filesystems are rather similar. Here is a comparison with Minix FS: ...@@ -155,38 +205,55 @@ These filesystems are rather similar. Here is a comparison with Minix FS:
unsigned long i_mtime; unsigned long i_mtime;
unsigned long i_ctime; unsigned long i_ctime;
* Regular file data blocks are organized as * Regular file data blocks are organized as
- Minix FS
7 direct blocks
1 indirect block (pointers to blocks)
1 double-indirect block (pointer to pointers to blocks)
- Xenix FS, SystemV FS, Coherent FS
10 direct blocks
1 indirect block (pointers to blocks)
1 double-indirect block (pointer to pointers to blocks)
1 triple-indirect block (pointer to pointers to pointers to blocks)
* Inode size, inodes per block - Minix FS:
- Minix FS 32 32
- Xenix FS 64 16 - 7 direct blocks
- SystemV FS 64 16 - 1 indirect block (pointers to blocks)
- Coherent FS 64 8 - 1 double-indirect block (pointer to pointers to blocks)
- Xenix FS, SystemV FS, Coherent FS:
- 10 direct blocks
- 1 indirect block (pointers to blocks)
- 1 double-indirect block (pointer to pointers to blocks)
- 1 triple-indirect block (pointer to pointers to pointers to blocks)
=========== ========== ================
Inode size inodes per block
=========== ========== ================
Minix FS 32 32
Xenix FS 64 16
SystemV FS 64 16
Coherent FS 64 8
=========== ========== ================
* Directory entry on disk * Directory entry on disk
- Minix FS
- Minix FS::
unsigned short inode; unsigned short inode;
char name[14/30]; char name[14/30];
- Xenix FS, SystemV FS, Coherent FS
- Xenix FS, SystemV FS, Coherent FS::
unsigned short inode; unsigned short inode;
char name[14]; char name[14];
* Dir entry size, dir entries per block =========== ============== =====================
- Minix FS 16/32 64/32 Dir entry size dir entries per block
- Xenix FS 16 64 =========== ============== =====================
- SystemV FS 16 64 Minix FS 16/32 64/32
- Coherent FS 16 32 Xenix FS 16 64
SystemV FS 16 64
Coherent FS 16 32
=========== ============== =====================
* How to implement symbolic links such that the host fsck doesn't scream: * How to implement symbolic links such that the host fsck doesn't scream:
- Minix FS normal - Minix FS normal
- Xenix FS kludge: as regular files with chmod 1000 - Xenix FS kludge: as regular files with chmod 1000
- SystemV FS ?? - SystemV FS ??
......
.. SPDX-License-Identifier: GPL-2.0
=====
Tmpfs
=====
Tmpfs is a file system which keeps all files in virtual memory. Tmpfs is a file system which keeps all files in virtual memory.
...@@ -14,7 +20,7 @@ If you compare it to ramfs (which was the template to create tmpfs) ...@@ -14,7 +20,7 @@ If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them. cannot swap and you do not have the possibility to resize them.
Since tmpfs lives completely in the page cache and on swap, all tmpfs Since tmpfs lives completely in the page cache and on swap, all tmpfs
pages will be shown as "Shmem" in /proc/meminfo and "Shared" in pages will be shown as "Shmem" in /proc/meminfo and "Shared" in
...@@ -26,7 +32,7 @@ tmpfs has the following uses: ...@@ -26,7 +32,7 @@ tmpfs has the following uses:
1) There is always a kernel internal mount which you will not see at 1) There is always a kernel internal mount which you will not see at
all. This is used for shared anonymous mappings and SYSV shared all. This is used for shared anonymous mappings and SYSV shared
memory. memory.
This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not
set, the user visible part of tmpfs is not build. But the internal set, the user visible part of tmpfs is not build. But the internal
...@@ -34,7 +40,7 @@ tmpfs has the following uses: ...@@ -34,7 +40,7 @@ tmpfs has the following uses:
2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
POSIX shared memory (shm_open, shm_unlink). Adding the following POSIX shared memory (shm_open, shm_unlink). Adding the following
line to /etc/fstab should take care of this: line to /etc/fstab should take care of this::
tmpfs /dev/shm tmpfs defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0
...@@ -56,15 +62,17 @@ tmpfs has the following uses: ...@@ -56,15 +62,17 @@ tmpfs has the following uses:
tmpfs has three mount options for sizing: tmpfs has three mount options for sizing:
size: The limit of allocated bytes for this tmpfs instance. The ========= ============================================================
size The limit of allocated bytes for this tmpfs instance. The
default is half of your physical RAM without swap. If you default is half of your physical RAM without swap. If you
oversize your tmpfs instances the machine will deadlock oversize your tmpfs instances the machine will deadlock
since the OOM handler will not be able to free that memory. since the OOM handler will not be able to free that memory.
nr_blocks: The same as size, but in blocks of PAGE_SIZE. nr_blocks The same as size, but in blocks of PAGE_SIZE.
nr_inodes: The maximum number of inodes for this instance. The default nr_inodes The maximum number of inodes for this instance. The default
is half of the number of your physical RAM pages, or (on a is half of the number of your physical RAM pages, or (on a
machine with highmem) the number of lowmem RAM pages, machine with highmem) the number of lowmem RAM pages,
whichever is the lower. whichever is the lower.
========= ============================================================
These parameters accept a suffix k, m or g for kilo, mega and giga and These parameters accept a suffix k, m or g for kilo, mega and giga and
can be changed on remount. The size parameter also accepts a suffix % can be changed on remount. The size parameter also accepts a suffix %
...@@ -82,6 +90,7 @@ tmpfs has a mount option to set the NUMA memory allocation policy for ...@@ -82,6 +90,7 @@ tmpfs has a mount option to set the NUMA memory allocation policy for
all files in that instance (if CONFIG_NUMA is enabled) - which can be all files in that instance (if CONFIG_NUMA is enabled) - which can be
adjusted on the fly via 'mount -o remount ...' adjusted on the fly via 'mount -o remount ...'
======================== ==============================================
mpol=default use the process allocation policy mpol=default use the process allocation policy
(see set_mempolicy(2)) (see set_mempolicy(2))
mpol=prefer:Node prefers to allocate memory from the given Node mpol=prefer:Node prefers to allocate memory from the given Node
...@@ -89,6 +98,7 @@ mpol=bind:NodeList allocates memory only from nodes in NodeList ...@@ -89,6 +98,7 @@ mpol=bind:NodeList allocates memory only from nodes in NodeList
mpol=interleave prefers to allocate from each node in turn mpol=interleave prefers to allocate from each node in turn
mpol=interleave:NodeList allocates from each node of NodeList in turn mpol=interleave:NodeList allocates from each node of NodeList in turn
mpol=local prefers to allocate memory from the local node mpol=local prefers to allocate memory from the local node
======================== ==============================================
NodeList format is a comma-separated list of decimal numbers and ranges, NodeList format is a comma-separated list of decimal numbers and ranges,
a range being two hyphen-separated decimal numbers, the smallest and a range being two hyphen-separated decimal numbers, the smallest and
...@@ -98,9 +108,9 @@ A memory policy with a valid NodeList will be saved, as specified, for ...@@ -98,9 +108,9 @@ A memory policy with a valid NodeList will be saved, as specified, for
use at file creation time. When a task allocates a file in the file use at file creation time. When a task allocates a file in the file
system, the mount option memory policy will be applied with a NodeList, system, the mount option memory policy will be applied with a NodeList,
if any, modified by the calling task's cpuset constraints if any, modified by the calling task's cpuset constraints
[See Documentation/admin-guide/cgroup-v1/cpusets.rst] and any optional flags, listed [See Documentation/admin-guide/cgroup-v1/cpusets.rst] and any optional flags,
below. If the resulting NodeLists is the empty set, the effective memory listed below. If the resulting NodeLists is the empty set, the effective
policy for the file will revert to "default" policy. memory policy for the file will revert to "default" policy.
NUMA memory allocation policies have optional flags that can be used in NUMA memory allocation policies have optional flags that can be used in
conjunction with their modes. These optional flags can be specified conjunction with their modes. These optional flags can be specified
...@@ -109,6 +119,8 @@ See Documentation/admin-guide/mm/numa_memory_policy.rst for a list of ...@@ -109,6 +119,8 @@ See Documentation/admin-guide/mm/numa_memory_policy.rst for a list of
all available memory allocation policy mode flags and their effect on all available memory allocation policy mode flags and their effect on
memory policy. memory policy.
::
=static is equivalent to MPOL_F_STATIC_NODES =static is equivalent to MPOL_F_STATIC_NODES
=relative is equivalent to MPOL_F_RELATIVE_NODES =relative is equivalent to MPOL_F_RELATIVE_NODES
...@@ -128,9 +140,11 @@ on MountPoint, by 'mount -o remount,mpol=Policy:NodeList MountPoint'. ...@@ -128,9 +140,11 @@ on MountPoint, by 'mount -o remount,mpol=Policy:NodeList MountPoint'.
To specify the initial root directory you can use the following mount To specify the initial root directory you can use the following mount
options: options:
mode: The permissions as an octal number ==== ==================================
uid: The user id mode The permissions as an octal number
gid: The group id uid The user id
gid The group id
==== ==================================
These options do not have any effect on remount. You can change these These options do not have any effect on remount. You can change these
parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem. parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem.
...@@ -141,9 +155,9 @@ will give you tmpfs instance on /mytmpfs which can allocate 10GB ...@@ -141,9 +155,9 @@ will give you tmpfs instance on /mytmpfs which can allocate 10GB
RAM/SWAP in 10240 inodes and it is only accessible by root. RAM/SWAP in 10240 inodes and it is only accessible by root.
Author: :Author:
Christoph Rohland <cr@sap.com>, 1.12.01 Christoph Rohland <cr@sap.com>, 1.12.01
Updated: :Updated:
Hugh Dickins, 4 June 2007 Hugh Dickins, 4 June 2007
Updated: :Updated:
KOSAKI Motohiro, 16 Mar 2010 KOSAKI Motohiro, 16 Mar 2010
.. SPDX-License-Identifier: GPL-2.0
:orphan: :orphan:
.. UBIFS Authentication .. UBIFS Authentication
...@@ -92,11 +94,11 @@ UBIFS Index & Tree Node Cache ...@@ -92,11 +94,11 @@ UBIFS Index & Tree Node Cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types
of nodes. Eg. data nodes (`struct ubifs_data_node`) which store chunks of file of nodes. Eg. data nodes (``struct ubifs_data_node``) which store chunks of file
contents or inode nodes (`struct ubifs_ino_node`) which represent VFS inodes. contents or inode nodes (``struct ubifs_ino_node``) which represent VFS inodes.
Almost all types of nodes share a common header (`ubifs_ch`) containing basic Almost all types of nodes share a common header (``ubifs_ch``) containing basic
information like node type, node length, a sequence number, etc. (see information like node type, node length, a sequence number, etc. (see
`fs/ubifs/ubifs-media.h`in kernel source). Exceptions are entries of the LPT ``fs/ubifs/ubifs-media.h`` in kernel source). Exceptions are entries of the LPT
and some less important node types like padding nodes which are used to pad and some less important node types like padding nodes which are used to pad
unusable content at the end of LEBs. unusable content at the end of LEBs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment