Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2020-01-29 21:29:26
Size: 1915
Comment:
Revision 11 as of 2021-11-18 08:28:13
Size: 2069
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= File System = = File Systems =
Line 3: Line 3:
File systems are standards for organizing, maintaining, and accessing data on a disk drive. This will ''not'' be a crosswalk of file systems. '''File systems''' are protocols for the organization of data. Compared to commercial operating systems, Linux is compatible with a large number of file systems.

See [[Linux/PartitionTables|here]] for creating a partition table.

<<TableOfContents>>
Line 9: Line 13:
== Managing File Systems == == Setup ==
Line 11: Line 15:
---- Devices are referenced as `sdXN`, where `X` is the relevant interface letter and `N` is the relevant partition number.
Line 15: Line 19:
=== fstab ===

On a Linux system, `/etc/fstab` informs on what drives should be mounted and with what options. This configuration file is structured as:

{{{
# <device> <dir> <type> <options> <dump> <fsck>
UUID=f9fe0b69-a280-415d-a03a-a32752370dee none swap defaults 0 0
}}}

Spacing between columns is arbitrary. The `<dir>` column is the mount point, while the `<type>` column indicates file system type.

The `<fsck>` column is used by the `fsck` utility, and enables boot-time filesystem checks.
 * `0` disables checks.
 * `1` runs corrections based on checks. This is important for the root device.
 * `2` forces reboot on error.

The `<options>` column can contain any of: `noatime` (do not write access times), `noauto` (do not wait on `fsck`), `nofail` (do not indicate errors if unavailable), and so on.

The `<dump>` column is used by the `dump` utility--if you don't need that utility (and most people don't), set it to `0`.

----



== Creating File systems ==

----



=== ext2 ===
=== ext2 and ext3 ===
Line 48: Line 22:

----



=== ext3 ===

Seriously. Don't.

----
Line 63: Line 27:
If you are creating ext4 file systems, you probably are using Linux. Therefore, let's assume you have the Linux toolset available.

Running as superuser:
Run as superuser:
Line 68: Line 30:
 # mkfs.ext4 /dev/sde1 mkfs.ext4 /dev/sdXN
Line 75: Line 37:
/dev/sda5 /var ext4 defaults,noatime 0 0 /dev/sdXN /var ext4 defaults,noatime 0 0
Line 77: Line 39:



=== FAT32 ===

The main advantage to FAT32 is it near-universal mount-ability. (Expect issues on a vanilla macOS environment!) The cost is performance, instability, and incompatibility with standard Linux file metadata.

Run as superuser:

{{{
mkfs.vfat /dev/sdXN
}}}



=== MS-DOS ===

Run as superuser:

{{{
mkdosfs /dev/sdXN
}}}

But you should also know that `mkdosfs` is a symlink to `mkfs.vfat`.

----



== Usage ==

A file system is used by mounting it as a disk.



=== mount ===

To manually mount a volume, try:

{{{
mount /dev/sdXN /mnt/DIR
}}}

You may need to specify the file system type, using the `--types FSTYPE` option.

If you run into persistent errors, try `fsck /dev/sdXN` to check for file system errors.



=== udisksctl ===

'''udisksctl''' wraps the `udisks` utility to aids in mounting devices.

Run `udisksctl status` to see an overview of all devices. A volume can be mounted or unmounted using `udiscksctl mount -b /dev/sdXN` and `udiscksctl unmount -b /dev/sdXN`,



=== fstab ===

The standard way to mount disks on startup is the '''fstab''' file. See [[Linux/fstab|here]] for details.

File Systems

File systems are protocols for the organization of data. Compared to commercial operating systems, Linux is compatible with a large number of file systems.

See here for creating a partition table.


Setup

Devices are referenced as sdXN, where X is the relevant interface letter and N is the relevant partition number.

ext2 and ext3

Don't.

ext4

Run as superuser:

mkfs.ext4 /dev/sdXN

Consider disabling access time on secondary and storage drives. Setting this metadata isn't always helpful and carries a speed cost.

# <device>                                <dir> <type> <options>        <dump> <fsck>
/dev/sdXN                                 /var  ext4   defaults,noatime 0      0

FAT32

The main advantage to FAT32 is it near-universal mount-ability. (Expect issues on a vanilla macOS environment!) The cost is performance, instability, and incompatibility with standard Linux file metadata.

Run as superuser:

mkfs.vfat /dev/sdXN

MS-DOS

Run as superuser:

mkdosfs /dev/sdXN

But you should also know that mkdosfs is a symlink to mkfs.vfat.


Usage

A file system is used by mounting it as a disk.

mount

To manually mount a volume, try:

mount /dev/sdXN /mnt/DIR

You may need to specify the file system type, using the --types FSTYPE option.

If you run into persistent errors, try fsck /dev/sdXN to check for file system errors.

udisksctl

udisksctl wraps the udisks utility to aids in mounting devices.

Run udisksctl status to see an overview of all devices. A volume can be mounted or unmounted using udiscksctl mount -b /dev/sdXN and udiscksctl unmount -b /dev/sdXN,

fstab

The standard way to mount disks on startup is the fstab file. See here for details.


CategoryRicottone

Linux/FileSystems (last edited 2023-07-19 15:07:39 by DominicRicottone)