0

I'm attempting to use Steam on my Mac, but I set up my system to have case-sensitivity.

Steam has a thread for setting up an image file with a case-sensitive file system, however, I'm finding that it doesn't work.

Regardless of whether I create the sparse image from Disk Utility or from hdiutil, I get a mount-error.

hdiutil: attach failed - no mountable file systems

However, as far as I can tell I've created the file correctly?

#!/usr/bin/env bash
set -e

MOUNTPT="/.000"
SPARSEIMG="/Users/Shared/Steam/steam.sparseimage"

if [ ! -e "${MOUNTPT}" ]; then
    echo "sudo mkdir -m0777 ${MOUNTPT}"
    sudo mkdir -m0777 "${MOUNTPT}"
fi

if [ ! -e "${SPARSEIMG}" ]; then
    hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 32g "${SPARSEIMG}"
fi

hdiutil attach -mountpoint "${MOUNTPT}" -nobrowse "${SPARSEIMG}"

Can anyone tell me what I am not doing correctly?

UPDATE: The image that's created mounts properly in Disk Utility, but does not with hdiutil

  • The link to the Steam article just goes to the main forum page so it is impossible to see what the thread says - making the question not understandable – Mark Sep 15 '18 at 10:11
  • @Mark - the link is irrelevant to diagnose the error specified in the question. Additionally, this question has an answer that addresses it. – Allan Sep 15 '18 at 11:54
1

It's a better practice to leave all uppercase variables for the shell and use lower and or mixed case for user variables in scripts. You need to preface the hdiutil attach ... command too with sudo if using /.000 as the mount point.

Here's my version of the script which works.


#!/bin/bash

set -e

mountpt="/.000"
sparseimg="/Users/Shared/Steam/steam.sparseimage"

[ ! -d "$mountpt" ] &&  sudo mkdir -m0777 "$mountpt"
[ ! -e "$sparseimg" ] && hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 32g "$sparseimg"

sudo hdiutil attach -mountpoint "$mountpt" -nobrowse "$sparseimg"

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .