# shfs unmount problem

## Roc

I'm using shfs-0.35 with kernel 2.6.9-gentoo-r4. Mounting a remote machine as non-root user with shfsmount works well, but when I reboot my box without prior unmounting it again, it will hang on "Unmounting file systems".

Can anyone countercheck this?

----------

## Syldorian

I haven't tried what you're talking about, but I have a thought. Are you mounting the machine with "shfsmount" or are you using "mount -t shfs"

If you're using the former, linux may not know about shfsumount, so it wouldn't be able to unmount the file system. If you're already using "mount -t shfs", though, I don't know what the issue is.

I'm probably way off, but it could be something to try.

----------

## Roc

Thanks for your reply, Syldorian. I tried the form "mount -t shfs", but this only works for root, not normal users as it should.

----------

## Syldorian

OK, I'm running into this problem now, too (it's just taken me this long to have to reboot....go Linux).  I'm still not sure what the problem is, but you're apparently not the only one that it's affecting. I'm going to keep playing with it....if I somehow fix it, I'll let you know.

----------

## jonwizmedia

Hey Roc, you say you've successfully used shfsmount as non-root user. I have not been successfull in doing that.

I do not want to mount my remote shell as root..then any files I create or modify will become chowned to root.

The shfs install docs mention setting the suid sticky bit, I haven't set many sticky bits in my use of linux so far.

would I do?

```

shfsmount -o suid user@host /mountpoint

```

A friend suggested using shfsmount normally..but mounting on a userspace mountpoint

Such as

```

shfsmount user@host /home/user/mountpoint

```

Still did not work..I got "Operation not permitted." error.

Any suggestions?

Thanks in advance.

----------

## Syldorian

jonwizmedia, I'm not Roc but I'll try to answer your question anyway.    :Very Happy: 

To set the suid bit, the FAQ on shfs's website says to do a "chmod u+s shfsmount", and the same for shfsumount. I did a "chmod a+s" on both of them (before reading the FAQ), which is working for me so far. I'd try it their way first, though. That'll just change the user's suid bit, which is probably more secure.

----------

## jonwizmedia

Thanks a lot! That did the trick.

I thought chmod only set read write and execute..I thought the dashes in between rwx-rwx-rwx were just seperators..not an empty bit which can be filled with "s"...sweet!

I've never seen the suid bit on any file...that' s why I didn't know it was connected to chmod.

I thought it was connected to the --options argument of chmod.

Awesome, now I just use the -o stable option and I got real symlinks too.

Thanks again.

----------

## Syldorian

This is actually kind of an exceptional case....the place where the 's' goes for the suid bit is normally either blank (the '-' you were talking about) or an 'x', to indicate that the file is an executable. If I remember right, the suid bit lets the file (program in this case) execute as if the user who *owns* the file executed it. Normally, executable files only run with the same permissions as the user who executed it, regardless of the owner. But setting the suid bit in this case lets us run shfsmount and shfsumount with the same permissions as the root user, but without actually logging in as root.

Sorry if that doesn't make sense...this is stretching my limited knowledge of permissions in Linux.    :Very Happy: 

----------

## Roc

Syldorian, do you also think the unmount problem is related to the kernel module and not an issue of Gentoo? I would file a bug report to the maintainer at Sourceforge then.

Basically, shfs does a good job for me and fits exactly to my needs, but I can't use it on a remote machine when there is a good chance that it doesn't come alive again after a ssh forced reboot.

----------

## Syldorian

Roc,

 I'm honestly not sure what the problem is. I don't know if it's on Gentoo's side or if it's on shfs's.  I'll look through the bug lists of both and see if anything like this has shown up. If not, I'll go ahead and submit a bug report to one of them (if I can figure out how....it'll be the first time I've done that.    :Very Happy:  ).

And, yup, shfs is *great*. I just started using it a few days ago....aside from this, I've had absolutely no problems with it.

----------

## pitbull67

I was having the same problem

Edit your /etc/init.d/netmount 

change this line to include shfs:

```
local remaining="$(awk '$3 ~ /coda|nfs|shfs|ncpfs|smbfs/ { if ($2 != "/") print $2 }' /proc/ 
```

Good luck.

----------

## Roc

 *Quote:*   

> 
> 
>  was having the same problem
> 
> Edit your /etc/init.d/netmount
> ...

 

Unbelievable! It works. Will the maintainer of the baselayout package get informed about this patch?

----------

## tnt

I had sam error and one error more:

My shfs partitions in /etc/fstab were unable to mount on boot because they were considered as "local file system" by /etc/init.d/localmount. So, as a "local fs" they failed to mount before bringing up of eth0.

I've changed /etc/init.d/localmount by adding "noshfs":

```
mount -at nocoda,nonfs,noshfs,noproc,noncpfs,nosmbfs,noshm >/dev/null
```

Everything works now...

----------

## Mr Faber

I have another problem. I have applied the patch on netmount but if the server with an mounted shfs on it restarts I can't shutdown my client. It always hangs on unmounting network file systems. What can I do?

cu

Mr Faber

----------

