But if I login with a public lab account (which is what is normally logged into my computers) it gives me the error message about being unable to mount.Īm sort of out of ideas at this point, so I'm just going computer by computer, logging in as Admin and erasing the partition. If I login to a computer with an Admin account and then have JSS run the policy, it works. Even though I run the command as sudo, it seems like it runs as the user currently logged in (I tried using the GUI and Disk Utility while logged in as a non-Admin and it did the exact same thing as the script).
So I'm ultimately doing this because the file format of a lot of our computers' partitions is Mac OS Extended and I need it to be set to Mac OS Extended (Journaled).ĭid some troubleshooting, it looks like unless the eraseVolume command completes and mounts the drive it doesn't set the file format to Mac OS Extended (Journaled) but instead leaves it as Mac OS Extended (after rebooting when the drive mounts that's what it shows). I get why the 2nd command fails (since it didn't mount it can't change permissions), but does anyone know why the first command would repeatedly fail? I've tried flushing the policy so it would try again in case it was just a fluke, but it continually fails at the same spot (re-mounting).
Initialized /dev/rdisk0s4 as a 9 GB case-insensitive HFS Plus volume with a 8192k journalĬhmod: /volumes/Volume_name: No such file or directory However, when I create a script and try to run it through JSS, I get this error: #!/bin/sh If I run these commands separately on terminal on a computer, it works perfectly. Sudo diskutil eraseVolume JHFS+ Volume_name /dev/disk0s4 #erase and reformat Volume_name partition Whatever you do, don’t unplug the USB cable willy-nilly.I have a simple script that erases a volume and them sets the permissions so that anyone can access the drive: #!/bin/sh While this won’t help you in your current predicament, there is a simple bit of advice you can follow to help avoid data corruption: always disconnect your drive safely. There are too many to cover here, but our sister site Macworld UK outlines theīest data recovery apps for those interested. These are generally paid apps, but they could restore your external drive depending on the issue. If all else fails, you’ve always got the option of using a third-party data recovery app.
Reformatting an external drive for Mac in more detail separately.
If you want to use the drive across PC and Mac, we’d recommend ExFAT, but if you’re on macOS exclusively, we recommend Mac OS Extended (Journaled).
To check for the exact name of the disk: sudo diskutil list.