Disks

From Void Linux Wiki
Jump to: navigation, search

Overview

To create a succesful Void Linux installation on an empty drive, you must first create a partition table. This can either be MBR or GPT. Partitions and filesystems can be created either before the installation is launched from the Void Linux live CD, or as part of the installation process. Note that Void (on x86/x86_64) keeps old kernels around, this takes (at the very least) 20 MB per kernel version and they are stored in /boot, so plan accordingly. More than 20GB for / is probably a good amount for an expansive desktop installation. A swap partition is not strictly required, but recommended for systems with a low RAM size. See Swap below for more information.

It is recommended for BIOS users to have a Wikipedia-logo.png MBR partition table. Remember, MBR supports 4 partitions maximum, with upto 2 TiB per partition.

UEFI users are required to have a Wikipedia-logo.png GUID partition table (GPT). In this case, the maximum number of partitions is 128 and the largest partition size is 8ZiB.

Software Features
Cfdisk screenshot.png
Wikipedia-logo.png cfdisk
  • Create, alter and remove partitions
  • Installed on the Void Linux live CD
  • ncurses interface
Fdisk1.png
Wikipedia-logo.png fdisk
  • Create, alter and remove partitions
  • Command line interface
gptfdisk
  • Create, alter, remove, convert MBR to GPT and recreate partition tables from backup
  • Command line interface
GParted 0.18 GUID partition table.png
Wikipedia-logo.png gparted
  • Create, alter and remove partitions
  • Can be used as a live CD
  • Has a mouse driven, graphical interface
Wikipedia-logo.png parted
  • Create, alter, remove, check, copy partitions and filesystems
  • Command line interface

Swap

Amount of RAM in the system Recommended swap space Recommended swap space if allowing for hibernation
⩽ 2GB 2 times the amount of RAM 3 times the amount of RAM
> 2GB – 8GB Equal to the amount of RAM 2 times the amount of RAM
> 8GB – 64GB At least 4 GB 1.5 times the amount of RAM
> 64GB At least 4 GB Hibernation not recommended

Filesystems

Once partitions have been made, they will need to be formatted with filesystems. See below for a list of the mainly used filesystems. It is recomended to use one of the extended filesystems as they are very reliable and cover most use cases. Here is an example partition layout (note: if you are not sure if you need separate /boot, you probably don't):

Partition Size Filesystem Mount point
/dev/sda1 2M bios boot
/dev/sda2 128M ext2 /boot
/dev/sda3 59G ext4 /
/dev/sda4 512M swap swap

This is only an example layout used to demonstrate the use of different filesystems on a Void Linux system. An ext2 partition was used for /boot which is a partition that belongs to the GRUB boot loader. One reason you would use ext2 for the boot partition is because advanced features would not be needed here and could potentially cause problems with the bootloader. The / partition is ext4 because this is where most of the users data is stored and therefore journaling would be wanted to protect data. The last partition is swap, which is virtual memory stored on the drive. This would be used if the OS needs more RAM. Swap has its own filesystem which can be created using

# mkswap /dev/partition

Wikipedia-logo.png btrfs

A next generation filesystem that provides many advanced features such as snapshotting, self-healing through checksums, transparent compression, subvolumes and integrated RAID. A few distributions have begun to ship it as an out-of-the-box option, but it is not production ready. Reports of filesystem corruption are common. Its developers urge people to run the latest kernel version for safety because the older ones have known problems. This has been the case for years and it is too early to tell if things have changed. Fixes for corruption issues are rarely backported to older kernels. Proceed with caution when using this filesystem!

# mkfs.btrfs /dev/partition

Wikipedia-logo.png ext2

This is the tried and true Linux filesystem but doesn't have metadata journaling, which means that routine ext2 filesystem checks at startup time can be quite time-consuming. There is now quite a selection of newer-generation journaled filesystems that can be checked for consistency very quickly and are thus generally preferred over their non-journaled counterparts. Journaled filesystems prevent long delays when the system is booted and the filesystem happens to be in an inconsistent state.

# mkfs.ext2 /dev/partition

Wikipedia-logo.png ext3

The journaled version of the ext2 filesystem, providing metadata journaling for fast recovery in addition to other enhanced journaling modes like full data and ordered data journaling. It uses an HTree index that enables high performance in almost all situations. In short, ext3 is a very good and reliable filesystem.

# mkfs.ext3 /dev/partition

Wikipedia-logo.png ext4

Initially created as a fork of ext3, ext4 brings new features, performance improvements, and removal of size limits with moderate changes to the on-disk format. It can span volumes up to 1 EB and with maximum file size of 16TB. Instead of the classic ext2/3 bitmap block allocation ext4 uses extents, which improve large file performance and reduce fragmentation. Ext4 also provides more sophisticated block allocation algorithms (delayed allocation and multiblock allocation) giving the filesystem driver more ways to optimize the layout of data on the disk. Ext4 is the recommended all-purpose all-platform filesystem.

# mkfs.ext4 /dev/partition

Wikipedia-logo.png jfs

IBM's high-performance journaling filesystem. JFS is a light, fast and reliable B+tree-based filesystem with good performance in various conditions.

# mkfs.jfs /dev/partition

Wikipedia-logo.png reiserfs

A B+tree-based journaled filesystem that has good overall performance, especially when dealing with many tiny files at the cost of more CPU cycles. ReiserFS appears to be less maintained than other filesystems.

# mkreiserfs /dev/partition

Wikipedia-logo.png xfs

A filesystem with metadata journaling which comes with a robust feature-set and is optimized for scalability. XFS seems to be less forgiving to various hardware problems.

# mkfs.xfs /dev/partition

Wikipedia-logo.png vfat

Also known as FAT32, it is supported by Linux but does not support any permission settings. It is mostly used for interoperability with other operating systems (mainly Windows) but it is also a necessity for some system firmware (like UEFI).

# mkfs.vfat /dev/partition