Filesystems: Difference between revisions

From Alpine Linux
(rearranged headings to move ext4 in front)
Line 16: Line 16:
Whenever a partition is [[Setting_up_disks_manually#Manual_partitioning|created]], the partition must be formatted first before using it.  Depending on the filesystem to be used, the necessary [[Filesystems#Filesystem_Tools|formatting tool]] for the filesystem must be installed first. The various formatting tools like <code> mkfs.ext4</code>, <code>mkfs.vfat</code>, <code>mkfs.btrfs</code> are part of file system tools {{pkg|dosfstools|repo=main}}, {{pkg|e2fsprogs|repo=main}}, {{pkg|btrfs-progs|repo=main}}.  Install the [[Filesystems#Filesystem_Tools|filesystem tools]] first, if not done already.
Whenever a partition is [[Setting_up_disks_manually#Manual_partitioning|created]], the partition must be formatted first before using it.  Depending on the filesystem to be used, the necessary [[Filesystems#Filesystem_Tools|formatting tool]] for the filesystem must be installed first. The various formatting tools like <code> mkfs.ext4</code>, <code>mkfs.vfat</code>, <code>mkfs.btrfs</code> are part of file system tools {{pkg|dosfstools|repo=main}}, {{pkg|e2fsprogs|repo=main}}, {{pkg|btrfs-progs|repo=main}}.  Install the [[Filesystems#Filesystem_Tools|filesystem tools]] first, if not done already.


Here are some examples on how to use the formatting tools for different filesystems:
The following examples show how to use the formatting tools for different filesystems:


{{Warning|The {{Path|/dev/sdXY}} is only an example. Make sure you choose the right partition to format!  If you choose the wrong partition, your data will be gone. Make a backup first if you are unsure.}}
{{Warning|The {{Path|/dev/sdXY}} is only an example. Make sure you choose the right partition to format!  If you choose the wrong partition, your will lose your data. Make a backup first and do not proceed, if you are unsure.}}
 
=== e2fsprogs ===
ext4 is the default filesystem in Alpine Linux.
{{Cmd|# mkfs.ext4 /dev/sdaXY}}


=== btrfs-progs ===
=== btrfs-progs ===
Line 25: Line 29:
=== dosfstools ===
=== dosfstools ===
{{Cmd|# mkfs.vfat /dev/sdaXY}}
{{Cmd|# mkfs.vfat /dev/sdaXY}}
=== e2fsprogs ===
{{Cmd|# mkfs.ext2 /dev/sdaXY}}
{{Cmd|# mkfs.ext3 /dev/sdaXY}}
{{Cmd|# mkfs.ext4 /dev/sdaXY}}


=== f2fs-tools ===
=== f2fs-tools ===

Revision as of 07:49, 25 September 2024

Alpine Linux supports a number of filesystems.

Filesystem Tools

Alpine has multiple storage media formatting packages available. Different packages/programs are used to format different types of filesystems.

Formatting Partitions

Whenever a partition is created, the partition must be formatted first before using it. Depending on the filesystem to be used, the necessary formatting tool for the filesystem must be installed first. The various formatting tools like mkfs.ext4, mkfs.vfat, mkfs.btrfs are part of file system tools dosfstools, e2fsprogs, btrfs-progs. Install the filesystem tools first, if not done already.

The following examples show how to use the formatting tools for different filesystems:

Warning: The /dev/sdXY is only an example. Make sure you choose the right partition to format! If you choose the wrong partition, your will lose your data. Make a backup first and do not proceed, if you are unsure.


e2fsprogs

ext4 is the default filesystem in Alpine Linux.

# mkfs.ext4 /dev/sdaXY

btrfs-progs

# mkfs.btrfs /dev/sdaXY

dosfstools

# mkfs.vfat /dev/sdaXY

f2fs-tools

# mkfs.f2fs /dev/sdaXY

For creating partitions refer Manual partitioning