Auto-Mounting Secondary Drives

WARNING!

Attention: You may lose data on the drive(s) or result in an unbootable system if configured improperly.

Note: MicroSD cards automatically mount without any manual intervention required on Bazzite.

Important: Do not use the NTFS, exFAT, or FAT32 filesystems for game library storage.

Follow this guide at your own discretion and make sure to read the entire document relevant to your method, so you do not miss anything!


Formatting a disk

Warning: This will wipe all existing data on it

Note when formatting in KDE Partition Manager

Make sure you set permissions to everyone.

Use a disk graphical user interface like KDE Plasma or GNOME Disks to format your drive. We recommend formatting secondary drives to BTRFS or Ext4. BTRFS is our recommended filesystem, but Ext4 may be better for older spinning mechanical HDDs as secondary drives.

Creating a secondary drive directory and where to mount drives?

Note: Drive directories should be lowercase with no spaces for best practice.

Attention: /var/mnt should NOT be the path, but create a new directory in either /var/mnt or /var/run/media/.

  • /var/mnt/... for permanent drives
  • /var/run/media/... for removable drives

You can make a directory in /var/mnt/ by opening a host terminal and entering this command in a host terminal:

cd /var/mnt
sudo mkdir /var/mnt/games

The drive will now be mounted in a directory known as games.

Note: games can be named anything you desire that fits best practices.

Permissions for the drive

sudo chown $USER:$USER /var/mnt/games

Note: If you plan to reformat the partition, remember to edit the mount point and ā€œRemoveā€ the mount path before you reformat! If not you will have to manually edit /etc/fstab.

Graphical User Interface (GUI) Methods for Auto-Mounting

Warning: Do not set up auto-mount, unmount then format a drive! It can confuse the software you are configuring drives with. Instead, remove the auto-mount first before formatting the drive.

Alternative Methods (CLI)

There are also two command-line interface (CLI) methods.

  1. Using systemd.mount

  2. Editing the /etc/fstab file

Command Line Interface methods are intended for advanced users, and it is recommended to research one of the two methods outside of this documentation.


Emergency Mode After Mounting?

This video tutorial shows how to recover from your mounting mistakes.


Documentation Contributors: HikariKnight and asen23

ā† View all Bazzite documentation

5 Likes

I think the ext4 mount options may need to be amended from errors=ro to errors=remount-ro. Just hit this issue myself.

2 Likes

Thanks, I fixed it now.

Iā€™ve been attempting to reformat my drives(with data from windows) and when I go to remove the mount point on a partition, KDE partition manager just crashes. I tried googling it and I couldnā€™t finding anything.

Any help would be greatly appreciated, thank you

You can try installing gparted with rpm-ostree install gparted.

Alternatively, you can try manually editing the file system table with sudo nano -B /etc/fstab (the -B is for backup). Just put in UUID=<UUID> <mount-point> btrfs defaults 0 0 should be fine.

You can look up on ChatGPT or read the Arch Wiki for how to format and mount partitions by their UUID from terminal. Keep everything as default, just adjust the UUID and mount point.

(I personally prefer mount point at home at ~/Storage/<folder-name> but thatā€™s just personal preference - more commonly, you mount at rootā€™s /mnt/ as mounting in /media/ makes it treated as removable drives.)

Iā€™m very new to Linux, and this is, more or less, my first distro. So I was wondering, what type of file is a mount point? Is it a folder? A text file?

In short, mount point is where you tell Linux is the ā€˜startā€™ of your partition. What ā€œmountingā€ does is to tell the system ā€œhey, I want folder A (mount-point) to actually access folder Bā€.

The mounting process is basically like plugging a flash drive, telling it to use E: instead of other letters, and then telling the PC that yes you want to be able to edit files from that flash drive.

Details

In detail: in Linux, we donā€™t have C: or D: drive/partition - everything starts from / which is why itā€™s called ā€˜rootā€™. And, in a way, everything is a folder or a file in Linux, we just need it translated into something we can use.

In this case, the system actually already have all your drives and partitions in /dev folder. Itā€™s just that, without the right settings and configuration, the system never bothers exposing it to the user or even allowing the user to read/write the partition.

Now, you can do a mount command to manually make it usable, but we also have the /etc/fstab file which automates the process at boot*. In addition to where itā€™s pointed at, you can also define other behaviors for the device (say, you donā€™t want user to be able to have write access, or for it to not update file access records).

*be aware that misconfiguring the file will prevent the system to boot to your graphical session - this can be fixed pressing Ctrl + D (or whatever it tells you to do) to become root user (Admin, Super User) and then doing nano /etc/fstab to edit the file. You can then reboot.

If you DO want to edit fstab manually, read up the Arch wiki link I gave, and make sure you can unmount & remount the partition in FIle Manager before you reboot.

All this is to say that: since youā€™re very very new, ignore my advice about editing /etc/fstab; just follow the guide and:

  1. Make a folder either at /mnt, or somewhere in /home/$USER.
  2. Use gparted or KDE partition manager. If one doesnā€™t work, you can install the other.
  3. Right click partition, choose mount point or mount options (or something to that effect - forgot the exact name).
  4. After youā€™ve put in the the folder to mount it at, right click the partition, choose mount
  5. Open file manager, go to the mount folder. You can check if itā€™s mounted by:
    a.) the icon in the left sidebar showing mounted folders;
    b.) look at bottom right for free space - it should automatically adjust when youā€™re in a mounted folder
  6. If itā€™s mounted right, then do a sudo chown -Rv $USER:$USER /path/to/mount-point to make sure you have ownership of all its files and folders.

I appreciate these instructions, I followed the kde partition manager instructions, ran

sudo systemctl daemon-reload && sudo mount -a

Then I got the output of

mount: /var/mnt/1tbsata: fsconfig system call failed: ext4: Unexpected value for ā€˜discardā€™.
dmesg(1) may have more information after failed mount system call.

So what now? Where do I find dmesg(1)

Update: Iā€™m seeing the issue may be with the discard=async that was one of the ā€œmoreā€ commands?

Yeah that is removed from the docs. Thanks for pointing that out.

What should I put instead?

I edited the btrfs arguments. everything but that discard=async portion.

Did this for a TB4 nvme drive and permissions seem solid but I canā€™t add the drive in steam itself as a location. I can copy game folders to the external drive which is mounted at /var/media/ext-games/ at fast speeds but steam canā€™t use it at all. This is all in the desktop not game mode.

In game mode it sees the new external TB4 drive but says I have to format it. I figured formatting again in game mode probably a bad idea.

Help?

Make sure the exec permission is the last one in your fstab entry.

What your describing is one of the many ways my issue manifested.: Automount not providing exec despite fstab flag and user perms?

Steam tries to run a script on every mounted device to check for appropriate privileges. If it doesnā€™t have exec it wonā€™t present the library as a valid option, meanwhile If exec is not the last option in your fstab it can be overridden by some other option.

1 Like

There was a ā€œnoatimeā€ and some other command last in fstab I switched to make sure ā€œexecā€ was last and it still didnā€™t work initially. But then created a new folder on the external drive called steam and changed permissions in the gui so everyone had RWX and when I navigated back to the storage tab in steam settings it popped up a dialogue to add the new external ssd to the library list. But weirdly it created its own SteamLibrary folder in the root of the mount point. Odd but I guess this did it!

Follow on question. This only works in desktop not gaming mode? Iā€™m moving some games fast here being I have a TB3 enclosure! Instead of buying some big new internal drive I can quickly offload or onload games which is great on my legion go.

Edit it works fine in game mode. This is amazing given I already had a thunderbolt enclosure and 1tb ssd laying around. No longer tempted to buy a very expensive 2tb 2230 nvme.

Edit2: guess it does NOT remount well in game mode though

Old Info in here, no longer valid

defaults for btrfs is not ideal hence why we provide the options we suggest

:slight_smile:

the automount only happen at boot time, to mount after boot you will have to go into desktop, mount then back to gamemode

or find a way to run sudo mount -a inside gamemode
that command will mount all drives defined in /etc/fstab

is there a way to make a ā€œgameā€ that runs this terminal command that can be executed in game mode? Otherwise itā€™s not a huge deal to switch to desktop and then back to game mode.

The other issue Iā€™m seeing is some weird game mode analysis of the external driveā€™s free space, it will report a lot of ā€œnon-steamā€ game space that may be temporary files, or something else. For example last night I installed 400GB of steam games to my 1TB external SSD (over a TB3 enclosure) and it showed nearly the same amount of ā€œnon-steamā€ space being taken up. I had to go to desktop mode, and then back to game mode to get it to report this correctly (there should be ~0GB taken up by non-steam stuff).

for the 1st thing, i know how to do it with konsole on kde
make a non-steam game shotcut in desktop mode and add this as the values
TARGET: env
START IN: ./
LAUNCH OPTIONS: env -u LD_PRELOAD konsole --fullscreen --notransparency -e /path/to/script

for the 2nd point, its how steam handles it, not something we can change

1 Like

Should the mount point in /var/mnt/extgames (my choice there at the end) be showing a size when opened in Dolphin? My primary drive is showing over 224GB of non-steam content when before I used this external drive it was 70GB (for some offline games I have). And my extgames folder is showing 124.1GB of used space on the primary drive, whereas the actual external drive is more like 431.8GB of games on it. Why am I losing 124.1GB of space on my primary drive??

EDIT: This is just weird, my home drive in /var/home is 587.5GB, but my internal drive is 755GB, and my primary drive is saying it has 41GB of space left. I canā€™t account for where that extra 100+GB is in the rest of the VAR folder. It is exactly the 124.1GB of space that the /var/mnt/extgames folder reported. Did I miss doing some subvolume mount or something in the advanced section??

EDIT2: This is getting completely Fā€™d up. Now in game mode both the internal and attached SSD are showing 41.2GB remaining, even though they show different games. Iā€™ve also lost games that were transferred across from primary to this external drive. At this point Iā€™m afraid of losing data and it looks like I just need to take the plunge on buying the internal drive. :frowning:

EDIT3: After some time passes in desktop its like the external drive cleans up its act and I can see all the transferred games, but Iā€™m still missing 124.1GB of space on the primary drive and I donā€™t know how to get it back.