Storage

Table of Contents

1. Description

Configuring a new storage disk and adding it to /etc/fstab

2. Create a new ext4 storage disk

2.1. Make sure the disk is not mounted

To add a new drive as storage on Linux, first use one of these commands to check if the device (sda in this example) is mounted

lsblk
findmnt
mount | grep "sda"

2.2. Unmount the drive if its mounted

sudo umount /dev/sda1

2.3. Create a new partition table

sudo fdisk /dev/sda

fdisk commands (m for help):

  1. p Print the current partition table
  2. g Create a new empty GPT partition table
  3. n Add a new partition
  4. Press RET to use the default x3 (“partition number”, “first sector”, “last sector”)
  5. Type Y if it ask about existing partitions on the disk (nothing is final until the w command)
  6. w Write the changes

2.4. Format the partition with ext4

sudo mkfs.ext4 /dev/sda1

3. Configure the mount point

3.1. Create the mount point directory

/mnt/storage as an example

sudo mkdir /mnt/storage

3.2. Changing permissions might be necessary

sudo chown -c "$USER:" /mnt/storage

3.3. (test) Temporarily mount the drive

Mount sda1 to the mount point directory

sudo mount /dev/sda1 /mnt/storage

Make sure sda1 has /mnt/storage as mount point

lsblk

Unmount the drive

sudo umount /dev/sda1

4. Configure the /etc/fstab file

4.1. Find the drive UUID

lsblk -f

4.2. Add the device

Backup the original file beforehand

sudoedit /etc/fstab

The mount(8) manual has a section about the mount options under FILESYSTEM-INDEPENDENT MOUNT OPTIONS

# <file system>  <mount point> <type> <options> <dump> <pass>
UUID=ba13a47f-c3a5-4821-b60f-c40418666b46 /mnt/storage ext4 rw,nosuid,nodev,nofail 0 0

4.3. Check for any errors

Make sure the mount command does not return any errors

sudo mount -a

Check if the drive was successfully mounted

mount | grep "storage"

5. Adding storage to Steam

Settings > Downloads > Steam Library Folders

6. References