Automount NAS

Discussion in 'Mac OS X System & Mac Software' started by scruff, Feb 24, 2005.

  1. scruff

    scruff Registered

    Joined:
    Feb 24, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi all. Can anyone tell me how to set up a Mac running 10.3 to automount my NAS during boot? I store all my mp3's on this NAS device and set up iTunes to rip tunes to there, but it always reverts to the default iTunes folder after boot. I am assuming it doesn't see the NAS so it heads to where it knows, but I don't want to have to remember to mount this thing every time I start the computer.

    Ideas?

    Scruff
     
  2. thewelshman

    thewelshman Registered

    Joined:
    Feb 22, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    UNIX Administrator
    Location:
    Aberdeen Scotland
    A pointer maybe to take a look a what happens when you make a link to a large local disk (called iTunes). The link is done from the "terminal.app" or UNIX prompt, and is in /Users/USERNAME/Music

    cd /Users/USERNAME/Music
    mv iTunes orig.iTunes
    ln -s /Volumes/iTunes iTunes

    I use this to link all users to the same Library on the same computer.

    Ok /Volumes/iTunes is another locally attached disk, and ok automounter is not employed here. Its not easy to see whats the best way to do this under MacOSX, do I use UNIX or do I use the GUI to do it. Automounter in the generally accepted sense requires a NIS master with all the maps to the filesystems on remote machines, you may not have this.
     
  3. Robn Kester

    Robn Kester I heart nothing

    Joined:
    Sep 29, 2000
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Peeon or IT guy depending
    Location:
    A house
    How is your NAS device mounted normally? As AFS? NFS?

    I assume a simple AppleScript could easily automount the shares at boot time for you in these cases.

    THis is the applescript I use for at home for my AFS drives on my server (a g4 mac):


    tell application "Finder"
    mount volume "afp://machinename/volumename" as user name "username" with password "password"
    end tell

    i just made it an application and added it to my startup items. i also leave it whre I can run it if needed.

    Not sure if it works the same for NFS but should, then again I chould be wrong.

    Does this help?
     
  4. thewelshman

    thewelshman Registered

    Joined:
    Feb 22, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    UNIX Administrator
    Location:
    Aberdeen Scotland
    "Robn" sounds good, the nfs format looks to be very similar.

    mount volume "nfs://machinename/volumename /Volumes/volumename" or close to something like that.

    One thing though, as I've not used Applescript, how do you turn it into an AppleSctipts into Application? Thanks
     
  5. Robn Kester

    Robn Kester I heart nothing

    Joined:
    Sep 29, 2000
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Peeon or IT guy depending
    Location:
    A house
    It's really quite simple and you'd slap yourself for asking... when you Save, select the file type as Application and it's that easy.

    The whole process is easy really... open Script Editor, paste that code into the window, change the machine name, volume name, name and password, repeat for each drive. I believe for nfs, as above you just change afs to nfs. then click Compile, then Run to make sure it works. If it does, save it as above. Then add it to your startup items and you are golden.

    It doesnt do any checks for if the machine or volumes are actually there, so it will error if they arent. Im sadly also new to AppleScript and this was provided to me when I posed a similar question elsewhere.

    it looks so amazingly simple, im really surprized I havent picked up AppleScript ages ago. y aknow?
     
  6. Carlo

    Carlo All your base are belong

    Joined:
    Apr 14, 2001
    Messages:
    160
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Systems Admin (in a windows world.. uck)
    Location:
    Sydney, Australia
    Is their a way to do this so it keeps the password encrypted in the users keychain.

    I am only new to applescript, its something i figure I should learn as it looks to be pritty easy.
     

Share This Page