Disk ownership issues

I have a SSD I am wanting to use for installing games in both windows and linux

I am trying to get the disk usable in Linux. I am able to format the disk to exfat using KDE partition manager.

I created a mount point

sudo mkdir /media/2tbgamessd

I changed ownership so it would belong to me and not root

sudo chown jason:jason /media/2tbgamessd

This successfully showed me as owner.

When I mount the drive, it changes over to being owned by root. I want the mount to be owned by me. Running windows games in steam doesn’t work when they are installed with root file/folder ownsership.

Here’s the fstab entry that was made with KDE Partition manager:

UUID=DC9C-9F7E                              /media/2tbgamessd   exfat   defaults            0 0

Once the disk is mounted, it says I can’t change ownership from root to me.

chown: changing ownership of '2tbgamessd': Operation not permitted

What am I doing wrong?

Thanks

Jason

Nothing

exfat is permissionless

When mounting in fstab it will be mounted by root.

if you look at the permissions you will see that the mountpoint is rwx to the world

ls -l /media

EDIT

I have done some testing and it appears the mountpoint changes behavior when mounting an exfat filesystem.

The file system itself is indeed permissionless but the kernel applies root permissions to the mount point when mounting from fstab.

I will investigate this behavior further.

I have created a test device (USB stick) with three (3) partitions

 $ lsblk -f /dev/sdk
NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sdk                                                                           
├─sdk1 exfat  1.0   exfat 7DF7-F829                                           
├─sdk2 ntfs         ntfs  4D3BA1DD5DCEC625                                    
└─sdk3 btrfs        btrfs e2d5d06a-5769-4abc-b664-3da8ce2c0d17                

A folder structure /media with three (3) folders

 $ ls -l /media
total 0
drwxr-xr-x 1 root root 0 nov 29 06:13 btrfs
drwxr-xr-x 1 fh   fh   0 nov 29 06:13 exfat
drwxr-xr-x 1 root root 0 nov 29 06:13 ntfs

Mounting the partition using sudo mount results in a mountpoint owned by root

 $ sudo mount /dev/disk/by-label/exfat /media/exfat

 $ ls -l /media
total 32
drwxr-xr-x 1 root root     0 nov 29 06:13 btrfs
drwxr-xr-x 2 root root 32768 nov 29 07:03 exfat
drwxr-xr-x 1 root root     0 nov 29 06:13 ntfs

Mounting using mount options passing the $UID results in a mountpoint owned by fh and group root

 $ sudo mount -t exfat -o uid=$UID /dev/sdk1 /media/exfat

 $ ls -l /media
total 32
drwxr-xr-x 1 root root     0 nov 29 06:13 btrfs
drwxr-xr-x 2 fh   root 32768 nov 29 06:51 exfat
drwxr-xr-x 1 root root     0 nov 29 06:13 ntfs

If this still present an issue with Wine - one can add the $UID as argument for gid (Manjaro Linux creates a group with the same name and id as the first user)

Or one could use the gid for the system group users which is usually 984

 $ sudo mount -t exfat -o uid=$UID,gid=984 /dev/sdk1 /media/exfat

 $ ls -l /media
total 32
drwxr-xr-x 1 root root      0 nov 29 06:13 btrfs
drwxr-xr-x 2 fh   users 32768 nov 29 07:10 exfat
drwxr-xr-x 1 root root      0 nov 29 06:13 ntfs

Hi @saltymedic

@linux-aarhus is correct.

You should be able to test access to the exfat drive simply by copying a file to it. If for some reason that doesn’t work as expected, perhaps there is a non-permissions-related error in the respective fstab line.
If you post the content of fstab I’m sure someone will correct it for you, if this might be the case:

cat /etc/fstab

Thank you both for replying

As requested by @soundofthunder, here’s the contents of the fstab:

# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=1490-61EC                              /boot/efi           vfat    noatime             0 2
UUID=bf509221-e254-420f-8a9a-4d0d84c2d9e3   /home               ext4    noatime             0 2
UUID=268b5253-6dd5-40d3-bb88-f37a37970b59   swap                swap    noatime             0 2
UUID=db525330-7a55-463e-bf5a-f3eab46b40d5   /                   ext4    noatime,discard     0 1
tmpfs                                       /tmp                tmpfs   noatime,mode=1777   0 0
UUID=DC9C-9F7E                              /media/2tbgamessd   exfat   defaults            0 0

From what has happened previously

https://forum.manjaro.org/t/change-mounted-drive-ownership-problems/152267

There seems to be a permissions problem with me getting windows games to work in steam. Wine seems to not like the files/directories owned by root. I change the format of the drive from NTFS to EXFAT as suggested.

As @linux-aarhus pointed out, the mount point while showing owned by root is open to the world.

drwxrwxrwx 1 root root 131072 Nov 28 22:08 2tbgamessd

I tried installing a windows only game on the new SSD drive and it doesn’t load. When I install it in the drive for home, the game runs.

Now when I tell Steam to move the files back to the other installation area on the new SSD, it tells me there is a “disk write error”.

Apparently there is something with permissions and disk formats that I am not grasping fully.

Any ideas?

Thanks

Jason

What is the complete error that you receive, and does it appear to be generated by Steam, or Manjaro?

Have you tried manually copying your SteamLibrary contents to the new location? Naturally, you would need to first create the new SteamLibrary from within Steam; then fully close Steam.

Please see my edited comment above.

Wine complaining or outright refusing to use file system owned by root is unexpected but not a surprise - one could think of it as safety measure - as malware could spread.

Whether you use fstab or sudo to mount - it will always be mounted as root - this is inevitable.

When mounting you have the option of specifying a user and group to use when mounting.

This works with fstab or sudo mount but will effectively limit which user can access the filesystem.

If you are the sole user - then technically you could add your user id

echo $UID

Then use the value (on a single user Manjaro system - likely 1000)

... defaults,uid=VALUE ...

Save the change and

sudo systemctl daemon-reload
sudo mount -a

I suspect the discrepancy between your result and mine may be due to the kernel in use. My system use kernel 6.7-rc.

The UID came back as 1000. So did the GID. I changed the FSTAB line to this:

UUID=DC9C-9F7E      /media/2tbgamessd   exfat   defaults,uid=1000,gid=1000            0 0

I did sudo systemctl daemon-reload and sudo mount -a

This did not change the ownership. I then unmounted the drive and ran through those steps and then it showed it mounted with my user ID and group.

I am now able to let Steam move the game over from the home directory install to the SSD without it giving an error.

However, when I try to run the game from the SSD, it still doesn’t run. It will only run when it is installed on the home directory. Here’s what it shows when I run steam from command line:

/bin/sh\0-c\0/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=860890 -- /jason.directories/home.directories/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/jason/programs/games/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/jason.directories/home.directories/.local/share/Steam/steamapps/common/Proton - Experimental'/proton waitforexitandrun  '/media/2tbgamessd/linux steam games/steamapps/common/Factory Town/Factory Town.exe'\0
chdir "/media/2tbgamessd/linux steam games/steamapps/common/Factory Town"
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Proton: Upgrading prefix from None to 8.0-104 (/media/2tbgamessd/linux steam games/steamapps/compatdata/860890/)
Traceback (most recent call last):
  File "/jason.directories/home.directories/.local/share/Steam/steamapps/common/Proton - Experimental/proton", line 1738, in <module>
    g_session.init_session(sys.argv[1] != "runinprefix")
  File "/jason.directories/home.directories/.local/share/Steam/steamapps/common/Proton - Experimental/proton", line 1530, in init_session
    g_compatdata.setup_prefix()
  File "/jason.directories/home.directories/.local/share/Steam/steamapps/common/Proton - Experimental/proton", line 792, in setup_prefix
    self.migrate_user_paths()
  File "/jason.directories/home.directories/.local/share/Steam/steamapps/common/Proton - Experimental/proton", line 770, in migrate_user_paths
    os.symlink(src=link, dst=old)
OSError: [Errno 38] Function not implemented: '../AppData/Local' -> '/media/2tbgamessd/linux steam games/steamapps/compatdata/860890/pfx/drive_c/users/steamuser/Local Settings/Application Data'
Uploaded AppInterfaceStats to Steam

Then there is other issues at play - issues which I have no idea where to start

But judging from the last part of the message

OSError: [Errno 38] Function not implemented: It looks like the symlink implementation in Wine - perhaps, as I am guessing - doesn’t account for a path outside the home.

If you reconfigure your mount point to a media folder inside your home - what happens then?

Sorry that took so long

So I moved the mount point so that it is in my home directory.

/home/jason/2tbgamessd

It shows ownership as jason:jason

That didn’t seem to make a difference. The game still doesn’t load when the SSD is mounted in my home directory and the game in installed on the SSD.

/bin/sh\0-c\0/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=860890 -- /jason.directories/home.directories/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/jason/programs/games/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/jason/programs/games/steamapps/common/Proton - Experimental'/proton waitforexitandrun  '/home/jason/2tbgamessd/linux steam games/steamapps/common/Factory Town/Factory Town.exe'\0
chdir "/home/jason/2tbgamessd/linux steam games/steamapps/common/Factory Town"
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Proton: Upgrading prefix from None to 8.0-104 (/home/jason/2tbgamessd/linux steam games/steamapps/compatdata/860890/)
Traceback (most recent call last):
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 1738, in <module>
    g_session.init_session(sys.argv[1] != "runinprefix")
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 1530, in init_session
    g_compatdata.setup_prefix()
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 792, in setup_prefix
    self.migrate_user_paths()
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 770, in migrate_user_paths
    os.symlink(src=link, dst=old)
OSError: [Errno 38] Function not implemented: '../AppData/Local' -> '/home/jason/2tbgamessd/linux steam games/steamapps/compatdata/860890/pfx/drive_c/users/steamuser/Local Settings/Application Data'
Uploaded AppInterfaceStats to Steam

And now when I try to run the game from the other physical drive that my other home directory is installed on, it no longer runs when it did before. I have no idea how that changed.

/bin/sh\0-c\0/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=860890 -- /jason.directories/home.directories/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/jason/programs/games/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/jason/programs/games/steamapps/common/Proton - Experimental'/proton waitforexitandrun  '/jason.directories/home.directories/.local/share/Steam/steamapps/common/Factory Town/Factory Town.exe'\0
chdir "/jason.directories/home.directories/.local/share/Steam/steamapps/common/Factory Town"
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/jason.directories/home.directories/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Proton: Upgrading prefix from None to 8.0-104 (/jason.directories/home.directories/.local/share/Steam/steamapps/compatdata/860890/)
Traceback (most recent call last):
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 1738, in <module>
    g_session.init_session(sys.argv[1] != "runinprefix")
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 1530, in init_session
    g_compatdata.setup_prefix()
  File "/home/jason/programs/games/steamapps/common/Proton - Experimental/proton", line 795, in setup_prefix
    os.symlink("../drive_c", self.prefix_dir + "/dosdevices/c:")
FileNotFoundError: [Errno 2] No such file or directory: '../drive_c' -> '/jason.directories/home.directories/.local/share/Steam/steamapps/compatdata/860890/pfx//dosdevices/c:'
Uploaded AppInterfaceStats to Steam

If it matters, my kernel is:

6.1.62-1-MANJARO (64-bit)

Then it is not Manjaro Linux but a Steam / Wine issue and has nothing to do with permissions.

It is seems the symbolic link created by steam is causing this.

I think your problem is using a exfat for steam. IIRC I tried something similar with ntfs and it kinda works. It has to do with symlinks and such, not sure exfat supports that, steam demands the usage.
On top of that, if I shared the installs between steam on windows and linux, let’s just say steam was not always happy and lots of strange errors.

For me it was simple, I realized all games I wanted to play worked directly on linux so I decided to just make an ext4 for my linux steam and uninstall and shrink the windows partition “just in case” I want to play a game that does not work on linux.

Just a heads up.

Edit
Oh yeah, I think I also had to set the option “exec” so I could execute files on the drive for steam to work with ntfs/exfat (and remove defaults IIRC, because that seems to override).
@linux-aarhus I think you were involved in that thread when I was bugtesting this, I cant remember, do you?

Nope

That is a good hint - though I never actually needed to execute anything from an exfat or ntfs filesystem - but it could be - as exfat and ntfs doesn’t provide any clues as to if a file is executable or not. The exe stuff works completely different on Windows where extensions - like .bat, .cmd, .exe, .com and possibly .ps1 designates executable ‘programs’.

:warning: :zap:
I would be careful with the exec mount option.

One example could be a malware hidden in the obscurity of Steams game folders which would then be executable in the context of the user mounting the device which - in case of fstab without uid/gid - would be root - then all hell break loose and the only path back is complete system wipe

1 Like

This game; did you initially install it through Steam in Windows?

Instead of attempting to move file structures back and forth, why not install it fresh? I’ll make these assumptions; that you have used Steam to create a second SteamLibrary on the new exfat drive; you are able to install this game via Steam. With those conditions in place, you should be able to install a fresh copy of the game to the new SteamLibrary (as created by Steam; not some random folder you’ve created), and then it should work.

While this may seem an oversimplification, if it doesn’t work after doing that, then there’s probably nothing more to help with, from a Manjaro perspective. Otherwise, you might be better served directing your questions to a game oriented forum; as Valve themselves will consider your installation unsupported.

As I stated in my post earlier, I DID get it to work kinda (sharing library between steam windows and steam linux), but it’s something I advice against!
IMHO create a separate partition with ext4 for your linux steam games.

Well this is disappointing, but it has also been educational. Thank you for chiming in

The plan was to have one SSD shared between my already running windows partition (only use it for games) and my Manjaro parition. I was going to have two separate folders, one for each library. A linux steam game folder for the linux steam library and windows steam game folder for the windows steam library.

I’m not sure what games that I have work in Linux as I’ve been struggling to get non linux games to work on linux up until now. Now that I understand my problem, I will be able to discover that.

I was hoping to put it all on one partition so I could have flexibility in going between how much space I may need for games for windows or linux. I wasn’t sure if resizing partitions was an option. Is that something that can be done relatively safely now? Its not critical data but I just don’t want to have to wait on my slow internet connection to re download a big game.

But if my idea isn’t going to work then it seems the best solution would be for me to split it down the middle and have two partitions. One for Linux and one for windows.

I haven’t kept up with disk formats but I’m assuming EXT4 is still the better option for linux on an SSD for games? Load time is primary concern. I say that, but my computer is about 9 years old. Is there a preferred format option for me to use the new partition with the windows installation I’ve already got going on on another disk? NTFS?

The reason I was moving the games back and forth is that I have a slow Internet connection ~30Mbps. It was faster for me to have Steam move the games from one storage location to another than for me to wait for a game to download. I didn’t just want to move folders as I wanted to make sure Steam was aware of where it was. It tends to do a nice job of moving games between storage locations.

I chose this game to test because it was fairly small and used windows.

Thanks

The same space it takes up for the windows steam installation. It’s the same game, but you also install proton that the games are ran though (unless they are linux native).

It’s always a risk, but I have in my whole life never ever lost data in a resize (that I know of). Just resize the windows partition in windows.

I would say ext4 for a game partition yes. Others might have opinions.

Not sure what you mean by that, you will still have your windows game disk. Or do you want another partition to be a “shared” partition?
This is what I would recommend.
So:

  • windows game partition (ntfs - not mounted in linux)
  • windows/linux shared partition (exFAT)
  • linux game partition (ext4)

I mean, you can try to copy from your windows to linux parition and let steam repair the installation, would probably work, if you know where to put it, so I suggest start setting up one game and then figure out the paths.

You just mount the windows ntfs partition manually while you do the copy job.
In my experience, having a ntfs partition mounted constantly creates small corruptions on it over time so I advice against it.
exFAT however, is just fine on both operating systems.

about Steam and directory games Windows and Linux :
games downloaded are not full compatible between theses 2 os ,
even you try to mount as nfs directory games , the first verify will restart download from 0.

before doing anything check that you have option cloud active for save.

you cant get all games from windows , AAA games do not exist linux , only games windows & steamos (( linux) can be played

After reformatting the drive with EXT4, non linux games still do not launch. Only the linux games launch. I checked to make sure that the ownership of the mount point is correct and I had to change it from root to jason:jason Even after doing that, the non linux games still won’t launch. :frowning_face:

How do you mount it? Does steam have credentials to write to the partition/directory?

Edit
I checked the mount options on my ext4 game drive and I mount it with exec, I suspect there is a reason for it, I simply do not remember and my notes are flawed. :frowning:
But the options I use are: Options=rw,dev,async,suid,exec,nouser,auto,nofail,noatime

I use systemd to mount, but the options are the same in fstab

You CAN mount it to your user, or just chown the whole mount directory (after mounting) to the user steam runs as (your username most likely): sudo chown USERNAME:USERNAME /path/to/mountpoint

After fiddling with this for a while, I discovered my problem which I believe was mentioned earlier in the thread. Symlinks

A while back I had made the .wine directory in my home directory symlinked to a .wine directory I had created on an SSD. My home directory is on a HDD.

I copied over the contents of the directory and deleted the symlink. Games now run.

Thank you for everyone’s suggestions.

Jason