Wednesday, October 19, 2016

Error -50 when trying to write to an HFS+ Journaled file system

First, credit where credit is due.  The answer came from

One of my Seagate drives suddenly started acting really weird.  It wouldn't let me delete files from it, copy new files on to it, etc.  Copying files off the drive seemed to work fine, but when I tried to run Disk Utility to validate the file system, it gave an error complaining about being unable to dismount the file system - someone had it busy.

Quick trip to the Terminal and tried:

$ sudo lsof | grep VOLUMENAME

and that showed a couple of issues, OneDrive, GoogleDrive, etc keeping files open, so I quit those apps and tried again.  Same dismount problem, even though there were no open files that the system would tell me about.   Hmmm, real Unix fsck can run on a mounted filesystem, surely the hfs variant can?  Yep.  First, work out the device name with mount ...

$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk2s2 on /Volumes/VOLUMENAME (hfs, local, journaled)

... then run the HFS checker using that device name

$ sudo fsck_hfs -ld /dev/disk2s2

... and that claimed that the file system was fine.

Back to Google, found the thread at which suggested that the problem might be a corrupted journal.  His solution was more complicated than I needed because I don't have a hardware failure to contend with, so I tried doing it online.

Turn off journaling with Apple's hidden hfs.util tool:

$ sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.util \

    -N /Volumes/VOLUMENAME

and try Disk Utility again.  Lo and behold, now it can unmount.  Let it run through the check and it gives the drive the thumbs up.  Turn journaling back on:

$ sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.util \
    -J /Volumes/VOLUMENAME/
Allocated 229376K for journal file.

And we are back in business.  No idea why the journal went bad, and I'll make sure my backups of all the stuff on that drive are up to date. 

P.S. The crappy fonts and colouring in this post are a function of this wysiwyg editor that provides.

P.P.S Less than two weeks later, the same disk has died again but this time with an error that fsck does not seem to be able to fix.  Sigh.

Monday, October 10, 2016

iTunes Rants

Dear Apple,

when people tell you that iTunes is a piece of crap, this is what they mean.

I'm sure one of those numbers is correct ...

Useful Mac Hacks

If it gets in here, it has to be pretty useful.  I didn't work it out, I'm just trying to hold on to it for posterity.  Always look to the original link for details.

Add a "recent apps" icon to the dock.
defaults write persistent-others -array-add '{ "tile-data" = {"list-type" = 1; }; "tile-type" = "recents-tile";}' && \killall Dock

Note: I don't know why they include the \ in front of killall - it isn't needed, it merely escapes the 'k'.  If you wanna avoid PATH issues, use /usr/bin/killall.

Saturday, August 29, 2015

16 blocks making up circular patterns

Here's another that I must have gotten years ago, and I've lost the instructions.  The sticker on the only remaining part of the packaging says "Attempt to arrange the tiles so that different colours never touch!". That seems too easy - here are two solutions that only took about ten minutes to find.

all the circles the same colour scheme, but no two colours touch anywhere
all of the tiles connected in a single loop, again no colours touching anywhere

Wednesday, May 27, 2015

The PLEXi Iamond Hex solution

Since I'm recording the nice way to put the puzzles away, here is the pretty solution to the PLEXi Iamond Hex puzzle (which is apparently a licensed version of Kadon's original).

The Pentomino Square Solution

I keep having to rediscover the solution to the pentomino square puzzle that's so hard to put away nicely otherwise, so here it is.

Saturday, April 25, 2015

Google Calendar not syncing to Nana's Nexus 7

For some reason, Google Calendar on Mum's Nexus 7 has a long-standing bug where it spontaneously forgets how to sync her calendar data.  Since I'm on the other side of the country, and I don't use Android at all these days, here are the notes on how to fix the issue.
  • Open Settings
  • Select Storage
  • Select Apps Data and Media
  • Sort Apps By Name (using the right-hand menu)
  • Scroll down to Calendar
  • Remove Data
  • Scroll down to Calendar Storage (this should be the next one on from Calendar)
  • Remove Data
Make sure you do both Calendar and Calendar Storage!
  • Go back to top of Settings
  • Under Accounts, go to Google Accounts
  • Select Sync (using right-hand menu)