Filesystems: Difference between revisions

From Alpine Linux
(Moved swap from Setting_up_disks_manually page)
(created a wiki table)
Line 4: Line 4:


Alpine has multiple storage media formatting packages available. Different packages/programs are used to format different types of filesystems.
Alpine has multiple storage media formatting packages available. Different packages/programs are used to format different types of filesystems.
* {{Pkg|btrfs-progs}} - For [[Btrfs]]
 
* {{Pkg|dosfstools}} - For FAT12/FAT16/FAT32
{| cellpadding="5" border="2" class="wikitable"
* {{Pkg|e2fsprogs}} - For ext3/ext4
|-
* {{Pkg|f2fs-tools}} - For [[F2FS]]
! Tool
* {{Pkg|jfsutils}} - For JFS
! Filesystem
* {{Pkg|ntfs-3g}} - For NTFS (Note: ntfs-3g is a FUSE driver)
! Brief Notes
* {{Pkg|xfsprogs}} - For XFS
|-
| {{Pkg|btrfs-progs}}
|[[Btrfs]]
|
|-
|{{Pkg|dosfstools}}  
|FAT12/FAT16/FAT32
|
|-
|{{Pkg|e2fsprogs}}  
|ext2/ext3/ext4
|ext4 is current default
|-
|{{Pkg|f2fs-tools}}  
|[[F2FS]]
|
|-
|{{Pkg|hfsprogs}}
|XFS HFS/HFS+
|Apple/Mac products
|-
|{{Pkg|jfsutils}}  
|JFS
|-
|{{Pkg|ntfs-3g}}  
|NTFS  
|Microsoft/Windows FUSE driver
|-
|{{Pkg|xfsprogs}}  
|XFS
|
|}


== Formatting Partitions ==
== Formatting Partitions ==

Revision as of 15:35, 4 October 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.

Tool Filesystem Brief Notes
btrfs-progs Btrfs
dosfstools FAT12/FAT16/FAT32
e2fsprogs ext2/ext3/ext4 ext4 is current default
f2fs-tools F2FS
hfsprogs XFS HFS/HFS+ Apple/Mac products
jfsutils JFS
ntfs-3g NTFS Microsoft/Windows FUSE driver
xfsprogs XFS

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

swap Partition

  1. mkswap /dev/sda2
  2. echo -e "/dev/sda2 none swap sw 0 0" >> /mnt/etc/fstab
  3. swapon /dev/sda2 (or rc-service swap start)

free -m

will show how much swap space is available (in MB).

If you prefer maximum speed, you don't need configure any raid devices for swap. Just add 2 swap partitions on different disks and linux will stripe them automatically. The downside is that the moment one disk fails, the system will go down. For better reliability, put swap on RAID1.

Todo: Instructions for cryptswap?


For creating partitions refer Manual partitioning