Filesystems

From Alpine Linux
Revision as of 15:14, 12 September 2024 by Prabuanand (talk | contribs) (→‎Formatting Partitions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

Here are some examples on 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 data will be gone. Make a backup first if you are unsure.


btrfs-progs

# mkfs.btrfs /dev/sdaXY

dosfstools

# mkfs.vfat /dev/sdaXY

e2fsprogs

# mkfs.ext2 /dev/sdaXY

# mkfs.ext3 /dev/sdaXY

# mkfs.ext4 /dev/sdaXY

f2fs-tools

# mkfs.f2fs /dev/sdaXY

For creating partitions refer Manual partitioning