Muppy-SMB to find and mount shared network-folders (final?)
Muppy-SMB to find and mount shared network-folders (final?)
This dotpup tries to find shared folders of Windows or Linux computers in a local network.
It mounts only folders without password-protection.
You also can share a folder (/root/shared) on your computer for the network.
Download
http://dotpups.de/dotpups/System_Utilities/getdir.pup
http://dotpups.de/dotpups/Network/Muppy-SMB.pup (1.6 MB)
If you have a old Puppy (2.10 or older), you must install PuppyBasic 2.5 as alien Package:
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... 2.5.tar.gz
If you run Muppy-smb from the dotpups-menu, you get a dialog.
Screenshot:
You also can run it with a parameter, then no dialog appears:
This mounts all shares available to /mnt/Network/:
Muppy-smb -codepage 850
This mounts them with a german codepage, and opens /mnt/Network/ in Rox:
Muppy-smb -codepage 437 -rox
This unmounts them:
Muppy-smb -umount
For more info about sharing folders, read Rarsas great HowTo:
http://www.murga-linux.com/puppy/viewtopic.php?t=2163
Mark
It mounts only folders without password-protection.
You also can share a folder (/root/shared) on your computer for the network.
Download
http://dotpups.de/dotpups/System_Utilities/getdir.pup
http://dotpups.de/dotpups/Network/Muppy-SMB.pup (1.6 MB)
If you have a old Puppy (2.10 or older), you must install PuppyBasic 2.5 as alien Package:
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... 2.5.tar.gz
If you run Muppy-smb from the dotpups-menu, you get a dialog.
Screenshot:
You also can run it with a parameter, then no dialog appears:
This mounts all shares available to /mnt/Network/:
Muppy-smb -codepage 850
This mounts them with a german codepage, and opens /mnt/Network/ in Rox:
Muppy-smb -codepage 437 -rox
This unmounts them:
Muppy-smb -umount
For more info about sharing folders, read Rarsas great HowTo:
http://www.murga-linux.com/puppy/viewtopic.php?t=2163
Mark
Last edited by MU on Sun 14 Jan 2007, 21:25, edited 6 times in total.
I updated the dotpup.
It now checks, if the created folders are really mounted.
If not, and if they are empty, they will be deleted.
This also happens when you unmount.
So your folderstructure stays "clean".
Folders with a "$" in the name will not be mounted, as it seems that they are temporary folders from Windows, like "print$".
So what remains to be done:
- speed things up.
As I added smbtree later, I do not use it yet to determine the foldernames.
Using it might be faster, as I could skip a loop.
- add some buttons to the dialog, like a help with Rarsas HowTo and LinNeighbourHood to be able to mount (protected) folders manually.
- detect german languagesettings to set -codepage 437 automatically?
Mark
It now checks, if the created folders are really mounted.
If not, and if they are empty, they will be deleted.
This also happens when you unmount.
So your folderstructure stays "clean".
Folders with a "$" in the name will not be mounted, as it seems that they are temporary folders from Windows, like "print$".
So what remains to be done:
- speed things up.
As I added smbtree later, I do not use it yet to determine the foldernames.
Using it might be faster, as I could skip a loop.
- add some buttons to the dialog, like a help with Rarsas HowTo and LinNeighbourHood to be able to mount (protected) folders manually.
- detect german languagesettings to set -codepage 437 automatically?
Mark
Share names with trailing $ -char are "hidden" shares in Windows, not temporary shares. One can create a share name using $ as a last char to hide the share from other workstations on the network. Clients must know the exact name of the share to map it (ie using \\mypchost\files$ as a share name in file explorer or net use command).
Mark; I installed getdir.pup & Muppy-SMB.pup, & clicked for English.
Then I ran mount & no shares were mounted
There are 3 LAN shares & 2 local, I used LinNeighborhood to test mount them.
I couldn't make smbstatus give me any share info (weard), I didn't try much.
I used: "smbtree -N -S" to get WorkGroups & Hosts.
And used: "smbclient -L $HOST" to get that host's shares.
Then I ran mount & no shares were mounted
There are 3 LAN shares & 2 local, I used LinNeighborhood to test mount them.
I couldn't make smbstatus give me any share info (weard), I didn't try much.
I used: "smbtree -N -S" to get WorkGroups & Hosts.
And used: "smbclient -L $HOST" to get that host's shares.
I'm running Puppy-1 (duh), should be Muppy... right? (gee, I wonder if that's it?)
In case it might help, here's the complaint:
# ./Muppy-smb
101
# [Syntax error]
Expected an expression
in file "Muppy-SMB", line 29:
allmachines = xwin_system("./smbtree -N| tr -s ' '|cut -f2|grep '\\\\'|sed 's/\\\\//g'")
^
*** glibc detected *** double free or corruption (top): 0x080aeee0 ***
#
And hey! The picture's cool... you look like a rock star!
In case it might help, here's the complaint:
# ./Muppy-smb
101
# [Syntax error]
Expected an expression
in file "Muppy-SMB", line 29:
allmachines = xwin_system("./smbtree -N| tr -s ' '|cut -f2|grep '\\\\'|sed 's/\\\\//g'")
^
*** glibc detected *** double free or corruption (top): 0x080aeee0 ***
#
And hey! The picture's cool... you look like a rock star!
I see, you use an old ersion of Puppybasic, that does not support xwin_system() yet.
Please upgrade with with pupget or using this unleashed package:
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... 2.5.tar.gz
I recently bought a webcam, that unfortunately is not supported by Puppys drivers (was extremely cheap, so I did not check in advance). Made a testvideo in XP then, that's what I took the picture from.
http://dotpups.de/pics/diverse/mark-nov-2006.avi
Mark
Please upgrade with with pupget or using this unleashed package:
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... 2.5.tar.gz
*lol* ok, if I just had the money and groupiesAnd hey! The picture's cool... you look like a rock star!
I recently bought a webcam, that unfortunately is not supported by Puppys drivers (was extremely cheap, so I did not check in advance). Made a testvideo in XP then, that's what I took the picture from.
http://dotpups.de/pics/diverse/mark-nov-2006.avi
Mark
Success! It's late & all the other PCs are off, but it mounted both browsable shares on this one.
Tomorrow I'll try it again with all the PCs on, if there's errors I'll post back.
NOTE: LinNeighborhood defaults to making mount dirs. in /root, & there were problems with Puppy trying to backup the shares at shutdown, etc.
In Puppy1 all you had to do was set LinNeighborhood to make the dirs. out of /root.
In Puppy2 the SAVE file covers everything, so I don't know how to deal with it,
other than modifing Barry's code to unmount all shares before backing up.
Barry may have already taken care of this, I don't know...
You may be aware of this, or it may not matter, but I thought I'd mention it.
Here's the report:
# ./Muppy-smb
101
# Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
mounting: /root/network/PUPSERVER/docs
###### //PUPSERVER/docs on /root/network/PUPSERVER/docs type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)
mounting: /root/network/PUPSERVER/public
###### //PUPSERVER/public on /root/network/PUPSERVER/public type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)
Tomorrow I'll try it again with all the PCs on, if there's errors I'll post back.
NOTE: LinNeighborhood defaults to making mount dirs. in /root, & there were problems with Puppy trying to backup the shares at shutdown, etc.
In Puppy1 all you had to do was set LinNeighborhood to make the dirs. out of /root.
In Puppy2 the SAVE file covers everything, so I don't know how to deal with it,
other than modifing Barry's code to unmount all shares before backing up.
Barry may have already taken care of this, I don't know...
You may be aware of this, or it may not matter, but I thought I'd mention it.
Here's the report:
# ./Muppy-smb
101
# Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
mounting: /root/network/PUPSERVER/docs
###### //PUPSERVER/docs on /root/network/PUPSERVER/docs type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)
mounting: /root/network/PUPSERVER/public
###### //PUPSERVER/public on /root/network/PUPSERVER/public type smbfs (rw,nosuid,nodev,file_mode=0755,dir_mode=0755,codepage=cp)
Updated the dotpup, there was a potential bug with multiple domains.
I also tested a new version, that was slightly faster.
But it had a new problem: the Printer-folders were displayed as illegal entries in Rox.
Did not find out the reason.
The old version ran more stable, so I'll stay with that.
If someone wants to test my rejected new trial anyway, replace this file:
http://dotpups.de/tests/neu/Muppy-SMB
But I encountered another strange thing in both versions:
I just can mount 3 shares, after that I get a connect-error in the console.
It is not related to a special folder, as my new program sorted the entries differently.
The old version did not mount //TORSTEN/Dokumente, the new one TORSTEN/SharedDocs.
If it might be related to the maximum possible amount of loop-devices?
I'm puzzled about it, and have no idea at moment.
Mark
I also tested a new version, that was slightly faster.
But it had a new problem: the Printer-folders were displayed as illegal entries in Rox.
Did not find out the reason.
The old version ran more stable, so I'll stay with that.
If someone wants to test my rejected new trial anyway, replace this file:
http://dotpups.de/tests/neu/Muppy-SMB
But I encountered another strange thing in both versions:
I just can mount 3 shares, after that I get a connect-error in the console.
It is not related to a special folder, as my new program sorted the entries differently.
The old version did not mount //TORSTEN/Dokumente, the new one TORSTEN/SharedDocs.
If it might be related to the maximum possible amount of loop-devices?
I'm puzzled about it, and have no idea at moment.
Mark
Hey Mark; I tried the newer script & nothing, this is all it output:
# ./Muppy-smb2
sh: ./smbtree: not found
.....UN-mounting
.....now mounting
sh: ./smbtree: not found
smbtree isn't in the dir. /usr/local/bin, so that's it...
###################
The old script sub dir. all hosts it found under the one before it:
# ./Muppy-smb
101
# mounting: /root/network/60GB//ME//PUPSERVER/MUSIC
###### Nothing
COULD NOT MOUNT
rmdir: `/root/network/60GB//ME//PUPSERVER/MUSIC': Device or resource busy
mounting: /root/network/60GB//ME//PUPSERVER/0
The hosts are: 60GB, ME, PUPSERVER... & MUSIC is the share.
It did this with all the shares, some mounted & some did not... of course.
It looks to be a simple dir. creation problem.
###############
I've made a short "mount everything" script, if you want to try it...
It'll smbmount, smbumount, & a test mode, you'll see it at the top.
It makes the mount dirs. in /tmp/smb, & they're one dir. deep (60GB_MUSIC)
You may want to mess with it, or I'll be glad to modify it for you...
It'd make a nice GUI with 2 ListBoxes, 1 = Hosts & 2 = Host's Shares.
NOTE: The test output may report something like this (just ignore it):
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
# ./Muppy-smb2
sh: ./smbtree: not found
.....UN-mounting
.....now mounting
sh: ./smbtree: not found
smbtree isn't in the dir. /usr/local/bin, so that's it...
###################
The old script sub dir. all hosts it found under the one before it:
# ./Muppy-smb
101
# mounting: /root/network/60GB//ME//PUPSERVER/MUSIC
###### Nothing
COULD NOT MOUNT
rmdir: `/root/network/60GB//ME//PUPSERVER/MUSIC': Device or resource busy
mounting: /root/network/60GB//ME//PUPSERVER/0
The hosts are: 60GB, ME, PUPSERVER... & MUSIC is the share.
It did this with all the shares, some mounted & some did not... of course.
It looks to be a simple dir. creation problem.
###############
I've made a short "mount everything" script, if you want to try it...
It'll smbmount, smbumount, & a test mode, you'll see it at the top.
It makes the mount dirs. in /tmp/smb, & they're one dir. deep (60GB_MUSIC)
You may want to mess with it, or I'll be glad to modify it for you...
It'd make a nice GUI with 2 ListBoxes, 1 = Hosts & 2 = Host's Shares.
NOTE: The test output may report something like this (just ignore it):
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
- Attachments
-
- smbmount-all.gz
- May the Holidays bring Fortune & Joy!
- (516 Bytes) Downloaded 840 times
ok thanks., I'll have a look a wednesday at work.
Good to have another trial
/usr/local/Muppy-SMB/resource/Muppy-SMB with it.
But forget it, because...
...today I tested further, and encountered this:
neither LinNeighbourhood nor smbtree listed both Computers with shares in our network.
They are TORSTEN and KLEINER, but only one was visible.
I finally managed to build a script that lists both.
http://dotpups.de/tests/SMB-tests/testscript
the output will look like this:
sh-3.00# ./testscript
TORSTEN/SharedDocs
TORSTEN/Exceldateien
TORSTEN/C
TORSTEN/Dokumente
KLEINER/SharedDocs
sh-3.00#
It does not mount or so, justs lists those folders, so that I can use it as an external tool to call from my Puppybasic-script.
Might be enhanced, for example it would work erratic, if you had two computers called "PUPPYPC".
To understand better how it works, I added some notes on the commands here:
http://dotpups.de/tests/SMB-tests/neushell.txt
Unfortunately every version does list far not all folders that are shared.
No idea why.
I also had this problem:
it is sent to the errorchannel "stdout".
You can suppress that with
thecommand 2>/dev/null
Mark
Good to have another trial
you must run it in the folder with smbtree, so replacesh: ./smbtree: not found
/usr/local/Muppy-SMB/resource/Muppy-SMB with it.
But forget it, because...
...today I tested further, and encountered this:
neither LinNeighbourhood nor smbtree listed both Computers with shares in our network.
They are TORSTEN and KLEINER, but only one was visible.
I finally managed to build a script that lists both.
http://dotpups.de/tests/SMB-tests/testscript
the output will look like this:
sh-3.00# ./testscript
TORSTEN/SharedDocs
TORSTEN/Exceldateien
TORSTEN/C
TORSTEN/Dokumente
KLEINER/SharedDocs
sh-3.00#
It does not mount or so, justs lists those folders, so that I can use it as an external tool to call from my Puppybasic-script.
Might be enhanced, for example it would work erratic, if you had two computers called "PUPPYPC".
To understand better how it works, I added some notes on the commands here:
http://dotpups.de/tests/SMB-tests/neushell.txt
Unfortunately every version does list far not all folders that are shared.
No idea why.
I also had this problem:
The reason:NOTE: The test output may report something like this (just ignore it):
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
Domain=[PUPGROUP] OS=[Unix] Server=[Samba 3.0.21c]
it is sent to the errorchannel "stdout".
You can suppress that with
thecommand 2>/dev/null
Mark
Your script also shows just one server at work.
My script showed both servers, but now at home just one (I exported some folders in Puppy).
So I added lots of new code, and finally have a quite usable state:
http://dotpups.de/dotpups/Network/Muppy-SMB.pup (1.6 MB)
Screenshot:
You can mount all folders found in a network, or share an own folder from your computer with 1 buttonclick.
smbd and nmbd are included.
Problems:
at work, not all shared folders from XP are visible, no idea why. Also LinNeighbohood cannot find them.
When you mount folders, and switch off the corresponding machine before unmounting them again, that might block Rox-filer for a minute or so.
It might be best to reboot then.
But this seem to be general problems, I am not shure that can be solved.
So if I get positive results, this might be the final version.
Mark
My script showed both servers, but now at home just one (I exported some folders in Puppy).
So I added lots of new code, and finally have a quite usable state:
http://dotpups.de/dotpups/Network/Muppy-SMB.pup (1.6 MB)
Screenshot:
You can mount all folders found in a network, or share an own folder from your computer with 1 buttonclick.
smbd and nmbd are included.
Problems:
at work, not all shared folders from XP are visible, no idea why. Also LinNeighbohood cannot find them.
When you mount folders, and switch off the corresponding machine before unmounting them again, that might block Rox-filer for a minute or so.
It might be best to reboot then.
But this seem to be general problems, I am not shure that can be solved.
So if I get positive results, this might be the final version.
Mark
I updated the dotpup.
Changes:
- smbtree is no longer used, as it was unreliable when a computer disconnected, and so the dotpup is smaller.
Instead I use nmblookup '*'
- when I mount, no longer everything needs to be unmounted before.
This makes it faster.
There remains this problem:
when a computer shuts of, while its shared folder is mounted, it cannot be remounted until you reboot.
I have no idea how to solve that.
Hmm.. maybe if I create a new folder...
If I get an input/output-error trying to create the mountpoint "NOTEBOOK/public" (because it was not unmounted before the shutdown of the remote machine), I could create "NOTEBOOK-$datetime/public" as a fallback.
Will try that next week.
Mark
Changes:
- smbtree is no longer used, as it was unreliable when a computer disconnected, and so the dotpup is smaller.
Instead I use nmblookup '*'
- when I mount, no longer everything needs to be unmounted before.
This makes it faster.
There remains this problem:
when a computer shuts of, while its shared folder is mounted, it cannot be remounted until you reboot.
I have no idea how to solve that.
Hmm.. maybe if I create a new folder...
If I get an input/output-error trying to create the mountpoint "NOTEBOOK/public" (because it was not unmounted before the shutdown of the remote machine), I could create "NOTEBOOK-$datetime/public" as a fallback.
Will try that next week.
Mark
Gave the new one a try in Puppy-1 & it errored with: couldn't find dir.: initrd
Perhaps try a path to a Puppy-1 dir. & Puppy-2 will handle it properly.
I've been looking at my book: Using Samba, & it gives no clear single way of getting Hosts & Shares.
Typical... a M$ mess of a protocol with hap-hazard utilities... but we gots what we gots.
Perhaps try a path to a Puppy-1 dir. & Puppy-2 will handle it properly.
I've been looking at my book: Using Samba, & it gives no clear single way of getting Hosts & Shares.
Typical... a M$ mess of a protocol with hap-hazard utilities... but we gots what we gots.
OK
Hi !
Work well,
Thanks,
Work well,
Thanks,
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=44675]Hacao Linux 2009 CE released ![/url]
[url=http://hacao.com]Hacao.com[/url] English & Vietnamese !
[url=http://hacao.com]Hacao.com[/url] English & Vietnamese !