You are not logged in.

Announcement

[2017.09.08] DeployStudio build v1.7.8 (checksum, release note).
[2016.08.26] DeployStudio build v1.6.19 (release note).
[2013.02.23] DeployStudio last universal build v1.5.17 (release note).

#1 2017-07-01 02:02:43

fkick
Member
Registered: 2016-01-13

Rename Volume: name is subject to file system-specific restrictions

Hi,

I'm trying to rename an imaged volume with Deploystudio using ARD Computer information Values. In the workflow I have the hostname form set, and the configure operation set. I run the below script after first reboot. However I continually am getting the following error:

Usage: diskutil rename[Volume] MountPoint|DiskIdentifier|DeviceNode newName
The new name is subject to file system-specific naming restrictions.
Ownership of the specified volume may be required.

Originally I thought it was due to have a space in the chosen name (i.e. Producer 1193), however I get the same error with a value of "Producer_1193". This script will work if I run it via terminal after deploy studio completes the imaging.

Hard Drive Rename Script:

#!/bin/sh

#reads Computer Information Fields 1 & 4
VOLNAME="$(defaults read /Library/Preferences/com.apple.RemoteDesktop Text1)"

#ensures expected value is being read into variable
echo $VOLNAME 

# renames main hdd to computer name for reference
diskutil rename $DS_LAST_RESTORED_VOLUME "$VOLNAME"

exit 0

I'm sure I'm missing something simple here. Thanks for any help!

Last edited by fkick (2017-07-01 03:36:27)

Offline

#2 2017-07-02 22:08:09

mjsanders
Member
From: Schiedam, Netherlands
Registered: 2008-09-02
Website

Re: Rename Volume: name is subject to file system-specific restrictions

I am not sure, but it may be timing of the workflow steps (after reboot, done by finalize scripts, see /var/log/ds_finalize.log on the client to see what is done in which order).
Your script may try to read the RemoteDesktop preferences, which are not (yet?) created.

Try to change the order of the steps in your workflow, usually that is respected at postponed execution of scripts.

Maybe you can do a rename script before reboot, using the $DS_variables that are available while running scripts from the runtime?
(see ds_example.sh in the scripts folder for ideas)

Offline

#3 2017-07-02 22:23:33

fkick
Member
Registered: 2016-01-13

Re: Rename Volume: name is subject to file system-specific restrictions

Thanks mjsanders,

I've got it as the last script step right now after reboot. Looking at the log, it seems as though the script is able to pull the correct ard info, as the Echo statement is showing the correct name in the log.

Do you think using $ds_last_restored_volume may be the issue?

Offline

#4 2017-07-03 07:58:31

mjsanders
Member
From: Schiedam, Netherlands
Registered: 2008-09-02
Website

Re: Rename Volume: name is subject to file system-specific restrictions

Post-install scripts cannot use the DS_ variables, these only function while executing a script from DS Runtime....
If you want that, you can use a Runtime script to generate a file with prefs, and let your post-install script read the file.
Maybe easier to do the renaming from the DS Runtime?

Offline

#5 2017-07-03 15:19:20

fkick
Member
Registered: 2016-01-13

Re: Rename Volume: name is subject to file system-specific restrictions

Is it possible to read the ARD Computer Info fields from the runtime?

Could I do the entire rename in the runtime?

Or would it make more sense to replace $DS_Last_Restored_Volme with a simple "/" for the mount point in the current script?

Last edited by fkick (2017-07-03 15:19:50)

Offline

#6 2017-07-03 21:45:27

mjsanders
Member
From: Schiedam, Netherlands
Registered: 2008-09-02
Website

Re: Rename Volume: name is subject to file system-specific restrictions

Yes, rewriteing the script is probably easier.
I am not sure what kind of reference diskutil accepts for this step. " / " is probably not working, diskutil typically accepts partitions like "/dev/disk0s2" or volumes like "/Volumes/Macintosh HD" , depending on the task. After deployment you can typically know what the partition or volume name is.
Try out!

Offline

#7 2017-07-08 17:01:31

fkick
Member
Registered: 2016-01-13

Re: Rename Volume: name is subject to file system-specific restrictions

Thanks! Using the volume name convention fixed the issue.

Offline

Board footer

Powered by FluxBB