Jump to content
Sign in to follow this  
Harry_The_Bustard

Local Volume Puzzle

Recommended Posts

I downloaded a CSV file from the Internet to a known location within Documents and after opening it and editing it in Excel (For Mac 2004) I saved it as an Excel format document. Typically I didn't pay any attention to where it was saved - I usually moving things to an appropriate place when I've done - and on going to look for it I found it wasn't anywhere obvious and nowhere Spotlight could find it. I opened it again in Excel (using the list of recent files) and discovered it was in folder called "me" - where "me" is (not) my MobileMe account name and that had a parent folder of Volumes or volumes. (I forget the case and now can't get back there as I then saved the document elsewhere - i.e. somewhere I wanted it to be.) Relevant, perhaps, is that the "me" folder or the "V/volumes" one was low-lit in the save dialogue box. I'm puzzled why this arose and suspect that it's because I opened a Word document on my iDisk - though I didn't save it again - any explanation being useful but not what I'm after here. What I am after is guidance on how to delete the files in the "me" folder - I being ever the tidy one - having managed to at least get there in Terminal and see them via an "ls -l" command. I had a look at "rm" in "man" but, as ever, lost the will to live after the first few lines - Unix being something I've managed to hardly touch in my twenty years as a software developer - a career which I keep trying to put behind me but like most I have to earn a crust. It's probably dead simple - perhaps simpler than me typing all this - but my experience may be of interest to others. So, for the record, the file permissions are "-rw-r--r--". Actually, I'd also like to delete a folder which I created (via Excel) in "me" - just as a test - one which has the permissions "drwxr-xr-x". Finally, I promise to look at "rm" in "man" again when I get an answer - not least to try and verify it - perhaps even to re-learn something I used to know.

Share this post


Link to post
Share on other sites

/Volumes is a magic place where your OSX/Unix system "mounts" filesystems; a filesystem being an internal or external volume (e.g., the boot disk or an external firewire drive) or a network device (such as mobileMe) or a disk image (open .dmg).

 

For example:

me% cd /Volumes
me% ls -l
total 12
lrwxr-xr-x   1 root  admin     1 Jul 12 05:11 CloneHD -> /
drwx------@ 17 bc    bc      646 Feb 13  2008 Mailboxes
drwxr-xr-x@ 11 bc    bc      680 Jul 10 07:56 Xtra Data
drwx------   1 bc    bc     2048 Jul  7 19:15 car1son
me% 

(Here, "CloneHD" is my boot vol, "Xtra Data" a partition on an external firewire drive, "car1son" my iDisk, and "Mailboxes" an open disk image.)

You should be able to navigate to these in Finder by using "Computer" from Finder's "Go" menu (shift-command-C.)

 

Background explanation:

Unix (OSX) makes file systems available by "mounting" them on a "mount point" (in the local file hierarchy. So, when you open your iDisk, OSX creates a directory /Volumes/me to use as the "mount point", then mounts the iDisk file system on that directory. When the iDisk is ejected (disconnected), OSX unmounts that filesystem and then removes the directory.

 

Likely explanation:

I have encountered some applications before that, if they wanted to save a file to a folder (directory) that didn't exist, would create the missing directory automagically for you. That could be a way to make a user's life easier, or it could be a mistake; depends on your PoV. On OSX it would be "unexpected behavior," but I've seen it in adapted Unix apps. I don't know that MS Office is such an app, don't have it . If some app was planning to save a file to, say, /Volumes/me/Documents, e.g. the Documents folder of your iDisk, but (unknown to the app) you had disconnected (ejected) my iDisk, removing /Volumes/me, that app might automatically create /Volumes/me and /Volumes/me/Documents for you. Unfortunately, that wouldn't mount the iDisk on that mount point, it would just create a new hierarchy on what used to be the mount point, and dump files inside.

 

If you're curious, if there is already a /Volumes/me when you ask OSX to mount the iDisk, it will create the directory /Volumes/me-1 to use as a mount point. (Though it is possible to use Unix mount to place a filesystem on a mount point that contains local files, thus masking the local files from view while the filesystem is mounted. That can be a headache to sort out, but let's not worry about that.)

 

Solutions:

 

You should be able to get Finder to give you a window inside the /Volumes/me directory by using "Go to folder" from Finder's "Go" menu (shift-command-G) and then typing the Unix pathname into the dialog, e.g. "/Volumes/me". Use that to move any files/folders you might want to keep and empty the "me" folder.

 

You can remove an empty directory with the Unix "rmdir" command. E.g.

rmdir "directoryname"

 

I suggest using quotes around the directory name, because while your Mac likes files with spaces in their name, the Unix command line doesn't. (And, in the unlikely event this directory name contains a character that isn't alphanumeric (A-Z a-z 0-9), space, underscore or hyphen, it would be best to post the name here for further advice. The Unix command line has some peculiar uses for "special characters" that can cause big problems for the unwary tourist.)

"rmdir" will balk if there are any files or directories inside the directory you are removing. It only works on an empty directory. If you used Finder to clean out that folder first, it should work. If it balks, use the "ls" command to see what's inside the folder.

 

You can remove a file with the Unix "rm" command. In the simplest form:

 

rm "filename"

 

"rm" will balk if used that way on a directory.

 

ls -al "directoryname"

 

(The "-a" will list various hidden files that nix ordinarily doesn't list. "." and ".." always show up with "ls -a".

 

The following is dangerous if mis-applied. Proceed with extreme care: You can remove a directory, and everything in it, with the "rm" command by using the "-rf" option ('r' means 'recursive', 'f' means 'force', i.e., "do what I said", such as:

rm -rf "directoryname"

 

You should be very, very sure you want to do that, since Unix doesn't use the Trash and has no "undo". Therefore, I suggest you carefully use the ls command to check the content of any directory you plan t use rm -rf on.

ls -al "directoryname"

 

I suggest you use Finder to empty the /Volumes/me directory as described above, then stick with the "rmdir" command, because it's safer. If you must use "rm -rf", be really, really sure your Mobile Me isn't connected before issuing an "rm -rf" on that mount point. I'd pull the Ethernet cable and turn off the wifi, just to be sure.

Edited by car1son

Share this post


Link to post
Share on other sites

Thanks (again) for a very comprehensive and informative answer - and solution. (I was almost inspired to re-learn Unix - and I will brush up further on it given this experience - needs must and all that.) Although I've used the Finder's "Go / Go to Folder..." option a number of times it never occurred to me to use it here. I did so in order to access the rogue folder and cleared out the contents of it - as suggested - I having previously generated copies of what I needed before as mentioned in my original post. I then used the "rmdir" command in Terminal to try and delete the "me" folder - i.e. the undisclosed name of my MobileMe account - having taken great care to ensure that my actual one wasn't mounted with that name. (It was mounted as "me-1" and that disappeared after I ejected it in the Finder - though to be on the safe side, as you suggested, I disconnect from the Internet.) On trying this I was told the directory wasn't empty and followed your advice to nip in there and do an "ls -a" - the hidden file being a ".DS_Store" - one which I soon despatched with an "rm" command. (I could probably have got it via Finder with the help of TinkerTool but didn't.) The "me" directory was then readily removed - i.e. by moving up a level and using the "rmdir" command. On reconnecting to the Internet and re-mounting my iDisk (maybe automatically) it appeared in "volumes" as "me" by, of course, another name - i.e. my real one. As for the cause, well, I wonder if something got its knickers in a twist as you suggest can happen. AirPort, which I use for the Internet on the Mac mini (running Tiger) which I mainly use, often gets turned off so that I can use the Ethernet link to talk to another Mac mini and so get faster VNC and file transfers. (The "remote" one has a shockingly-unreliable AirPort link - something I kept meaning to get my local Apple Store to try and sort out but never did and now it's out of warranty.) On switching links - and accounts on the local computer as it happens - it sometimes hangs and whilst it might be due to me not disconnecting drives mounted across AirPort (the dreadful bane of Tiger) it isn't always and I've sometimes had to power the computer off and on to regain access. (N.B. If you have remote access to a hung Mac it's always best to try "sudo shutdown -r now" via ssh in Terminal in order to get a controlled shutdown and restart before resorting to the the power button - though you'll probably still lose anything which wasn't saved.) So, maybe it was an unmounted volume resulting from such - though quite my Excel chose to write to I don't know. I would look further into this but with me using an "out of date" application and operating system it's not worth the effort. (I will upgrade to Leopard before Snow Leopard arrives - something I've been meaning to do for ages but haven't found the time.) Finally, I don't maintain a local copy of my iDisk so anyone following this and maybe trying something similar may need to beware where that's mounted - if it is - light on which someone may wish to shine.

Edited by Harry_The_Bustard

Share this post


Link to post
Share on other sites

Glad it worked out.

 

I think the app I used to have this problem with was an old Unix open-source app with an OSX GUI grafted on. I had it keeping its files on an external HD which I only turned on for that project. Sometimes I'd launch the app, forgetting to turn on the external drive first, and it cheerfully replicated its expected storage hierarchy on my local drive under /Volumes.

 

As to shutting down the Mac via remote ssh access, sadly I do that all too often. I have the National Geographic TOPO! software for loading topographic maps, waypoints and routes into my Garmin eTrex Venture GPS for hiking. There's something twitchy there someplace, maybe in Topo, maybe in GPS. After loading the GPS, I can usually expect my Mac to stop responding to my mouse and keyboard. (Possibly the entire USB is locked out - the GPS connects via USB, as do the keybard and mouse.) So, I ssh in with the laptop. I have a whole folder full of Applescripts to tell various application I often have open (Mail, iMovie, iTunes, Opera, TextEdit) to save and quit ((via the osascript Terminal command) e.g.,

 

osascript -e 'tell application "TextEdit" to quit saving yes'

This will save any open documents with unsaved changes. (It won't help if you have a New document open that doesn't have a default file to save to.) You could change the "yes" to "no" if you didn't want to save open changes.

 

Then I run (via the osascript Terminal command) an Applescript to shut down: 'tell application "Finder" to shut down'. If I don't have any apps open with unsaved changes, that'll do it cleanly. (Doesn't require sudo, BTW.)

 

Since my iMac runs Leopard, I should be able to use "Back to My Mac" to take it over completely, but alas that would also require Leopard on my ancient TiBook 500.

 

These days I just try to anticipate that using Topo! to load my GPS is going to require a Restart and plan for it beforehand. Sigh.

Share this post


Link to post
Share on other sites

That's useful to know and I'll have a play with such scripts. As for dodgy applications - i.e. with an interface bolted on - I know of one (a world away from Mac OS X) which has more layers than a prehistoric river bed and all because the software house found it cheaper to add such rather than re-write the application - a very common practice which can often be a false economy as the poor buggers who support such will tell you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×