Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

691517 Posts in 44842 Topics- by 9024 Members - Latest Member: formyson
Jump to:  
The Trombone ForumHorns, Gear, and EquipmentTechnology(Moderators: john sandhagen, Joe Jackson) Jeez, Mac sucks sometimes. Can anyone help?
Pages: [1]   Go Down
Print
Author Topic: Jeez, Mac sucks sometimes. Can anyone help?  (Read 1608 times)
0 Members and 1 Guest are viewing this topic.
play_louder

*
Offline Offline

Location: Sydney, Australia
Joined: Sep 10, 2003
Posts: 2009

View Profile WWW
« on: May 03, 2008, 06:56am »

I've had this mac now for about 6 months. For most things it's no different from my XP machine. It does computery things. Sure, it looks a bit different, but it's not really significant. It's not easier, or harder, to use. There's a few things that it does really quite well (like printing and wi-fi), and some it does rather badly (like region-coded DVDs and file management).

But the other day I discovered something it really, really sucks at. And it's something so basic it's almost astounding that it's so bad.

I bought a NAS hard disk to store stuff on. Very basic, just a big hard disk with an ethernet connector.

I managed to get the mac to connect to it - although it was a bit of a palaver - and thought all was well. Except that then I realised that when I turned it off and on again, it was no longer connected. So I managed to fix that bit with some Applescript which runs at log-in (surely there's an easier way than this?). However, this has two problems:
 - it tends to run before the network has initialised. This means it gives an error. and you have to hit 'retry'. Come on, this isn't hard, Mr Jobs.
 - it spawns a new finder window with an annoying 'ching'. I could do without this.

Then, without thinking, I shut my macbook. it went to sleep. I opened it up again and... the network share had gone. Yep, that's right, when it sleeps, it seems to unmount network shares, and doesn't remount them when it wakes up. This is STUPID.

So, I'm now trying to fix this one. I gather it can be done with some freeware called 'Sleepwatcher' which can be used to run a shell script when the machine goes to sleep / wakes up. Leaving aside how absolutely STUPID this is (does Apple really expect their users to write unix scripts to get their computer to do something so basic that every windows machine does with 2 clicks of the mouse?), I can't get them to work.

There is two scripts; one that unmounts the drive as it goes to sleep (this is recommended, as apparently sometimes sleeping the machine with an active network share mounted can cause it to hang. I know, astonishing isn't it?)

My script is very simple:

__________
umount /Volumes/BIGDISK/
__________

If I type this into the shell command line, it works. But for some reason in a script it doesn't always. It gives me an error:

: not currently mountedk/

sometimes. But not every time.

The other script is causing me even more problems. I'm trying to use the shell to send a command to the finder to connect the share.

This is the line I've got currently:

osascript -e 'tell application "Finder" to mount "smb://192.168.1.5/bigdisk/" 

This is based on googling stuff, but there's clearly something wrong here. I've tried various variants of the above from various internet examples, but get a range of errors from syntax through to 'cannot execute binary file'.

Can anyone help with this one? I'm tearing my hair out (or I would be if I had any). IT SHOULD NOT BE THIS HARD TO GET MY COMPUTER TO STAY CONNECTED TO MY NETWORK STORAGE. At the moment I'm reduced to having to hit a shortcut on the dock to reconnect the disk each time I open the lid and the machine wakes up. Or disable it going to sleep, which kind of defeats the purpose (and isn't much help when on battery power).

HELP!
Logged
Erling

*
Offline Offline

Location: Copenhagen, Denmark
Joined: Oct 15, 2002
Posts: 1483
"Erling Kroner"


View Profile WWW
« Reply #1 on: May 03, 2008, 08:11am »

Hum, sounds strange. All I did when I got myself an external HD was hook it up via FireWire and there it wa and is. After sleep, after shutdown, anytime unless I unmount it and shut it down of course. Very simple . . . as it should be
Logged

boneagain
*
Offline Offline

Location: Richmond, VA
Joined: Aug 4, 2007
Posts: 1016

View Profile
« Reply #2 on: May 03, 2008, 09:15am »

Playlouder's problem isn't with Firewire, but with "NAS" (Network Attached Storage.)  The Firewire disks are great... Apple even let's you boot of them.

The problem with NAS is that they usually use something equivalent to "NFS" (network file system.)  That means that the entire hardware stack AND the network stack have to come up and be recognized before the storage can be recognized.  It's really not much different from having a SMB share (via SAMBA) served from a Windows machine on the network. 

And there are ways of doing the equivalent of FSTAB automount entries to bring BOTH types of mounts back on, but after thinking about it, I decided it wasn't worth my effort.  The deciding factor was "failure modes." There are SO many combinations of things to go wrong with storage mounted on an outboard network storage device that as soon as I'd figured out one script, I had to adjust, add on others (for things that really couldn't be handled syncronously in the one script) and create a real rat's nest of conditional contingencies.  For example, the big reason NFS came about was to allow multiple machines to share the same disk.  EVERYTHING needs maintenance from time to time.  But since the disk is shared, you need to be very careful about just yanking the shared disk out without being sure all those sharing it have finished with it.  So, for example, a snoozing macbook that HELD the share would make it unwise to EVERY maintain the NAS device... to much risk that something important was reading or writing.... the NAS would know it had an allocation oustanding, but wouldn't know if it was active.  The share SHOULD go away when you snooze.  But that could be scripted around, especially if there are no other users of the device and you can be sure nothing is held in buffers for the device when you snoozed (you wouldn't want a half-written buffer of your once-in-a-lifetime photo of you and Joe Alessi to dissappear because the NAS was turned off before the snoozing mac had a chance to flush buffers during the unmount, would you?) 

Don't get me wrong: there are some VERY clever folks out there who have put together quite robust mechanisms for handling both SMB and NFS networked disk.  It CAN be done.  But there are little prices to pay that have NOTHING to do with Apple and have everything to do with the "standards" around SMB and NFS, which include things like retry timeouts that can lead to long OS restarts waiting for things that aren't necessarily even turned on. 

Given the price of Firewire and USB 2 external drives, and how little time I have to practice as it stands, I find it better to do specific shares directly to my wifes Mac only when needed, eliminate Windows machines from the premises, and plunk big stuff out via firewire or USB. 

One last word on NFS: on those occasions (on the job) where I HAD to use it I was VERY glad it was there. That being said, I've NEVER seen a flawless NFS installation.  I have worked with some awesome UNIX administrators whose command lines I am not worthy to behold.  As you probably figured out from the above, I really don't agree that this is a reason to say that Mac sucks.  Neither would I say that NFS or NAS in general sucks either.  When it's the nrdy way to address a problem the only alternatives will exhaust your bankroll, patience, and beer budget for friendly local admins in short order (the guys who sell robust file sharing systems get big bucks and have lots of complexity to handle the kinds of things I mentioned above and more.)

Erling, I hope your Firewire is leading to every more great arrangements for us to listen to!

play_louder, I wish you luck with the automounting. If you are using NAS to share disk among several computers I believe you will find the wonderful learning opportunity worth the result.  But if sharing is not at the heart of your requirements you might consider selling the NAS and getting something more directly designed for the task at hand. 

Logged

Dave Adams
Staunch admirer of all who still make a living at this!
Erling

*
Offline Offline

Location: Copenhagen, Denmark
Joined: Oct 15, 2002
Posts: 1483
"Erling Kroner"


View Profile WWW
« Reply #3 on: May 03, 2008, 09:36am »

Dave I didn't even (still don't) know what NAS signified - glad I'm using firewire. And thanks for your nice words about my work. Have two, no three, new cd's coming out soon - or at least one in July the others in the fall, prolly.
Logged

rlb
Demiurge

*
*
Offline Offline

Location: Inferno, level 7
Joined: Apr 16, 2000
Posts: 8012
"Hails of derisive laughter, Bruce!"


View Profile WWW
« Reply #4 on: May 03, 2008, 09:52am »

Boneagain is unfortunately correct, and he describes the SMB mount analogy perfectly.  A NAS is a different animal than your simple external hard drive.  Thar's a network involved, which involves protocol translation, etc., etc., etc.  While there are other ways to skin this particular cat, your solution, PL, is as good as any.

I also concur w/Boneagain's fstab recommendation, although as he correctly notes, anything that is even remotely "NFSish" will have quirks, especially wrt the mounting and availability of the volume.

I have *three* NAS applicances on my home network for various kinds of storage, but then again, I don't have any Macs nor notebooks that habitually access the NAS devices--just BSD and Winders--and they don't get rebooted very often.

r
Logged

Dr. Richard L. Byrd, Forum Director
Every man, wherever he goes, is encompassed by a cloud of comforting convictions, which move with him like flies on a summer day.
   --Bertrand Russell, 1950
play_louder

*
Offline Offline

Location: Sydney, Australia
Joined: Sep 10, 2003
Posts: 2009

View Profile WWW
« Reply #5 on: May 03, 2008, 05:33pm »

In an update to this sorry tale; I turned on my Mac this morning, and the script ran to connect to the NAS.

But for some reason, as far as the mac is concerned, it has changed share name.

It was called smb://storage-94e4/bigdisk/

Now it is called: smb://storage-94e4/bigdisk-l/

I haven't changed the samba name at the NAS, and both my windows laptop and linux desktop are connecting to it fine as just 'bigdisk'.

The whole point of this was to use the NAS as my general repository for documents, music etc, so I can access the stuff I am working on from any of the machines. Clearly this has now just stuffed it up royally, as it now thinks various documents have vanished as it's still looking for them on the old share name.

It seems mac just doesn't want to be a part of this modern, networked world. Oh well. Mac was good whilst it lasted. I guess I'll just have to install XP on this macbook and be done with it. Either that or just give up on this whole NAS idea.
Logged
play_louder

*
Offline Offline

Location: Sydney, Australia
Joined: Sep 10, 2003
Posts: 2009

View Profile WWW
« Reply #6 on: May 03, 2008, 05:41pm »

Update #3

Have restarted the mac again, and now it is working again.

I still think this is utterly ridiculous; not because network shares aren't somewhat complex, but simply because Apple, the paragons of all things easy to use, clearly haven't even considered that people might want to use Mac in a networked environment, and what that might mean for usability.

I can see why no-one touches these things in a corporate environment!

(Oh, and why does the toolbar in the finder seem to randomly vanish sometimes?)
Logged
josh roseman

*
Offline Offline

Location:
Joined: Dec 15, 2004
Posts: 1543

View Profile WWW
« Reply #7 on: May 03, 2008, 05:52pm »

Quote
(Oh, and why does the toolbar in the finder seem to randomly vanish sometimes?)
do you mean the dock?  go under the apple menu, you can adjust the settings there easily.

We do a lot wireless networking at our place, using OSX's native personal file sharing and FTP access. 
They've been developing dedicated products with this in mind,including time capsule..
if you have a mac-centric work environment, they offer many serious networking products, check here.

Not sure what apple recommends for NAS implementation, you may want to check with them directly.

We'll be spec'ing out a superfast system for large shared media on a SAN,
may augment that with an ethernet-based system, will let you know how it goes.
Logged

Todd Jonz
Department of Redundancy Department

*
Offline Offline

Location: Vermont
Joined: Sep 14, 2003
Posts: 3038

View Profile
« Reply #8 on: May 04, 2008, 12:32am »


Play_louder writes:

> I bought a NAS...Very basic, just a big
> hard disk with an ethernet connector.

Um, you forgot to mention an operating system and probably several different network stacks.  Not "very basic" at all, actually.

If you dig around in Google a bit you'll quickly discover that some NAS devices play nice with Mac OS and some don't.  There are a lot of SMB implementations out there, and some are better than others.  If your NAS device doesn't advertise itself as "Mac compatible" you can probably expect to have problems.

> when I turned it off and on again,
> it was no longer connected.

This isn't particularly unusual.  I've experienced similar problems in the past with NFS volumes mounted from one Linux system onto another.  Most clients expect network mounted volumes to be available all the time.

> when it sleeps, it seems to unmount network shares,
> and doesn't remount them when it wakes up.

You're assuming that it was the client that unmounted the device.  How do you know that the NAS didn't drop the connection when the Mac went to sleep?  Is the Mac configured to wake on network events?  If not, it's perfectly conceivable that the NAS attempts a handshake with its clients after a period of inactivity, and if the client doesn't respond the NAS drops the connection.  After all, a good NAS wouldn't let its connection table become cluttered up with a bunch of stale entries.

> I turned on my Mac this morning, and the
> script ran to connect to the NAS....
> It was called smb://storage-94e4/bigdisk/
> Now it is called: smb://storage-94e4/bigdisk-l/

This strongly suggests that the volume was already mounted when the script ran.  Mac OS often appends "-1", "-2", etc. to a file name when a conflict arises rather than throwing an exception and raising a dialog box.  It's possible that the NAS doesn't permit multiple mounts of the same volume from the same client and dropped the connection for the first mount when the second one was established.

You haven't given us much information about how you've gone about configuring your Mac to access the NAS, but it sounds like you've used the traditional facilities you would use on a BSD system.  While traditional UNIX methods may work to some extent with regard to some services, in many cases these methods are deprecated and have been replaced by newer, native methods in Mac OS ('crond' vs. 'launchd' is a good example.)

Although I've never configured Mac OS to work with a NAS, after a bit of Googling it appears that the recommended method is to do so using NetInfo Manager rather than "/etc/fstab" or a login script.  If this isn't the approach you've taken, you might want to give it a try; it's likely to solve the problem of the device getting mounted before the network has finished initializing.  Here are a couple of references I found with a quick Google search that may help:

Mac OS Client Access to NAS

Automount SAMBA (Windows) share points at boot

A more focused search would probably turn up some additional references that you might find useful.

If all else fails, contact Apple support.  Like any tech support line their usefulness varies in inverse proportion to the complexity of the problem, but this doesn't strike me as a particularly esoteric problem.  They may very well have a solution at their fingertips that addresses your problem directly.

> I guess I'll just have to install XP on this macbook

If you dislike Mac OS so intensely, this sounds to me like the best solution.

> Either that or just give up on this whole NAS idea.

If you don't need the additional storage capacity of the NAS, have you considered simply installing your shared files on the Mac and enabling Windows File Sharing so that you can access them from your Windows box?

> It seems mac just doesn't want to be a
> part of this modern, networked world.

I don't know this to be a fact, but I have a hunch that Mac OS accommodates SMB access to a FAT file system a lot better than Windows accomodates AFP access to an HFS+ file system.

> why does the toolbar in the finder
> seem to randomly vanish sometimes?

Is it possible that you inadvertently clicked the clear jelly bean in the upper right hand corner of a Finder window?  This will cause the toolbar to disappear, and it will stay disappeared in all Finder windows for that mount point until you click it again.


Logged



Change Congress
play_louder

*
Offline Offline

Location: Sydney, Australia
Joined: Sep 10, 2003
Posts: 2009

View Profile WWW
« Reply #9 on: May 04, 2008, 02:39am »

Thanks Todd, that had some very useful pointers in it!

I'm mounting this as a samba (smb) share. Once mounted (however I do it) it works just fine. The problem is mounting it seemed to cause a new window to spawn, and when I close the lid of the laptop and open it again (ie send the machine to sleep (which is the default behaviour for mac, and can only be changed with yet another 3rd party hack)) the network shares have vanished.

All my previous googling had only turned up unix and applescript methods, so I had a play around with netinfo. No joy, couldn't get it to do anything.

However, on one of the pages was a useful link to an app caled 'AutoMountMaker' that mounts network shares based on scripts. And it does it without spawning finder windows. And you can specify a delay prior to mounting.

This immediately solved two problems - by executing the 'AutoMountMaker' an log-in, I can connect to the share after waiting a few seconds for the wifi to initialise, and just have it silently appear in the finder window.

The I got thinking. Perhaps I could also call this script from the shell. Well, you can't directly. But you can using Applescript. So I created an applescript that calls the script, and then wrote a shell script that calls the appletalk one.

Then I installed another piece of freeware called 'Sleepwatcher' that calls scripts when the machine wakes up.

So when the machine wakes up it now:
 - runs sleepwatcher which
 - runs a shell script that
 - calls an Applescript that
 - runs the automountmakerscript that
 - runs automountmaker so that it
 - mounts the shares after a 5 second delay

It ain't elegant, and I'm sure it should be easier than this, but it does exactly what I want it to do. It needs 2 extra pieces of software and three scripts in three different languages (!) so it kind of fails the 'my mum could do it' test, but hey. This is an easy to use computer, right?!!


Anyway, thanks everyone for all your help. You certainly gave me some useful pointers which helped solve my problem!



Logged
rlb
Demiurge

*
*
Offline Offline

Location: Inferno, level 7
Joined: Apr 16, 2000
Posts: 8012
"Hails of derisive laughter, Bruce!"


View Profile WWW
« Reply #10 on: May 04, 2008, 02:30pm »

*bows to Todd's superior Macness*

On the other hand, I do rather like the simplicity of

jocasta /home/rbyrd$ mount -tsmb antigone:/disk2 /antigone
Logged

Dr. Richard L. Byrd, Forum Director
Every man, wherever he goes, is encompassed by a cloud of comforting convictions, which move with him like flies on a summer day.
   --Bertrand Russell, 1950
boneagain
*
Offline Offline

Location: Richmond, VA
Joined: Aug 4, 2007
Posts: 1016

View Profile
« Reply #11 on: May 04, 2008, 03:00pm »

*bows to Todd's superior Macness*

On the other hand, I do rather like the simplicity of

jocasta /home/rbyrd$ mount -tsmb antigone:/disk2 /antigone

Whoaa RLB!! Are you trying to say that mount has parent-child complexes, or is a Greek tragedy waiting to be written, or what?  Hope that's not one of the forum file systems ;-)

I also bow to Todd's superior Macness... and play_louder's perseverance in solving the problem rather than tossing the OS.

And to Todd's point... I've found it a LOT easier to hitch up to SMB from Mac than to hit either NFS or the Apple file system from Windows.  If you take the interesting stuff play_louder went through as the "easier" it gives an idea of my past experiences.  Haven't had to do it for some time.  Don't want to. 

Way to go, play_louder!
Logged

Dave Adams
Staunch admirer of all who still make a living at this!
Todd Jonz
Department of Redundancy Department

*
Offline Offline

Location: Vermont
Joined: Sep 14, 2003
Posts: 3038

View Profile
« Reply #12 on: May 04, 2008, 05:36pm »


clytemnestra% rm -rf /agamemnon


Logged



Change Congress
Steve McGovern
*
Offline Offline

Location: Woburn, Massachusetts
Joined: Jan 12, 2003
Posts: 1932

View Profile
« Reply #13 on: May 04, 2008, 08:07pm »

Whoaa RLB!! Are you trying to say that mount has parent-child complexes, or is a Greek tragedy waiting to be written, or what?

Simpler than that.  When the disk isn't mounted, the data is gone.  When the disk gets mounted, the data gets anti-gone.
Logged

Practice musically so the neighbors don't complain.
rlb
Demiurge

*
*
Offline Offline

Location: Inferno, level 7
Joined: Apr 16, 2000
Posts: 8012
"Hails of derisive laughter, Bruce!"


View Profile WWW
« Reply #14 on: May 04, 2008, 11:00pm »

Whoaa RLB!! Are you trying to say that mount has parent-child complexes, or is a Greek tragedy waiting to be written, or what?

oedipus /home/rbyrd$ nohup /usr/local/bin/gouge -iS >/dev/null 2/dev/null &

Logged

Dr. Richard L. Byrd, Forum Director
Every man, wherever he goes, is encompassed by a cloud of comforting convictions, which move with him like flies on a summer day.
   --Bertrand Russell, 1950
BWarner
Formerly Phantom_Boner

*
Offline Offline

Location: Baton Rouge, LA
Joined: Dec 10, 2003
Posts: 2320
"Once more, this time with feeling."


View Profile WWW
« Reply #15 on: May 05, 2008, 01:22am »

Groooooaaan........

 Bad dog.  No Biscuits.

Speaking of 127.0.0.1...

[Edit] Mine wasn't nearly as funny... ePIcfAI1zorzz_FTLuze!11!!!   Yeah, RIGHT.

[Edit x2] Sorry.. It's early.  I somehow thought that was remotely funny.  Lord, please forgive the sin I have committed, and don't forget to condemn all who use such terminology with any semblance of seriousness.
Logged

Brian Warner

iTrombone.com
jmoore88

*
Offline Offline

Location: Philadelphia, PA
Joined: Oct 25, 2006
Posts: 517

View Profile
« Reply #16 on: May 05, 2008, 11:58am »

If you don't mind me asking, why do you choose to use NAS?
Logged

MM- Temple University '12
BM- Louisiana State University '10
Acadiana Symphony Orchestra- 2nd trombone
Todd Jonz
Department of Redundancy Department

*
Offline Offline

Location: Vermont
Joined: Sep 14, 2003
Posts: 3038

View Profile
« Reply #17 on: May 05, 2008, 08:52pm »


> Todd's superior Macness

Hey, I'm just another UNIX geek who's been hanging around in Mac OS long enough to have picked up some of the local jive....


Logged



Change Congress
play_louder

*
Offline Offline

Location: Sydney, Australia
Joined: Sep 10, 2003
Posts: 2009

View Profile WWW
« Reply #18 on: May 07, 2008, 05:19am »

I bought the NAS unit because it was cheap. I wanted to be able to keep all my stuff in one place, so that it's accessible from any of the computers. The laptops get switched off too much. I could use a share on the desktop, but then I'd have to leave it on all the time, and it whirrs (and is in the guest room). Plus which it's quite elderly, and none too fast.

The NAS is very small (basically a HD enclosure with an ethernet port), quiet and I thought would be easy to set up.

Although it's not. This morning it was all broken again.  :cry:   The NAS had somehow switched on it's DHCP server, and had grabbed the IP addresses of all the PCs. This meant the internet wasn't working, as the PCs were on a different subnet to the router.

I hope this NAS box thingy isn't going to keep doing that...
Logged
Pages: [1]   Go Up
Print
Jump to: