Operating System - HP-UX
1821051 Members
2539 Online
109631 Solutions
New Discussion юеВ

/etc/fstab and spaces in NFS volume paths

 
Andrew Cunningham
Frequent Advisor

/etc/fstab and spaces in NFS volume paths

I have a NFS volume I need to mount - the "space" in the Voume name is giving mount a fit
(HP-UX 11.0)

attempt 1)
xserveg5.sandiego.vasci.com:/Shared Items/Public/v2dev /win2kserver/v2dev nfs rw,suid,soft 0 0

mountall: entry for xserveg5.sandiego.vasci.com:/Shared has missing fields in the /etc/fstab
mountall: warning: file system table /etc/fstab is corrupt.

attempt 2)
xserveg5.sandiego.vasci.com:"/Shared Items/Public/v2dev" /win2kserver/v2dev nfs rw,suid,soft 0 0

mountall: entry for xserveg5.sandiego.vasci.com:"/Shared has missing fields in the /etc/fstab
mountall: warning: file system table /etc/fstab is corrupt.

attempt 3)
xserveg5.sandiego.vasci.com:/Shared\ Items/Public/v2dev /win2kserver/v2dev nfs rw,suid,soft 0 0

mountall: entry for xserveg5.sandiego.vasci.com:/Shared\ has missing fields in the /etc/fstab
mountall: warning: file system table /etc/fstab is corrupt.

16 REPLIES 16
Mark Grant
Honored Contributor

Re: /etc/fstab and spaces in NFS volume paths

I have heard that using the octal for a space works in this case but haven't tried it

xserveg5.sandiego.vasci.com:/Shared\040Items/Public/v2dev /win2kserver/v2dev nfs rw,suid,soft 0 0

Never preceed any demonstration with anything more predictive than "watch this"
A. Clay Stephenson
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

While spaces are allowed in UNIX pathnames they should be avoided for just this reason. Man fstab and you will find that the field separator is space or so essentially your task is hopeless with respect to fstab. However, you should be able to manually mount the filesystem using quoting and leave this filesystem entry out of fstab. You could also create an init.d to mount/umount this puppy on boot and shutdown.

Of course, you could adopt the radical notion of changing the directory name on the Windows box.


If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: /etc/fstab and spaces in NFS volume paths

The easy solution -- Remove the space. Unix doesn't much like spaces in file names. You have to remember that Unix ain't Windows!
Andrew Cunningham
Frequent Advisor

Re: /etc/fstab and spaces in NFS volume paths

Actually the NFS server is not Windows - it is a OS X XServeG5 ( BSD Unix in other words). The XServe is an outstanding file server for SAMBA, NFS and AFP. And it is basically just a UNIX box.
I can quite happily mount the file system via NFS from other OS X systems.

It would be quite painful to rename the shared folder to not have spaces ( it is shared with multiple protocols)- it seems a very arbitrary restriction to fstab

I tried the \040 suggestion....

mountall: cannot mount xserveg5.sandiego.vasci.com:/Shared\040Items/Public/v2dev
mountall: diagnostics from mount
No such file or directory
Jeff Schussele
Honored Contributor

Re: /etc/fstab and spaces in NFS volume paths

Hi Andrew,

Sometimes pain is a healthy part of life...
Get rid of it & life will be even easier.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Thorsteinson
Honored Contributor

Re: /etc/fstab and spaces in NFS volume paths

Try using a backslash to quote the space.
I haven't tried with mount as I don't use spaces.
Geoff Wild
Honored Contributor

Re: /etc/fstab and spaces in NFS volume paths

Not a fix, but a work around...

How about, on the OSX box, create a symbolic link (with no spaces) to the "/Shared Items/Public/v2dev" dir and exportfs that(symbolic link) to the HP-UX 11.0 server?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

Okay, if this is OS X (and thus UNIX kinda,sorta based) you should be able to "outbushwhack" it like this:

On your OS X box create a symbolic link from the actual directory (w spaces) to another (w/o spaces).

e.g.
ln -s "/Shared Items/Public/v2dev" /Shared_Items/Public/v2dev"

Now export BOTH of these and the UNIX client can use the version w/o spaces and the other clients can use the version w spaces.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

Ooops, that should be:
ln -s "/Shared Items/Public/v2dev" /Shared_Items/Public/v2dev

(no quote at the end)

You could also simply choose to link only the "Shared Items" to Shared_Items.

If it ain't broke, I can fix that.
Andrew Cunningham
Frequent Advisor

Re: /etc/fstab and spaces in NFS volume paths

these are the problems I ran into using links ( I had already tried this)
- It seems not possible to export a symbolic link itself as a NFS share
(Bad exports list line in log)
- If I expjavascript:postAnswerSubmit('submit');ort the parent directory of the symbolic link, it is not possible to follow the link when the client accesses it.

http://ou800doc.caldera.com/SDK_sysprog/_Using_Symbolic_Links_with_NFS.html

A. Clay Stephenson
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

I actually got this to work on HP-UX but OS X must be a bit different. I could actually export both variants and mount them remotely.
I would now try to mount it explicitly w/o an fstab entry. If that doesn't work then this is hopeless. With rc scripts to do the explicit mounts, this is not a terrible workaround.


While using spaces as separators may seem arbitrary, it has been like that for decades. You will find that the UNIX mindset so abhors spaces in filenames that they are avoided eventhough spaces are legal. Very few shell scripts or commands bother to rogorously quote everything to protect whitespace so even if you got this to work, things which ought to work might suddenly treat what was actually 1 filename as two. I note that you also adopted this view because your mountpoint does not have whitespace.
If it ain't broke, I can fix that.
Andrew Cunningham
Frequent Advisor

Re: /etc/fstab and spaces in NFS volume paths

Thanks for all the help, I think given all the problems, I will just mv the whole directory to another point on the OS X filesystem ( one without spaces!) and share it from there. Just have to kick all the Windows users off before I do it...
swanand_2
Occasional Visitor

Re: /etc/fstab and spaces in NFS volume paths

the \040 suggestion is not working. Creating a soft link is not possible as we are using a netapp filer. Is there any other work around that we can try?  

Dennis Handly
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

>Is there any other work around that we can try?

 

Remove those evil spaces?

Have you tried quoting the whole name?

Have you tried keep adding "\" before the space, until it works?

swanand_2
Occasional Visitor

Re: /etc/fstab and spaces in NFS volume paths

i tried quoting the whole name,adding "\" before the space but no success.

i still get the message:

mount:ignoring incomplete/incorrect entry for host:path in /etc/fstab

Dennis Handly
Acclaimed Contributor

Re: /etc/fstab and spaces in NFS volume paths

>mount: ignoring incomplete/incorrect entry for host:path in /etc/fstab

 

Then it looks like you'll need to use the mount(1m) command with the path quoted.