How can I install an automounter into puppy?
How can I install an automounter into puppy?
I would very much like to use puppy 2.01 on some student terminals to log in via rdesktop to a windows terminal server.
But the students need access to their usb sticks from the terminal server window.
This means I need samba server operating and an automounter that is able to mount and unmount different usb sticks when inserted by various students.
Thanks to MU I have now installed the samba dotpup and when mounted the usb files can be seen over the windows network.
What I desparately need now is to install something like autofs/automount (have used this before on other full distros) or supermount (have not used this) on puppy.
Is that at all possible? If so how?
I have limited skills with linux and no programming skills.
Is there a way to do this fairly simply or could I learn how to do it?
But the students need access to their usb sticks from the terminal server window.
This means I need samba server operating and an automounter that is able to mount and unmount different usb sticks when inserted by various students.
Thanks to MU I have now installed the samba dotpup and when mounted the usb files can be seen over the windows network.
What I desparately need now is to install something like autofs/automount (have used this before on other full distros) or supermount (have not used this) on puppy.
Is that at all possible? If so how?
I have limited skills with linux and no programming skills.
Is there a way to do this fairly simply or could I learn how to do it?
I am currently looking for a way to do this also.
I have tried installing autofs but that didn't work, also tried a C program that was supposed to mount then unmount the cd when you press the button on the cdrom, it mounted fine but does not allow you to unmount...
I don't believe you need samba to use usb sticks, I have mine redirecting through rdesktop using the switch -r disk:usb=/dev/sda1 or whatever usb your plug into use that appropriate /dev/
If anyone has some info on how to get some automounting in linux to work that would be great.. I would need cdrom and usb also.
Thanks
I have tried installing autofs but that didn't work, also tried a C program that was supposed to mount then unmount the cd when you press the button on the cdrom, it mounted fine but does not allow you to unmount...
I don't believe you need samba to use usb sticks, I have mine redirecting through rdesktop using the switch -r disk:usb=/dev/sda1 or whatever usb your plug into use that appropriate /dev/
If anyone has some info on how to get some automounting in linux to work that would be great.. I would need cdrom and usb also.
Thanks
If I'm correct, the client PCs are running Puppy & the students need to plug the USBs into the client PC that they're at?
Why don't the students just use Puppy's MUT (Media Utility Tool) to mount the USBs?
It's easy to understand, simple to use & works most all the time.
Besides if you heard the horror stories about using automount & supermount you might reconsider.
Why don't the students just use Puppy's MUT (Media Utility Tool) to mount the USBs?
It's easy to understand, simple to use & works most all the time.
Besides if you heard the horror stories about using automount & supermount you might reconsider.
Try pitching that to an IT manager, if you've ever worked in a bigger corporation you find out there are a lot of people that are not IT savy, and this would be a big learning curve for them. I can image students have the same problems.
Ohh well trying out windows fundamentals and will pitch both my builds of Puppy and Fundamentals to the boss and see what takes..
Ohh well trying out windows fundamentals and will pitch both my builds of Puppy and Fundamentals to the boss and see what takes..
Thanks for the tip mylon2202 about -r option with the usb in rdesktop.
However I tried that option (-r disk:usb=/dev/sda1 [where my usb stick is located]) but it does not work.
Windows explorer shows a network usb entry called usb under my computer but when I click it no files show up, just empty.
Any ideas why?
However I tried that option (-r disk:usb=/dev/sda1 [where my usb stick is located]) but it does not work.
Windows explorer shows a network usb entry called usb under my computer but when I click it no files show up, just empty.
Any ideas why?
I was working on a bash script daemon, with a delayed loop that checks for USB drives, & if finds one, it mounts it.
This code WORKS, it attempts to mounts USB drives every 5 seconds:
#!/bin/sh
USBmod=`lsmod | grep "usb-storage"`
if [ -z "$USBmod" ];then # if not loaded, load USB drive module
modprobe usb-storage
fi
# make 4 USB mount point dirs.
mkdir -p /mnt/sda1 # USB #1, Part.#1
mkdir -p /mnt/sda2 # USB #1, Part.#2
mkdir -p /mnt/sdb1 # USB #2, Part.#1
mkdir -p /mnt/sdb2 # USB #2, Part.#2
while :
do
sleep 5
for USBmnt in sda1 sda2 sdb1 sdb2
do
mount /dev/$USBmnt /mnt/$USBmnt # attempt to mount USB
if [ $? -eq 0 ];then # if mount good, InfoBox
Xdialog --title " USB Drive daemon" \
--infobox "
USB Flash Drive found...
It's mounted at: /mnt/$USBmnt
" 0 0 5000 &
rox /mnt/$USBmnt # show USB drive in ROX
fi
done
done
===========
I can't find a way to tell when the USB drive's been removed to unmount it.
Perhaps someone can come up with a way to do that!
This code WORKS, it attempts to mounts USB drives every 5 seconds:
#!/bin/sh
USBmod=`lsmod | grep "usb-storage"`
if [ -z "$USBmod" ];then # if not loaded, load USB drive module
modprobe usb-storage
fi
# make 4 USB mount point dirs.
mkdir -p /mnt/sda1 # USB #1, Part.#1
mkdir -p /mnt/sda2 # USB #1, Part.#2
mkdir -p /mnt/sdb1 # USB #2, Part.#1
mkdir -p /mnt/sdb2 # USB #2, Part.#2
while :
do
sleep 5
for USBmnt in sda1 sda2 sdb1 sdb2
do
mount /dev/$USBmnt /mnt/$USBmnt # attempt to mount USB
if [ $? -eq 0 ];then # if mount good, InfoBox
Xdialog --title " USB Drive daemon" \
--infobox "
USB Flash Drive found...
It's mounted at: /mnt/$USBmnt
" 0 0 5000 &
rox /mnt/$USBmnt # show USB drive in ROX
fi
done
done
===========
I can't find a way to tell when the USB drive's been removed to unmount it.
Perhaps someone can come up with a way to do that!
Mylon2202 - Some further questions re usb redirection in rdesktop.
1. Are you logging in to a windows server?
2. I always thought linux could not talk to windows without samba because of the different file systems. My usb drive is formatted in FAT. Should windows be able to see this from the linux terminal anyway?
1. Are you logging in to a windows server?
2. I always thought linux could not talk to windows without samba because of the different file systems. My usb drive is formatted in FAT. Should windows be able to see this from the linux terminal anyway?
sunburnt,
--Lee
A combination of dmesg, dmesg -c, and grep could tell you that(I'm not sure if it's a good idea or not,) but what is the point? If the drive has already been removed, it's too late to unmount it.I can't find a way to tell when the USB drive's been removed to unmount it.
Perhaps someone can come up with a way to do that!
--Lee
fluxit; I've checked that, I pulled the USB drive while mounted, & no errors!
Strangely "ls -a /mnt/sda1" still displayed the dir. listing, so I couldn't use it to test for the USB.
Then I "umount /mnt/sda1" & it unmounted without errors & "ls -a /mnt/sda1" gave the empty dir. display ". ..".
Typeing "mount" shows the USB still mounted after unplugging it, after unmounting "mount" doesn't show it.
I'm not grasping what your saying about: dmesg, dmesg -c, and grep
I know how to use grep, but I'm not sure how dmesg fits in.
Could you work up a code scrap I could test out?
Strangely "ls -a /mnt/sda1" still displayed the dir. listing, so I couldn't use it to test for the USB.
Then I "umount /mnt/sda1" & it unmounted without errors & "ls -a /mnt/sda1" gave the empty dir. display ". ..".
Typeing "mount" shows the USB still mounted after unplugging it, after unmounting "mount" doesn't show it.
I'm not grasping what your saying about: dmesg, dmesg -c, and grep
I know how to use grep, but I'm not sure how dmesg fits in.
Could you work up a code scrap I could test out?
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Guys, there's a Window maker docapp that may do what you want.
I downloaded it awhile ago, don't recall where from.
The tarball is devmon-1.5.tar.gz
There's something else similar for Cds, called cdmon.
Attached tarball is the source.
I downloaded it awhile ago, don't recall where from.
The tarball is devmon-1.5.tar.gz
There's something else similar for Cds, called cdmon.
Attached tarball is the source.
- Attachments
-
- devmon-1.5.tar.gz
- (47.79 KiB) Downloaded 407 times
Barry,
devmon requires famhttp://oss.sgi.com/projects/fam/download.html it looks good though. I don't have my Puppy 2 dev environment up yet(devmon also needs a 2.6 kernel.)
sunburnt,
If you are still interested, here is that dmesg info. I don't know enough bash to help with code(I can understand it.)
devmon requires famhttp://oss.sgi.com/projects/fam/download.html it looks good though. I don't have my Puppy 2 dev environment up yet(devmon also needs a 2.6 kernel.)
sunburnt,
If you are still interested, here is that dmesg info. I don't know enough bash to help with code(I can understand it.)
- Attachments
-
- puppy2usb-dmesg.txt.gz
- (647 Bytes) Downloaded 437 times
Thanks fluxit & Barry, I'd like the USB removal detection to be as simple as the rest of my code (if it's possable).
It also needs to work in ALL Puppy versions (preferably), you'd think it'd be EASY to detect a known USB device.
If I can figure out how to do it useing std. Linux & Bash commands, it'll pretty much work anywhere.
fluxit; I tried: "dmesg -c" & got alot of info like your .txt file, but I couldn't make it work again!
After being run once, it won't give any more console output after that!
Starting a new xterm didn't help, so I'm not sure if it'll be useable.
It'll have to be run over & over, same as the repeted mount commands in my daemon code.
I'll just have to keep looking through what's available, but... I'll find a way!
It also needs to work in ALL Puppy versions (preferably), you'd think it'd be EASY to detect a known USB device.
If I can figure out how to do it useing std. Linux & Bash commands, it'll pretty much work anywhere.
fluxit; I tried: "dmesg -c" & got alot of info like your .txt file, but I couldn't make it work again!
After being run once, it won't give any more console output after that!
Starting a new xterm didn't help, so I'm not sure if it'll be useable.
It'll have to be run over & over, same as the repeted mount commands in my daemon code.
I'll just have to keep looking through what's available, but... I'll find a way!
Sorry, I should have explained. The "-c" means clear. My idea was that you would parse the output and then have a new set of "device messages" the next time you run it. I generated the content of that text file like so:
dmesg -c
(plug in thumbdrive)
dmesg -c #+copy&paste
(unplug thumbdrive)
dmesg -c #+c&p again
If your code was smart enough, you wouldn't need the "-c" switch at all. I just though it might be easier that way, of course "-c" would also eliminate dmesg's usefulness for other purposes as your daemon would be eating its contents continuously.
dmesg -c
(plug in thumbdrive)
dmesg -c #+copy&paste
(unplug thumbdrive)
dmesg -c #+c&p again
If your code was smart enough, you wouldn't need the "-c" switch at all. I just though it might be easier that way, of course "-c" would also eliminate dmesg's usefulness for other purposes as your daemon would be eating its contents continuously.
fluxit; I took a closer look at dmesg, & it detects the USB & I can grep for the line:
USB Mass Storage device found at 25
Unfortunately it doesn't tell me which device it is (/dev/sda1, /dev/sdb1, etc.).
If someone can tell me how to convert "25" into a device designation ..................... HELP!
This method seemed fast compared to my solution below.
Messing around I found out that the command: "probepart" DOES detect USB drives!
So between testing for the drive & testing if the drive was mounted, I was able to make it work!
The TEST file: "usb-auto_test" auto. mounts my USB drive when plugged in, & unmounts it when it's removed.
When it finds a USB drive it pops up an InfoBox saying so, & tells the mount point.
I also set it up to run ROX with the USB drive shown, I can shut this off if needed.
It takes maybe 5 seconds (more or less) to detect the USB & mount it, PC speed matters I'm sure.
USB Mass Storage device found at 25
Unfortunately it doesn't tell me which device it is (/dev/sda1, /dev/sdb1, etc.).
If someone can tell me how to convert "25" into a device designation ..................... HELP!
This method seemed fast compared to my solution below.
Messing around I found out that the command: "probepart" DOES detect USB drives!
So between testing for the drive & testing if the drive was mounted, I was able to make it work!
The TEST file: "usb-auto_test" auto. mounts my USB drive when plugged in, & unmounts it when it's removed.
When it finds a USB drive it pops up an InfoBox saying so, & tells the mount point.
I also set it up to run ROX with the USB drive shown, I can shut this off if needed.
It takes maybe 5 seconds (more or less) to detect the USB & mount it, PC speed matters I'm sure.
Last edited by sunburnt on Wed 02 Aug 2006, 06:05, edited 5 times in total.
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Sunburnt: (I'm not sure if the system doesn't do this automatically frequently enough, but, if not...) Wouldn't you need a "sync" to be run regularly to prevent data loss from what was supposed to be saved to the USB device?
Usually a "sync" is run before unmounting, so you need to be sure one was run shortly enough before the USB device was pulled out...
Usually a "sync" is run before unmounting, so you need to be sure one was run shortly enough before the USB device was pulled out...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
Dougal; Your probably right (of course), syncing shouldn't be done too much though.
Yeah, this is one of the many incongruities of the way Linux does things.
It'd be nice if a "Neo Linux" were made & they could fix all of them & toss the legacy stuff.
Say... isn't that what the MAC OS is?
I'm reworking it so hopefully it won't access the USB constantly, I'll look at putting a sync in the loop.
Yeah, this is one of the many incongruities of the way Linux does things.
It'd be nice if a "Neo Linux" were made & they could fix all of them & toss the legacy stuff.
Say... isn't that what the MAC OS is?
I'm reworking it so hopefully it won't access the USB constantly, I'll look at putting a sync in the loop.
sunburnt,
Your usb-auto does work with one of my flash drives(I only tried one.) It mounts the single vfat partition as umsdos however, providing short names only.
A reboot is required to regain the ability to see long names. Even closing usb-auto, loading MUT(which sees the partition as vfat,) then mounting with MUT will not show longnames.
--Lee
Your usb-auto does work with one of my flash drives(I only tried one.) It mounts the single vfat partition as umsdos however, providing short names only.
A reboot is required to regain the ability to see long names. Even closing usb-auto, loading MUT(which sees the partition as vfat,) then mounting with MUT will not show longnames.
--Lee
fluxit; I left the drive type designation off of the mount command "-t (type)" hopeing it'd mount the correct one.
Apparently Linux defaults to msdos if not told other wise, I seem to recall something about this.
Anyway... I'll add parsing for the partition type to it, & I'll check to make sure it's functional.
I need to get at making it at least recognize & mount more than 1 partition, & more USBs.
Up to 4 drives with up to 4 partitions on each of them is my hope.
Apparently Linux defaults to msdos if not told other wise, I seem to recall something about this.
Anyway... I'll add parsing for the partition type to it, & I'll check to make sure it's functional.
I need to get at making it at least recognize & mount more than 1 partition, & more USBs.
Up to 4 drives with up to 4 partitions on each of them is my hope.
New version: usb-auto_test-3
I added drive partition type parsing to insure it's mounted as the proper type.
I tested by copying a file with a 12 character name to the USB & from it, worked good.
ALSO, I added searching & mounting of up to 4 partitions on the USB drive.
But currently it still only does 1 USB drive at a time (sda1-4), I hope to get up to 4 USBs working.
All 3 of my USB drives are full of stuff & they're all only 1 partition...
I though about dumping one, or useing PartitionMagic to change it, nah... too much work.
I've been intending on getting another 1 or 2 of them, as they're so useful.
So the 4 partition parsing is untested & probably needs work.
To test it; run it from xterm, see what errors there are, & if it works.
Could someone try this out with a USB drive that has more than 1 partition?
I added drive partition type parsing to insure it's mounted as the proper type.
I tested by copying a file with a 12 character name to the USB & from it, worked good.
ALSO, I added searching & mounting of up to 4 partitions on the USB drive.
But currently it still only does 1 USB drive at a time (sda1-4), I hope to get up to 4 USBs working.
All 3 of my USB drives are full of stuff & they're all only 1 partition...
I though about dumping one, or useing PartitionMagic to change it, nah... too much work.
I've been intending on getting another 1 or 2 of them, as they're so useful.
So the 4 partition parsing is untested & probably needs work.
To test it; run it from xterm, see what errors there are, & if it works.
Could someone try this out with a USB drive that has more than 1 partition?
Last edited by sunburnt on Sun 06 Aug 2006, 05:41, edited 1 time in total.