Recent Changes - Search:

Bob Brandt

Linux Projects


Server Projects

Desktop Projects

Novell Projects


VMware Projects


N900 (Maemo) Projects


Python Projects


OpenOffice.org Projects


Other Projects


PmWiki

edit SideBar

mount.complete - Stupid Simple Mounting

The idea behind this was not that I am too lazy to look up the correct mount command to mount a directory. (Don't get me wrong, I am incredibly lazy) But that I had a couple of projects that would need to mount a variety of devices and files without knowing what exact the source was before-hand. I really wanted to call this project mount.auto, but there is already a project called autofs and I am neither creative enough to think of a better name, nor find a good synonym for "auto".

Basically I needed a All-in-one solution that would do the following:

  1. Mount any local device or image file without being told specifically what type it is.
  2. Mount any remote filesystem when given a URL (i.e. smb://something/somewhere)
  3. Try to mount a remote filesystem when given in Windows Format (i.e. \\server\share )
  4. If the mount point doesn't yet exist, create it.

Don't get me wrong, I completely agree that this could lead to problems! And that you should always mount persistent devices and filesystems with specific and non-ambiguous mount commands! However as I said before this was for a couple very specific projects which require users to mount remote Windows/Novell shares and local read-only file images. So I can tell myself that the risk is mitigated

The complete code is below, but to begin with I needed to find the code necessary to mount all the various options:

Code to mount a FAT device

mount -t vfat /dev/hda1 /mnt/mountpoint

or an /etc/fstab entry

/dev/hda1 /mnt/mountpoint vfat
Edit - History - Print - Recent Changes - Search
Page last modified on February 11, 2009, at 09:20 PM