r2 - 20 Feb 2006 - 05:22:27 - ScottBalneavesYou are here: TWiki >  Ltsp Web  >  WorkInProgress > LtspFSAutomount

Automount support in ltspfs

In order to properly handle removable media in ltspfs, some kind of automount system is needed to mount volumes as needed, and unmount them (so that removable media can be removed) as needed.

User space automounting

In keeping with ltspfs' philosophy of doing as much as we can in userspace, where we have control over the process, the following is the scheme included within ltspfsd.

Determining filesystem types

  • when local devices are enabled with LOCAL_STORAGE = y in the lts.conf file, we make sure to load the vfat, msdos, and iso9660 filesystem modules, as well as the autofs module. That way, when mounting, we can simply specify the filesystem type as "auto", and let the kernel figure it out.

Media Insertion.

udev interaction.

  • On the availability of any block device within udev, we run the vol_id program to determine the volume id of the removable media.
  • We create a temporary fstab file, in /tmp/fstab.d. Each device gets an individual file, named after the devices volume id. If the device doesn't have a volume id, we make up a simple one.
  • The individual fstab files are cat'ed together to make an updated fstab.
  • mount request is made to lbus. Volume id is passed on.

lbus interaction.

  • lbus accepts mount request (on LTSP server)
  • lbus launches lbus_event_handler.sh
    • Directory is created in $HOME/Desktop with a nice name (usually the volume id).
    • ltspfs mount is performed back to thin client.

ltspfsd interaction:

  • Thin client's ltspfsd forks a copy.
  • in the network listener loop, we use select() to detect idle periods in the connection.
    • If a read/write request happens, and the media isn't currently locally mounted, we call /sbin/ltspfs_mount to mount the local media (based on the fstab entries that were created by udev (see above).
    • If there's no request for 2 seconds, unmount the device.

-- ScottBalneaves - 20 Feb 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback