Getting rid of a hanging network share in MacOS X

I originally posted this on the macrumors.com forum, so I’ll copy/paste the relevant parts over here.

ICEBreaker wrote:

Hi troubleshooters,

I wonder if you could help me troubleshoot a problem I have with my shared network volume. I have my iMac and PC connected to each other through the ethernet. The iMac is set to read/write the shared network volumes on my PC. The Finder is used to set up the SMB connection. Everything works fine. Mac applications are able to read and write files to the PC.

However, after a day or so (during which the PC has been kept on, while the Mac has slept) problems occur.

[…]
Attempts to read/write to the directory results in the following error message:

Sorry, the operation could not be completed because unexpected
error occurred.
(Error code - 1407)

Attempts to eject the shared volume results in the following error message:

A disk on 'pcxp' is in use and could not be ejected.
Try quitting applications and try again.

In terminal, I attempt to identify the open files:

lsof | egrep 'pcxp'

and get the following result:

lsof: WARNING: can't stat() smbfs file system /Volumes/Share
      Output information may be incomplete.
      assuming "dev=2f00000a" from mount table
Dock     96534 user [...] 896612 /Users/user/Shortcuts/pcxp

I try to kill the dock’s connection to the open file:

kill -9 96534

The dock is relaunched but the problem remains, this time with a new process number 97642.

When I try to restart my iMac, the desktop will close, and only my wallpaper remains. There, it will remain hung until I do a cold boot.

Can anyone figure out what is wrong. It’s pretty annoying to have to reboot my Mac daily.

Thanks a lot for your help!
JC

And here’s my reply:

LMAO, I was about to reply having the same issue. Then, while trying to reproduce the steps I took, I figured out the solution πŸ˜€

So I *had* exactly the same problem here between my Mac Pro and my XP PC. Same usage pattern (PC stays on, Mac sleeps every night). Fortunately, I only *had* this issue once in about two weeks, but it *was* annoying as hell!!

Some additional info I can provide on the issue’s behavior:

First off, I had 3 smb filesystems mounted when it happened. Let’s call them [smb1], [smb2] and [smb3] here. So I did the following:

  • At first,
    ls -al /Volumes

    -> yields only the local mounts, no smb mounts whatsoever.

  • Next, running
    sudo umount /Volumes/[smb1]

    -> HANGS, yes it blocks the terminal, tried to kill -9 the umount process without any success!!

  • At this point, even a simple
    ls -al /Volumes

    -> also HANGS the terminal.

  • lsof yields the following:
    lsof: WARNING: can't stat() smbfs file system /Volumes/[smb2]
          Output information may be incomplete.
          assuming "dev=2d000005" from mount table
    lsof: WARNING: can't stat() smbfs file system /Volumes/[smb3]
          Output information may be incomplete.
          assuming "dev=2d000006" from mount table

I was right about to give up, post this answer and hard reset the machine again when I tried the following:

sudo umount -f /Volumes/[smb2]

All of a sudden, the finder flashed a window (had no chance to see what it was) and the previously hanging ls and umount processes were gone! The finder GUI listed the smb shares on the remote server again and everything seems fine again!

So the steps to solve the issue would be:

  1. Run “lsof” in terminal
  2. See about what smb mounts it complaints
  3. sudo umount -f [any_failing_smb_mount]

Be aware though, that unmounting a filesystem using the force flag may produce unexpected results, but I guess it’s better than hard resetting the Mac and thus hitting the HDDs every day πŸ˜‰

Greetings,
Mike

Recovering lost photos

photorecEver heard about those incredibly expensive file recovery tools? For recovering photos, documents and all kinda stuff? Since I run Time Machine on my Mac and since I do full backups of my valuable stuff regularly, I was pretty sure I’d never need one of those… until today!

Yesterday evening, I took some amazing photos with my Pentax DSLR. The lighting was absolutely perfect and I was looking forward to importing them in iPhoto today. I don’t sync my SD card with iPhoto every time I take a bunch of pictures. I generally wait until I need some pics immediately to copy all the previous ones over to my Mac. So this morning, I wanted to import the current batch of photos from my SD card into iPhoto. Worked as always, except for the photos I took yesterday evening. Out of the dozen or so I took, there was only one left. And that one was corrupted (a bunch of weird horizontal lines within the pic). ALL the others from yesterday were gone. And since I selected “Delete Originals after import”, the SD card was…. empty!

Having the exact same conditions as yesterday is unlikely, especially with the f’d up weather here in Belgium. Therefor, I decided to take a look at the file recovery tools out there.

Being on a Mac doesn’t help when it comes to finding free niche products. That narrowed down the available tool palette. I ended up taking a look at two tools: LC-Tech’s Photorecovery and Christophe Gernier’s photorec. The former being a commercial tool, I used the demo. The latter is an open source command line tool.

Continue reading

iPhone/iPod Touch headphone connector freaking out

To start off like the hosts of my favorite intrernet podcast

OK, so here’s the deal

iphone-headset-jackFirst off, I must admit that I don’t use headphones on the iPhone very often and that I carry it in my pocket all the time without a protection case, which may be part of my problem…. But anyway, sitting at work I wanted to listen to something other than this one song I’m looping on YouTube for days now, so I took my iPhone and the earphones. Put them in, iPod app, hit play, song fires up oka…. wow wait what the hack is that strange sound I’m getting here?! Yeh, indeed it was the kind of sound you get when your headphone jack starts to die or isn’t fully plugged in. Basically right and left channels cancel each other out and the only thing left is the difference between them, which is usually some weird reverb’ish sound. Lead vocals are usually gone when that happens and the phase is totally screwed.

I was wondering because my iPhone and the earphones are barely half a year old. I started hitting the headphone jack to see if that’s the source of the problem. Bad idea: things got crazy at that point!! I got slammed with loud crack noises killing my ears and the iPhone went all crazy playing and pausing the player continuously till I stopped hitting the connector… WEIRD!! Damn, my iPhone broke!

So I went over to Patrick, a colleage of mine who works in the office next door, to tell him about what just happened as he’s a die-hard Apple user (like me :-)), who happens to own an iPod touch. We started trying his earphones on my iPhone… works. My earphones on his iPod touch… works. WEIRD! As we were running out of ideas, we started babbling about how there supposedly is an immersion indicator in that earphone connector on the iPod touch. Enough for me to take my iPhone out of the pocket and use Patrick’s desk lamp to see if my iPhone also has one. Since I’m visually impaired, Patrick took a look and… found that there was a ton of dust at the bottom of my iPhone’s headphone connector! Took that out with a paper clip, headphones back in and voila! My iPhone rocks perfectly again!! Well THANK YOU SIR! πŸ™‚

I love new media

Still Alive Remixes album cover

Still Alive Remixes album cover

Those who know me have certainly noticed me talking about my love for new media companies (especially Revision3) all the time. Yep, media is changing, no doubt about that. And to me, the increasing popularity and value of video games is part of it.

Remember the old days when you had your small little NES with shitty monochrome graphics and some quirky music banging from the speaker? Well, in case you didn’t notice, those days are gone.

Fast forward to today… in the BlueRay age, we have high definition handhelds and gaming consoles. On a sidenote, I just attached my 360 to the Surround Decoder I bought 2 weeks ago, and it’s absolutely epic πŸ˜€ But not only the playback has been improved, distribution has evolved too.

Nice little example happened toady, and let me highlight the elements that wouldn’t have been 10 years ago:

I was watching trailers and in-game-footage from Mirror’s Edge on YouTube. That game looks amazing and I’m definitely going to get it. I could buy it online right now, but I’ll wait until I’ll be in the shop next time and do it old school ;-). On some of the trailers, they had the “official Mirror’s Edge soundtrack” playing in the background while showing off amazingly realistic over-the-rooftops-action from the game (when did games start to have commercial-grade soundtracks again?). The combination of that song with those high definition video sequences instantly got me. As soon as I got home, I fired up the iTunes store and searched for Mirror’s Edge. NOTE: I was looking for music from Lisa Miskovsky, an artist I never heard about until today! Not only have I found the soundtrack, but a whole album of remixes, done (just for that game) by some of the best DJs around… AMAZING! Instantly bought a couple of DRM-Free versions of that soundtrack. Right now, I’m blogging about it, maybe someone will read this article, go check out the song on iTunes or Amazon and buy it there, who knows…

There are days where all that stuff just overwhelms me and I put on my happy pants πŸ™‚

Ok, nuff said, here’s the song I’m talking about:

Lisa Miskovsky – Still Alive (The Theme from “Mirror’s Edge”) [Radio Edit]

The iTunes Album “Still Alive (The Theme from “Mirror’s Edge”) [The Remixes]” is here.

Digg.com feature idea: longish story filter

Just a quick little idea that crossed my mind, I can live without it but maybe it’s inspiring… and since Kevin Rose always claims his job evolves around new Digg.com features, this little idea is for him.

First off,

Digg.com’s technical abilities are awesome! Page crawling on submission, scanning for potential story images, guessing duplicates and what not. So that little feature shouldn’t be too much of a problem for the geniuses behind it… πŸ˜‰

Alright so here’s the deal

Adding a filter for longish articles!

Detect an article’s length (either automatically or by letting the submitter graphically choose the div tag containing it), and compare it to a per-user-configurable length threshold. Articles exceeding that threshold are filtered. Add a quick on/off switch in a corner of the digg.com website and voila…

Why would I want to use that feature?

If you’re like me, there are days where you’re just lazy. On these days, I just have to open an article written in a small font, taking up more than a few screens and I’m out. So why not implementing a filter that does exactly this, right on digg.com?

iPhone Wishlist

Since Friday, I’m the official “iPhone User” at work. So it wasn’t long till someone here found an article entitled “50 reasons to back off of the iPhone” and sent it to me to hear my opinion about it. So I took all my Monday evening and commented on each of the author’s complaints.It’s in German but for the sake of completeness, here’s my response: 50-GrΓΌnde-widerlegt

Some of his points were simply wrong, others utopistic but with some he was totally right. That’s why I decided to wrap up the discussion and compile the iPhone users’ wish-list. Don’t get me wrong, personally I’m really satisfied with the iPhone, so this should just be an inspiration for Apple’s roadmap πŸ˜‰

In no particular order:

  • Copy & Paste / Clipboard
  • Calendar alarms should recur until acknowledged by the user
    Currently, honestly, it’s too easy to miss them.
  • Calendar event search function
    “When was that dentist appointment again?”
  • Undo
    Ok, not a killer feature but would make sense in some cases.
  • (More) direct File system access
    To save mail attachments or use the iPhone as a USB Drive (just like iPods)
  • Syncing of Notes
  • Video recording
    Ok, might be enabled by 3rd party Applications but should be an out-of-the-box feature, shouldn’t it?
  • Add landscape support in more apps
    For some people, it’s more comfortable to type in landscape mode (bigger keyboard), so why would that feature by reserved to Safari?
  • Option to always show today’s calendar events on the home screen
  • Bluetooth stack should be more open / extended
    The iPhone should handle standardized Bluetooth devices like sound devices, other cellphones, computers in general etc.
  • Realtime – Synchronization
    As long as the iPhone is connected to the Mac (/PC) through wire, changes on the Computer should be instantly reflected on the iPhone and vice versa. So if my iPhone has been connected for a few hours, I shouldn’t have to click “Sync” before disconnecting it to ensure that the data I have changed while the iPhone was connected is synchronized.

Digg if you agree πŸ™‚

iPhone 3G day!

Yesss… I got an iPhone 3G!!

However, it was not an easy tactic to get it on day one here in Belgium… here’s my iPhone story:

It was pretty clear from the Beginning that there wouldn’t be lots of iPhones on launch day this 11th of July here in our tiny little country. So I called 2 Mobistar centres (the Belgian carrier selling the device) and one Apple Premium Reseller (APR’s are also allowed to sell iPhones) yesterday morning. The main info was horrible: only 10 to 15 devices per store! Good news was everyone would follow a first-come-first-serve guideline, so no reservations (even though some stores took reservations but I have no idea what happened to those). The Mobistar Employee from the Mobistar center in LiΓ¨ge told me “We even have one customer that said he’ll be here 2 hours before opening tomorrow”. OK now, information was retrieved…

There were only 2 ways to react: Either sit back and wait till there will be more devices (probably in the next couple of weeks), or be there as early as possible. I’ve been waiting for a “legal” iPhone for more than a year now so, damn you apple haters, I took the second option.

And so I woke up this morning at 5:45 AM to head to the nearest APR in Verviers: “Cipiyou“, hoping I’d be the first-in-line! It was about 6:30 AM when I arrived… and yesssss I was the first one to show up! From there on, the battle was kinda over. I’d just have to wait the 3,5 hours until the store opened at 10:00 AM. This has probably been one of my nerdiest days EVER:

  • Sweaty (yesterday night it was sweltry like hell and no time for shower this morning ;-))
  • Unshaved (because I only shave like once or twice a week and, well, I haven’t for some days)
  • Diggnation Shirt (a *must*, yyyyhaaaa!)
  • < 5 Hours of sleep
  • Sitting on a pillow in front of the store with an umbrella because it was raining nearly the whole time

(Photo taken with my old Sony Ericsson P910i)

The first customer other than me showed up at 9:15 (store opens at 10:00). Okay okay, that was like 2:45 of “lost” time but dammit, I wanted that iPhone TODAY! From 9:15 forward, there was a new customer every few minutes… the Mobistar center down the street opened at 9:30. At 9:45 the 25 people that waited in line and couldn’t get one of the 10 iPhones came to the APR, hoping to get one here. I found myself talking with #2 and #3 in line… damn it’s cool meeting people with the same interests. I knew some of the folks from “the” belgium-iPhone forum ( http://www.belgium-iphone.com ), I had a blast!!

As announced, they opened at 10:00, I was the first one to get a brand new white 16 GB iPhone 3G, it was EPIC! I heard afterwards that there had only been 2 16GB iPhones at the APR and 3 16GB ones at the Mobistar center, the rest were all 8GB. Btw, people want 16GB iPhones, Apple. Build more of those!!

Now let’s all wish a long life to my iPhone! πŸ™‚

Does last.fm steal iTunes Store logins? – Bad coincidence or scary finding?

Some days ago, I decided to give last.fm a try. Since the website itself is pretty much useless without the standalone “scrobbing” app, I downloaded and installed it. I had iTunes running while it was installing and running it for the first time. To my surprise, last.fm’s Mac client closed iTunes without asking. No matter, I restarted iTunes right away and it was OK. A day later, I decided to quit using last.fm and deleted the app. During all that time, I didn’t close iTunes.

Now to the scary part: a few hours later, I wanted to log into my iTunes Store account to redeem a code and here’s what happened:

Obviously the login didn’t work. I tried a wrong password and got a different (more appropriate) error message so it wasn’t an authentication or connectivity issue.

What might not be obvious for everyone is that the red text references a Java exception and a term used in the Java Virtual Machine (the PermGen space). So far so good but the funny thing is that iTunes is not written in Java! Restarting iTunes solved the problem but thinking about it afterwards made me realize what might have been happening here…

I’m not accusing last.fm but looking at the facts, there’s a slight possibility that their client intercepts iTunes Store logins! (well I guess I might be accusing them somehow now…)

  • Having used the iTunes API myself (on windows), I know it’s not necessary to restart iTunes in order to get information about the track that’s currently being played. However, since last.fm isn’t supposed to do more than that, why in god’s name did it restart iTunes? Not asking for it makes it even more suspect…
  • After uninstalling the last.fm software, maybe some of its Java code from within iTunes was trying to gather my login data, throwing an error because it couldn’t reach the last.fm software for submitting it?!

I insist that this is total speculation, I know the last.fm software is open source and that it claims not being spyware but please, explain to me why some java code has something to do with “FieldName” in the iTunes Store login box?! You’ve got to admit that that’s suspect!! At least suspect enough for me to not use it anymore and to write this article.

Besides, -let’s be really paranoid for a second- even though the “good” source code may be available, nothing prevents them from compiling an “altered” version of their client and providing that for binary download. Most (non-geek) people don’t install from source anyway and, since it’s binary, no one might ever notice any difference. Oh, and did I mention this is still speculation?

Anyhow, the observations are all real and no one has proven the contrary so there is a slight chance I might be right. Now, if anyone has an explanation for this, feel free to reply!