Unmounting SMB share folder
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I mounted a SMB share folder under /mnt/smb/ and I can access the files. When I unmount this shared folder using command:
umount /mnt/smb/
naturally I cannot list shared folder contents using command:
ls /mnt/smb/
But the problem is when I run the ls command from a PHP file on the same machine, the contents of shared SMB folder can be listed! The contents of PHP file is:
<?php
$command = 'ls /mnt/smb/';
$result = shell_exec($command);
echo $result;
?>
What is my mistake. Is there any other commanf needed for completely unmount the SMB share? I also used command below but there was no luck:
fusermount -u /mnt/smb/
cifs unmounting
 |Â
show 3 more comments
up vote
1
down vote
favorite
I mounted a SMB share folder under /mnt/smb/ and I can access the files. When I unmount this shared folder using command:
umount /mnt/smb/
naturally I cannot list shared folder contents using command:
ls /mnt/smb/
But the problem is when I run the ls command from a PHP file on the same machine, the contents of shared SMB folder can be listed! The contents of PHP file is:
<?php
$command = 'ls /mnt/smb/';
$result = shell_exec($command);
echo $result;
?>
What is my mistake. Is there any other commanf needed for completely unmount the SMB share? I also used command below but there was no luck:
fusermount -u /mnt/smb/
cifs unmounting
Please also post the output ofmount | grep /mnt/smb
afterumount
ing (whenls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing fromphp
. If there is a difference maybe the share is auto-mounted again. NB: If the output of themount
command contains a username or password, I suggest you remove it before posting.
â Ned64
Feb 17 at 9:45
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
If that it the output afterumount
ing then the drive has NOT beenumount
ed in the first place!ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.
â Ned64
Feb 17 at 12:27
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Very good. Now, after the empty line, (a) can you list the files byphp
?, and (b) if you can, then please test the mount command again and let us know.
â Ned64
Feb 17 at 12:58
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I mounted a SMB share folder under /mnt/smb/ and I can access the files. When I unmount this shared folder using command:
umount /mnt/smb/
naturally I cannot list shared folder contents using command:
ls /mnt/smb/
But the problem is when I run the ls command from a PHP file on the same machine, the contents of shared SMB folder can be listed! The contents of PHP file is:
<?php
$command = 'ls /mnt/smb/';
$result = shell_exec($command);
echo $result;
?>
What is my mistake. Is there any other commanf needed for completely unmount the SMB share? I also used command below but there was no luck:
fusermount -u /mnt/smb/
cifs unmounting
I mounted a SMB share folder under /mnt/smb/ and I can access the files. When I unmount this shared folder using command:
umount /mnt/smb/
naturally I cannot list shared folder contents using command:
ls /mnt/smb/
But the problem is when I run the ls command from a PHP file on the same machine, the contents of shared SMB folder can be listed! The contents of PHP file is:
<?php
$command = 'ls /mnt/smb/';
$result = shell_exec($command);
echo $result;
?>
What is my mistake. Is there any other commanf needed for completely unmount the SMB share? I also used command below but there was no luck:
fusermount -u /mnt/smb/
cifs unmounting
asked Feb 17 at 9:28
Hamid Reza
152
152
Please also post the output ofmount | grep /mnt/smb
afterumount
ing (whenls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing fromphp
. If there is a difference maybe the share is auto-mounted again. NB: If the output of themount
command contains a username or password, I suggest you remove it before posting.
â Ned64
Feb 17 at 9:45
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
If that it the output afterumount
ing then the drive has NOT beenumount
ed in the first place!ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.
â Ned64
Feb 17 at 12:27
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Very good. Now, after the empty line, (a) can you list the files byphp
?, and (b) if you can, then please test the mount command again and let us know.
â Ned64
Feb 17 at 12:58
 |Â
show 3 more comments
Please also post the output ofmount | grep /mnt/smb
afterumount
ing (whenls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing fromphp
. If there is a difference maybe the share is auto-mounted again. NB: If the output of themount
command contains a username or password, I suggest you remove it before posting.
â Ned64
Feb 17 at 9:45
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
If that it the output afterumount
ing then the drive has NOT beenumount
ed in the first place!ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.
â Ned64
Feb 17 at 12:27
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Very good. Now, after the empty line, (a) can you list the files byphp
?, and (b) if you can, then please test the mount command again and let us know.
â Ned64
Feb 17 at 12:58
Please also post the output of
mount | grep /mnt/smb
after umount
ing (when ls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing from php
. If there is a difference maybe the share is auto-mounted again. NB: If the output of the mount
command contains a username or password, I suggest you remove it before posting.â Ned64
Feb 17 at 9:45
Please also post the output of
mount | grep /mnt/smb
after umount
ing (when ls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing from php
. If there is a difference maybe the share is auto-mounted again. NB: If the output of the mount
command contains a username or password, I suggest you remove it before posting.â Ned64
Feb 17 at 9:45
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
If that it the output after
umount
ing then the drive has NOT been umount
ed in the first place! ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.â Ned64
Feb 17 at 12:27
If that it the output after
umount
ing then the drive has NOT been umount
ed in the first place! ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.â Ned64
Feb 17 at 12:27
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Very good. Now, after the empty line, (a) can you list the files by
php
?, and (b) if you can, then please test the mount command again and let us know.â Ned64
Feb 17 at 12:58
Very good. Now, after the empty line, (a) can you list the files by
php
?, and (b) if you can, then please test the mount command again and let us know.â Ned64
Feb 17 at 12:58
 |Â
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Please repeat the umount
command as needed, until the /mnt/smb
folder is u(n)mounted according to ls
in the shell. Then it should also be according to the mount
command:
mount | grep /mnt/smb
so that the share really is not mounted any more. If some process still lists remote contents, it must be cached (unlikely in this php
system call situation, though).
Any command can still see the mount point, of course, because it is a directory. Any local files that the directory contains will be listed, by php
or from a shell.
In order to fix this last issue you could first move/remove the files from the local directory (while the share is not mounted), then do chmod 0 /mnt/smb
as root to indicate the non-mountedness and create ls-errors while not mounted.
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether theumount
was successful, first.
â Ned64
Feb 17 at 12:33
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Please repeat the umount
command as needed, until the /mnt/smb
folder is u(n)mounted according to ls
in the shell. Then it should also be according to the mount
command:
mount | grep /mnt/smb
so that the share really is not mounted any more. If some process still lists remote contents, it must be cached (unlikely in this php
system call situation, though).
Any command can still see the mount point, of course, because it is a directory. Any local files that the directory contains will be listed, by php
or from a shell.
In order to fix this last issue you could first move/remove the files from the local directory (while the share is not mounted), then do chmod 0 /mnt/smb
as root to indicate the non-mountedness and create ls-errors while not mounted.
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether theumount
was successful, first.
â Ned64
Feb 17 at 12:33
add a comment |Â
up vote
1
down vote
accepted
Please repeat the umount
command as needed, until the /mnt/smb
folder is u(n)mounted according to ls
in the shell. Then it should also be according to the mount
command:
mount | grep /mnt/smb
so that the share really is not mounted any more. If some process still lists remote contents, it must be cached (unlikely in this php
system call situation, though).
Any command can still see the mount point, of course, because it is a directory. Any local files that the directory contains will be listed, by php
or from a shell.
In order to fix this last issue you could first move/remove the files from the local directory (while the share is not mounted), then do chmod 0 /mnt/smb
as root to indicate the non-mountedness and create ls-errors while not mounted.
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether theumount
was successful, first.
â Ned64
Feb 17 at 12:33
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Please repeat the umount
command as needed, until the /mnt/smb
folder is u(n)mounted according to ls
in the shell. Then it should also be according to the mount
command:
mount | grep /mnt/smb
so that the share really is not mounted any more. If some process still lists remote contents, it must be cached (unlikely in this php
system call situation, though).
Any command can still see the mount point, of course, because it is a directory. Any local files that the directory contains will be listed, by php
or from a shell.
In order to fix this last issue you could first move/remove the files from the local directory (while the share is not mounted), then do chmod 0 /mnt/smb
as root to indicate the non-mountedness and create ls-errors while not mounted.
Please repeat the umount
command as needed, until the /mnt/smb
folder is u(n)mounted according to ls
in the shell. Then it should also be according to the mount
command:
mount | grep /mnt/smb
so that the share really is not mounted any more. If some process still lists remote contents, it must be cached (unlikely in this php
system call situation, though).
Any command can still see the mount point, of course, because it is a directory. Any local files that the directory contains will be listed, by php
or from a shell.
In order to fix this last issue you could first move/remove the files from the local directory (while the share is not mounted), then do chmod 0 /mnt/smb
as root to indicate the non-mountedness and create ls-errors while not mounted.
edited Feb 17 at 14:45
answered Feb 17 at 9:41
Ned64
2,44411035
2,44411035
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether theumount
was successful, first.
â Ned64
Feb 17 at 12:33
add a comment |Â
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether theumount
was successful, first.
â Ned64
Feb 17 at 12:33
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
Thanks, any way for removing cahce?
â Hamid Reza
Feb 17 at 12:12
@HamidReza Let's check whether the
umount
was successful, first.â Ned64
Feb 17 at 12:33
@HamidReza Let's check whether the
umount
was successful, first.â Ned64
Feb 17 at 12:33
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424750%2funmounting-smb-share-folder%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Please also post the output of
mount | grep /mnt/smb
afterumount
ing (whenls
from the shell does not work), then also check whether the command gives the same result (hopefully, an empty line) after accessing fromphp
. If there is a difference maybe the share is auto-mounted again. NB: If the output of themount
command contains a username or password, I suggest you remove it before posting.â Ned64
Feb 17 at 9:45
The output is: //172.16.50.207/SoftBank on /mnt/smb type cifs (rw,relatime,vers=1.0,cache=strict,username=teknik,domain=OFIS-NAS,uid=0,noforceuid,gid=0,noforcegid,addr=172.16.50.207,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
â Hamid Reza
Feb 17 at 12:16
If that it the output after
umount
ing then the drive has NOT beenumount
ed in the first place!ls /mnt/smb/
should work (at least as root!). Oh, and please move the output into your question so that it can be formatted correctly.â Ned64
Feb 17 at 12:27
Sorry, my wrong. The output of mount | grep /mnt/smb after UMOUNT is empty line. My previous comment was output after MOUNT.
â Hamid Reza
Feb 17 at 12:55
Very good. Now, after the empty line, (a) can you list the files by
php
?, and (b) if you can, then please test the mount command again and let us know.â Ned64
Feb 17 at 12:58