Yumbrad logo

10.30.10

Mac Mounting Misery

Filed under: — Bradley @ 9:11 pm

For months now, I’ve had a problem with this Snow Leopard-running iMac. I’ve been regularly updating it, done several repair permissions on the system disk, and nothing had fixed it. The problem is VERY annoying, and manifested itself this way: anytime I downloaded any disk image file (.dmg) and double-clicked it, it would not open, simply saying “No mountable filesystems”. Furthermore, my firewire hard drive would not mount automatically – I had to both “hdiutil attach -nomount /dev/disk1″ and “sudo mount -t hfs /dev/disk1s2 /Volumes/bitpool” every time I rebooted, and created a script to do this on reboot. At the time, I didn’t realize it was related, but camera memory cards would also not show up when I plugged them in to my reader. This reader had been having problems with it’s built-in iPhone dock, so I bought a new card reader – but the new one wouldn’t allow cards to be read either.

Well, I needed to import some pictures and was tired of plugging in the SLR and eating up its battery, so I did a “sudo mount -t msdos /dev/disk2s1 /tmp/card” … Aperture saw the pics, but didn’t show previews, and when I tried to do the import it failed, saying “/Volumes/card/EOS_DIGITAL…blah.CR2 failed to import” .. Hm! Aperture assumes whatever’s mounted must be under Volumes and have the volume name in it, huh? Ok, I’ll just create an EOS_DIGITAL directory in Volumes and manually mount it there… “Operation not permitted” .. Ok, SUDO mkdir .. “Operation not permitted” !! At this point, I started looking into ACLs, and ended up removing all the ACL entries on the /Volumes directory (figured it probably wouldn’t hurt, even if they were supposed to be there). Still no dice. I did another repair permissions, and it said the ACLs on /Volumes was wrong, but couldn’t fix it. Did some more searching and came across the chflags command, and “ls -lO” to see flags. My /Volumes directory had the uchg flag set! Again, didn’t know if that was supposed to be there, but killed it with a “chflags nouchg /Volumes”. Boom, mkdir works! I unplug my card reader and plug it back in… Boom, card shows up! I double click on a .DMG I hadn’t been able to open in months. Boom! I did another repair permissions, and it was now able to restore the ACLs on /Volumes – everything still works, so it must have been that uchg flag. I have no idea how it got there, but this difficulty was actually much harder to troubleshoot and solve than the issues I’ve had in Windows and Linux.

Here’s a very partial list of the google search terms I used to *try* to solve this, to no avail. Maybe this post will help someone else since I finally stumbled on the answer…
request from non-root process kextload “not allowed”
“failed to load” ufs.kext not privileged
hdid attach failed no mountable file systems dmg sudo
“mount_hfs” “permission denied”
mount_hfs hdid “attach failed”
(mount_hfs OR “mount -t hfs”) works (“mount -a” OR “mount -av”) ufs
(mount_hfs OR “mount -t hfs”) attach +nomount dmg
mac nothing automounts anymore
mac usb automounts anymore

1.18.10

Emacs / Terminal Misc Fixed font on Mac OS

Filed under: — Bradley @ 5:25 pm

I’ve done this a couple times now, and forgotten what I did, so I’ll blog it this time for me and anyone else. I like the misc-fixed-semicondensed 6×13 font that is the default for xterm in Linux. I eventually got this working well in Mac OS for emacs. Here are the steps:

1. Download and install the MiscFixedSC613 TTF font from http://www.ank.com.ar/fonts/.

2. Add something like the following to your .emacs (this also swaps “command” and “option”, so that meta is next to space, which is how I like it – can still Cmd-V paste from mac clipboard using option key):

(defvar macosx-p  (string-match "darwin" (symbol-name system-type)))
(unless (eq window-system nil)
  (cond (macosx-p
	 (setq default-frame-alist '((width . 110) (height . 89) (top . 22) (left . 0)
				     (background-color . "black")
				     (foreground-color . "#d0e0e9")))
	 (setq mac-option-modifier 'super)
	 (setq mac-command-modifier 'meta)
	 (set-face-font
	  'default "-apple-miscfixedsc613-medium-r-semicondensed--12-100-72-72-m-100-iso10646-1")
	 (setq mac-allow-anti-aliasing nil)))
)

3. Unfortunately, this didn’t really fix anti-aliasing for me – the outlines of my o’s and 8′s were ugly and filled-in, like they’d been flood filled. I also had to do this in terminal:

defaults write org.gnu.Emacs AppleAntiAliasingThreshold 100

Now, everything looked great!

7.21.05

GCC likes to break your code

Filed under: — Bradley @ 6:34 pm

I was trying to write a macro that, based on the endianness of the target machine, would either index an array, or directly access a struct field…

#if __BYTE_ORDER == __BIG_ENDIAN
#define GET(x, fieldname) ((struct x*)x)->##fieldname
#else
#define GET(x, fieldnum) setfield(x, fields[fieldnum]);
#endif

This used to work, but apparently GCC 3.x breaks this – I got errors like ‘pasting “->” and “field” does not give a valid preprocessing token.’ There were a lot of results on google when searching for “does not give a valid preprocessing token”… I eventually downloaded somebody’s gzipped patch, which inside just replaced ## with /**/ … simple, eh? So I thought I’d put this up so its out there with a simple, non-gzipped explanation of how to get around the issue of ## not working for pasting anymore.

3.17.05

Motherboard

Filed under: — Bradley @ 1:20 pm

Ok, I was seeing instability to various degrees with my self-built computer – sometimes it would crash once a month, sometimes once a week, sometimes once a day… I thought it was a USB camera I had, I thought it might be the power supply, I thought it could be that I damaged the ram slot. I think I’ve finally figured it out though, from an esoteric trail of google searches (one of them was ‘memtest86 “test 5″ cas 2-3-3-6 geil’, one was ‘ga-7n400 set cas’)… I wanted to document the solution here, with plenty of keywords, in case anyone else runs into this problem.

The things I learned:

  • A memtest86 bootable CD is great for testing your memory settings. And it’s freeware! Hit ‘c 1 3 5 [enter] 0′ to loop on the test that catches the most problems.
  • NForce2 chipsets are reportedly unstable with a T(RAS) of lower than 11
  • Many people have problems with a CAS of 2, even if their memory supposedly supports it. Many suggestions to put it at 2.5
  • A few suggestions to bump the DIMM voltage up to +0.1
  • In order to change all these settings on most Gigabyte motherboards, you must hit control-f1 at the main CMOS setup screen!

I have a GA-7n400 pro2 motherboard, and Geil ram that is supposedly rated 2-3-3-6. With things at default (no overclocking or anything), I would get a few errors every so often looping on test 5 (which == a few crashes every so often in windows). After using many combined suggestions around the web, I changed my settings in CMOS to 2.5-3-3-11, and bumped the DIMM voltage by +0.1. Now, 24 passes in memtest86 test 5 and no errors! Beeeautiful. (some more keywords: lockup, unstable, nforce)

Powered by WordPress