Difference between revisions of "Install/Creating Filesystems"

From Funtoo
Jump to navigation Jump to search
m (note that ext2 is a fine file system choice since ext4 came out with it's fast fsck.)
(fix ext2 to be a ROOT example, migrate everyone to vfat UEFI compatible /boot)
Line 3: Line 3:
== Creating Filesystems == <!--T:1-->
== Creating Filesystems == <!--T:1-->
</includeonly><noinclude><languages/>
</includeonly><noinclude><languages/>
= Install Guide: Creating Filesystems =
== Install Guide: Creating Filesystems ==


<!--T:2-->
<!--T:2-->
Line 9: Line 9:


<!--T:15-->
<!--T:15-->
{{Note|This section covers both legacy BIOS ''and'' UEFI installs. Don't skip it!}}
{{Note|This section covers both BIOS ''and'' GPT installs. Don't skip it!}}


<!--T:3-->
<!--T:3-->
Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.  We are labeling our filesystems for LABEL= /etc/fstab statements.
Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.  We are labeling our filesystems for LABEL= /etc/fstab statements.
<!--T:4-->
Are you using legacy only MBR partitions? If so, let's create an ext2 filesystem on {{f|/dev/funtoo1}}:
<!--T:5-->
{{console|body=###i## mkfs.ext2 /dev/funtoo1
###i## e2label /dev/funtoo1 "BOOT"}}


<!--T:6-->
<!--T:6-->
If you're using GPT partitions for UEFI, or installing for Raspberry Pi, you'll want to create a vfat filesystem on your first partition. This will be {{c|funtoo1}} in the case of Raspberry Pi:
Everyone ''NEEDS'' to create a vfat filesystem on your first partition.


<!--T:7-->
<!--T:7-->
Line 69: Line 62:
<!--T:11-->
<!--T:11-->
{{console|body=###i## mkfs.ext4 /dev/funtoo3
{{console|body=###i## mkfs.ext4 /dev/funtoo3
###i## e2label /dev/funtoo3 "FUNTOO"}}
<!--T:4-->
Here's how to create a ext2 root filesystem, if you prefer to use ext2 instead of ext4:
<!--T:5-->
{{console|body=###i## mkfs.ext2 /dev/funtoo3
###i## e2label /dev/funtoo3 "FUNTOO"}}
###i## e2label /dev/funtoo3 "FUNTOO"}}


<!--T:12-->
<!--T:12-->
Here's how to create a JFS root filesystem, if you prefer to use JFS instead of ext4:
Here's how to create a JFS root filesystem, if you prefer to use JFS instead of ext2:
{{console|body=
{{console|body=
###i## mkfs.jfs /dev/funtoo3
###i## mkfs.jfs /dev/funtoo3
Line 79: Line 80:


<!--T:13-->
<!--T:13-->
Here's how to create a XFS root filesystem, if you prefer to use XFS instead of ext4:
Here's how to create a XFS root filesystem, if you prefer to use XFS instead of JFS:
{{console|body=###i## mkfs.xfs /dev/funtoo3
{{console|body=###i## mkfs.xfs /dev/funtoo3
###i## xfs_admin -L "FUNTOO" /dev/funtoo3}}
###i## xfs_admin -L "FUNTOO" /dev/funtoo3}}

Revision as of 13:42, December 9, 2020

Other languages:

Install Guide: Creating Filesystems

Install Guide, Chapter 5 < Prev Next >
   Note

This section covers both BIOS and GPT installs. Don't skip it!

Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem metadata. This process is known as creating a filesystem on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files. We are labeling our filesystems for LABEL= /etc/fstab statements.

Everyone NEEDS to create a vfat filesystem on your first partition.

root # mkfs.vfat -F 32 /dev/funtoo1
root # fatlabel /dev/funtoo1 "BOOT"

Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.

You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the mkswap command. Then we'll run the swapon command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:

root # mkswap /dev/funtoo2
root # swaplabel -L "SWAP" /dev/funtoo2
root # swapon /dev/funtoo2

Root Filesystem

Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4, JFS, or XFS root filesystems. ext2 doesn't have journaling, so it's a good choice for flash media, but more likely to lose data upon power failure. Keep in mind that some filesystems will require additional filesystem tools to be emerged prior to rebooting. Please consult the following table for more information:

FilesystemRecommended as root file system?Additional tools required to emerge
ext4YesNone
ext2YesNone
JFSYessys-fs/jfsutils
XFSYessys-fs/xfsprogs
reiserfsYes -- will likely need to enable kernel supportsys-fs/reiserfsprogs
zfsNo - advanced users onlysys-fs/zfs
btrfsNo - advanced users onlysys-fs/btrfs-progs
   Important

We do not recommend users set up ZFS or BTRFS as their root filesystem. This is much more complex and usually not necessary. Instead, choose ext4, ext2, jfs, or xfs. We do support ZFS or BTRFS as non-root filesystems and this is much, much easier to configure. See ZFS and BTRFS after you are done setting up your Funtoo Linux system to configure ZFS or BTRFS for additional secondary storage.

If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:

root # mkfs.ext4 /dev/funtoo3
root # e2label /dev/funtoo3 "FUNTOO"


Here's how to create a ext2 root filesystem, if you prefer to use ext2 instead of ext4:

root # mkfs.ext2 /dev/funtoo3
root # e2label /dev/funtoo3 "FUNTOO"

Here's how to create a JFS root filesystem, if you prefer to use JFS instead of ext2:

root # mkfs.jfs /dev/funtoo3
root # jfs_tune -L "FUNTOO" /dev/funtoo3

Here's how to create a XFS root filesystem, if you prefer to use XFS instead of JFS:

root # mkfs.xfs /dev/funtoo3
root # xfs_admin -L "FUNTOO" /dev/funtoo3

Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.

Additional Filesystems

   Note

This can be very useful for Raspberry Pi systems!

You may want to create additional partitions for various parts of your Funtoo filesystem tree. It is not uncommon to place /home or /var on separate rotating disks as seen on /dev/sda1 in the drive targeting example.

For Raspberry Pi, you may not have a lot of spare room on the card depending on the capacity of your microSD card, and it may make a lot of sense to put the entire /var filesystem on an external hard drive or solid state disk. This will not only ensure you don't run out of disk space, but can also improve performance since writes to the microSD card typically aren't that fast.

To do this, you will want to use fdisk or gdisk to create a partition on your external drive, and then use the mkfs.xfs or mkfs.ext4 commands to create a filesystem on the new partition. We will mount this new filesystem in the next step prior to extracting the stage3 tarball.

Install Guide, Chapter 5 < Prev Next >