It's entirely possible that I'm way off on this, and it's sort of a Ubuntu/Linux topic as opposed to Perl but here goes my stab at helping you along...

It seems to me that USB drives are demand-mounted by Ubuntu's desktop environment (the Gnome / Unity environment), and not fstab settings. My experience has been that the drives don't get mounted until I literally click on them from the Unity desktop. They do exist, however, in /dev/*, and as such, you can mount them manually, or even create an fstab entry.

It's possible your script needs to mount the drive for you rather than waiting for Gnome/Unity to get around to it.

If the USB drive uses a FAT based filesystem, you may need to mount with cifs as well.

Again, this is based on limited experience; I haven't fiddled more than a few minutes with plugging USB drives into my Ubuntu box, and that was not recently either. But to the best of my recollection, those were obstacles I discovered, and either using the GUI to demand-mount the drive, or manually mounting it were the solutions I used.

I don't really like having things mounted in /media anyway. It just doesn't feel linux-ish. But that's personal preference, and the good thing about mounting it yourself manually is you get to follow your own whim. I put them in /mnt/*. My NAS is set up to mount in /mnt/lsxhl (Linkstation XHL), for example.

Update: The following link discusses setting up auto-mount, as well as manually mounting USB drives. It does look like automounting of USB drives is controlled by nautilus. https://help.ubuntu.com/community/Mount/USB


Dave


In reply to Re: Opening a USB drive for storing info. by davido
in thread Opening a USB drive for storing info. by Steve_BZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.