Write to 1 failed [No space left on device] Error

Running a installation on Solaris 11 and getting error write to 1 failed [No space left on device]

If anyone can advise ?

ORIGINAL_PATH="${PATH}"
  # prepend /usr/xpg4/bin to PATH as needed
  temporaryPath=`expr "${PATH}:" : '\(/usr/xpg4/bin:\)'`
  if [ "X${temporaryPath}" = "X" ]
  then
    PATH="/usr/xpg4/bin:${PATH}"

seem to have space available

df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris      50G   879M        49G     2%    /
/dev                     0K     0K         0K     0%    /dev
/opt                   2.0G   130M       1.9G     7%    /opt
/opt/bmc                20G   414M        19G     3%    /opt/bmc
/opt/bmc/remedy        100G    23G        76G    24%    /opt/bmc/remedy
rpool/ROOT/solaris/var
                        50G    83M        49G     1%    /var
proc                     0K     0K         0K     0%    /proc
ctfs                     0K     0K         0K     0%    /system/contract
mnttab                   0K     0K         0K     0%    /etc/mnttab
objfs                    0K     0K         0K     0%    /system/object
swap                   353M   504K       352M     1%    /system/volatile
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
swap                   353M   232K       352M     1%    /tmp
rpool/VARSHARE          50G   5.7M        49G     1%    /var/share
rpool/export            50G    32K        49G     1%    /export
rpool/export/home       50G    46K        49G     1%    /export/home
rpool/export/home/acw2012
                        50G    46K        49G     1%    /export/home/acw2012
rpool/export/home/bzm2301
                        50G    45K        49G     1%    /export/home/bzm2301
rpool/export/home/gallium
                        50G   137K        49G     1%    /export/home/gallium
rpool/export/home/mnl1901
                        50G    46K        49G     1%    /export/home/mnl1901
rpool/export/home/mym1202
                        50G    37K        49G     1%    /export/home/mym1202
rpool/export/home/opscman
                        50G    33K        49G     1%    /export/home/opscman
rpool/export/home/opsunix
                        50G    36K        49G     1%    /export/home/opsunix
rpool/export/home/passman
                        50G    36K        49G     1%    /export/home/passman
rpool/export/home/storeadm
                        50G    36K        49G     1%    /export/home/storeadm
rpool/export/home/sv_mont
                        50G    38K        49G     1%    /export/home/sv_mont
rpool/export/home/unixadm
                        50G    36K        49G     1%    /export/home/unixadm
rpool/export/home/unixdna
                        50G    37K        49G     1%    /export/home/unixdna
rpool/export/home/uxmgt
                        50G    37K        49G     1%    /export/home/uxmgt
rpool                   50G    31K        49G     1%    /rpool
rpool/VARSHARE/pkg      50G    32K        49G     1%    /var/share/pkg
rpool/VARSHARE/pkg/repositories
                        50G    31K        49G     1%    /var/share/pkg/repositories

My suspicion is that the installation routine is trying to write in /dev or something such, where nothing at all should be written. "1" looks more like an I/O descriptor (for stdout) rather than a filename and i suppose there is something garbled in the installation routine so that output is going to a file named "1! rather than the I/O-desciptor 1.

You might debug the installation routine (if it is a script it should be relatively easy) to find where the error originates from.

I hope that helps.

bakunin

Hi Bakunin,

some part of the script code is as per below, the first line is returned as error...

ORIGINAL_PATH="${PATH}"
  # prepend /usr/xpg4/bin to PATH as needed
  temporaryPath=`expr "${PATH}:" : '\(/usr/xpg4/bin:\)'`
  if [ "X${temporaryPath}" = "X" ]
  then
    PATH="/usr/xpg4/bin:${PATH}"

I have no idea what that is supposed to do, but: whatever it is, it should be done differently. Anyway, the only program external to the shell called in this part is the expr command, the rest is just variable manipulation inside the shell, which can't cause the error you are describing.

Either the error comes from somewhere else or it comes from line 3 of the part you have shown. But again: whatever it is supposed to do, i doubt that it does it and i am sure that even if it would do it it should be done differently.

If this is supposed to test if the path /usr/xpg4/bin is alraedy in the PATH it should be:

  # prepend /usr/xpg4/bin to PATH as needed
  if ! echo "$PATH" | grep -q '\/usr\/xpg4\/bin' ; then
    PATH="/usr/xpg4/bin:${PATH}"

instead of these ridiculous expr -gymnastics.

I hope this helps.

bakunin

1 Like

That's not quite correct. Unlike grep, expr searches from the beginning.
The following is correct

if echo x"${PATH}:" | grep '^x/usr/xpg4/bin:' >/dev/null
then
  :
else
  PATH="/usr/xpg4/bin:${PATH}"

Or

if expr x"${PATH}:" : x'/usr/xpg4/bin:' >/dev/null
then
  :
else
  PATH="/usr/xpg4/bin:${PATH}"

Also avoids potential problems with Solaris 10 /bin/sh and /bin/grep, and with strange characters in PATH.
But the original is okay. As was already stated, the problem is elsewhere.

Why not use internal parameter expansion in lieu of external grep ?

[ ${PATH/"/usr/xpg4/bin"} = ${PATH} ] || PATH="/usr/xpg4/bin:${PATH}"
1 Like

Because 1. the Solaris 10 /bin/sh does not have all the Posix modifiers, and this one is not even Posix.
Also 2. this modifier has some pitfalls:
${PATH/"/usr/xpg4/bin"} works in bash-4 only while bash-3 takes ${PATH/\/usr\/xpg4\/bin} . And it is hard to add a : character (to form a separator).
Anyway, the following standard expression is readable and has no pitfalls:

[[ ${PATH}: == /usr/xpg4/bin:* ]] || PATH="/usr/xpg4/bin:${PATH}"

The Solaris 10 /bin/sh needs the less readable

case ${PATH}: in /usr/xpg4/bin:*);; *)PATH="/usr/xpg4/bin:${PATH}";; esac
1 Like