WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: USB Automount for Kiosk  (Read 5872 times)

Offline frankdugan3

  • Newbie
  • *
  • Posts: 2
USB Automount for Kiosk
« on: March 12, 2013, 02:52:24 PM »
Hello. I hate to make my first post a help request for a particularly tricky and probably annoying subject, but I just can't figure this out on my own at this time.

What I'm trying to do: I have created a locked-down kiosk that boots to RAM over PXE on a number of nettop devices. It loads Chromium to a specific page in kiosk mode, and the user is blocked from doing much of anything, including closing it or switching to any other application. My organization uses PaperCut to enable a "webprint" feature, which basically allows a user to upload a file to the print server. In order for that to work on the kiosks, I need a way for the user to simply plug in a generic FAT32/NTFS USB drive and have it automatically mount to a generic point so that the user can use the file-browser pop-up from the browser to select a file from their drive. (Safe unmounting is not a priority, though would be nice if it unmounted after the drive was pulled.)

What I've done so far: I have done my best to search the forums already, but the most promising solution for my situation (http://forum.tinycorelinux.net/index.php/topic,9622.msg52676.html#msg52676) is a couple years old, and the specific udev rule bmarkus refers to (98-tc.rules) no longer exists, and I can't find a rule that has any kind of similar configuration to modify. Any advice?

An alternative solution when I was using Ubuntu Server as the kiosk was the program usbmount. It handled usb quite nicely, though the rest of the operating system was not very portable. If there is any possibility of getting usbmount to run on TC, or any similar program, that would be great. Any ideas on this?

Thank you in advance for any help you may offer!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: USB Automount for Kiosk
« Reply #1 on: March 12, 2013, 03:06:24 PM »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: USB Automount for Kiosk
« Reply #2 on: March 12, 2013, 06:50:06 PM »
Hi frankdugan3
Quote
... and the specific udev rule bmarkus refers to (98-tc.rules) no longer exists, ...
You can edit that file:
Code: [Select]
sudo editor /etc/udev/rules.d/98-tc.rulesMake sure you add   etc/udev/rules.d/98-tc.rules   to your backup.
If you want to read a much longer thread:
http://forum.tinycorelinux.net/index.php/topic,14977.msg86158.html#new

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: USB Automount for Kiosk
« Reply #3 on: March 12, 2013, 06:59:22 PM »
Hi Hi frankdugan3
Almost forgot:
Quote
(Safe unmounting is not a priority, though would be nice if it unmounted after the drive was pulled.)
You definitely want to make sure the device gets unmounted if it's pulled. If you don't, the system will keep on
creating more and more mount points as people plug and unplug their thumb drives.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: USB Automount for Kiosk
« Reply #4 on: March 12, 2013, 07:27:23 PM »
You must make sure it is unmounted BEFORE you pull it.

Offline frankdugan3

  • Newbie
  • *
  • Posts: 2
Re: USB Automount for Kiosk
« Reply #5 on: March 14, 2013, 02:27:43 PM »
Thanks for replies. I would to clarify a few points:

The users will only be uploading files, so read-only access to NTFS is perfectly fine, perhaps even preferred. My only issue is automating the process of mounting and unmounting.

Quote from: Rich
You definitely want to make sure the device gets unmounted if it's pulled. If you don't, the system will keep on
creating more and more mount points as people plug and unplug their thumb drives.

Exactly why it would be nice. What I meant by "safe unmounting" was that I'm OK with the idea of a user ripping out a drive before it is safely unmounted, so long as the mount point is removed afterwords automatically. This acceptable primarily because I will have them mount read-only anyway. In any case, I do plan on restarting these kiosks daily via a cronjob, so they will load fresh off of the boot image early every morning to clean up any user-generated messes.

Quote from: gerald_clark
You must make sure it is unmounted BEFORE you pull it.

I really have no way of forcing a user of this kiosk to click on a button to unmount before he or she yanks it out of the hub. Even if I did provide such a button for the handful of conscientious Linux users, I would still need it to automatically clean up after a device is removed without unmounting. Besides, as I mentioned above, I plan on mounting read-only, so data loss shouldn't be a problem.

Quote from: Rich
Make sure you add   etc/udev/rules.d/98-tc.rules   to your backup.

I have already done that, and ensured that it and the linked scripts had proper permissions, but it seemed to have no effect. Also, I am actually extracting the core.gz image and editing the filesystem directly, then packing it back up, so I'm not really using the backup feature.

For now, I will follow up on the links you posted, and read up on udev rules. I'll report back with my success or failure. Thanks again!
« Last Edit: March 14, 2013, 02:32:09 PM by frankdugan3 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: USB Automount for Kiosk
« Reply #6 on: March 14, 2013, 08:10:49 PM »
Even if I did provide such a button for the handful of conscientious Linux users
Last time I checked detaching a USB connected storage device under windows (xp), the procedure was neither requiring less effort nor time compared to Linux...
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline DaPh00z

  • Newbie
  • *
  • Posts: 1
Re: USB Automount for Kiosk
« Reply #7 on: April 18, 2014, 10:40:04 AM »
the specific udev rule bmarkus refers to (98-tc.rules) no longer exists, and I can't find a rule that has any kind of similar configuration to modify. Any advice?

When I unpack the core.gz file (Core 5.2), the 98-tc.rules is not in the udev rules folder, but upon inspection of the /etc/init.d/tc-config script it appears that it originates in /tmp and is moved into the /etc/udev/rules.d/ folder on bootup.  If you modify the 98-tc.rules in the /tmp/ folder then it seems to work as expected.
« Last Edit: April 18, 2014, 10:42:21 AM by DaPh00z »

Offline tlinxtode

  • Newbie
  • *
  • Posts: 1
Re: USB Automount for Kiosk
« Reply #8 on: May 05, 2014, 10:36:51 AM »
Hi all,
For my first post to the forum I wanted to ask if there is a short answer that works? Reading all the threads and side stories doesn't leave me with closure. Let's just say I am a newbie. I read a lot of posts and searched other forums.
As of today May 5 2014
1) what is the best solution to reliably automount a USB data drive, after boot?
2) is there a way to clear out dead system references to instances where the drive was  previously pulled without mounting or unmounting? Now that I know better, because I can see incrementing device references when I execute lslusb.
Thanks in advance!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: USB Automount for Kiosk
« Reply #9 on: May 05, 2014, 09:35:40 PM »
1. Core does not do that.  You will need to supply your own daemon to do that.
2. Never pull a mounted drive.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 362
    • Zendrael's home of projects
Re: USB Automount for Kiosk
« Reply #10 on: May 28, 2014, 03:37:22 PM »
Hi frankdugan3!

Try this: http://forum.tinycorelinux.net/index.php/topic,14977.0.html

Then post back your results here.