Nat! bio photo

Nat!

Senior Mull.

Twitter RSS

Github

How I bricked my iTunes Server

for a while...

As soon as it was available in Germany I bought a Sheeva Plug Computer (ca. EUR 100) and a 1 TB Imation external USB disk (ca. EUR 100). My plan was to use this a fileserver, mainly as a DAAP iTunes Music server.

The Imation disk is great. It's covered with an absorber material, and I only hear it when I put my ear on it. It's also supposed to use very little energy.
The Sheeva Plug is not so great. The USB connections have too little friction, so it is extremely easy to lose the connection. I already had to format the USB disk twice, because it became unusable, when the USB cabled didn't connect properly any more... Also I think, it could be a little smaller. It's quite a beefy plug.

There are a lot of guides out there, that cover what to do with the Sheeva, once you get it. For a fileserver like mine, you only need three packages: avahi-daemon for Zeroconf, mt-daapd for Daap/iTunes and samba for filesharing. I also wanted netatalk for completeness sake.

I just want to write down a few notes, that I didn't see covered elsewhere on the web. There are a lot of good guides out there.

  • netatalk - gave me some weird address family errors, but when I turned off the ATALKD daemon and just use AFPD daemon (see /etc/defult/netatalk/. It worked OK. I don't really use AFP now, I use samba, it seems so much faster.
  • hostname - append a .local to the name you come up with. Zeroconf will then be able to properly resolve it.
  • fstab - try to replace as much as possible of the /var hierarchy with tmpfs mounts. You will lose persistent logs, but that should reduce writes to the flash memory of the plug.

As a final buff, I wanted to mount the root file system as read only. Truely an idiotic maneuvre in planning in execution, but here's what I did, no kidding...

  1. Edited /etc/fstab to read rootfs / rootfs ro 00 instead of rootfs / rootfs rw 0 0, hoping that this would just work
  2. Rebooted
  3. Checked with mount that it worked, it didn't (rootfs on / type rootfs (rw))
  4. Decided to revert /etc/fstab to avoid confusion later in life
  5. Noticed about three times in a row that saving the changed file didn't work.
  6. Examined fstab file permissions and my user id (root)
  7. Failed to see any reason, why it shouldn't work.
  8. Abandoned this problem and tried to figure out some other aesthetic problem in the boot process
  9. Figured out that I needed strings for that
  10. Tried apt-get install strings, knowing that it wouldn't work, which it didn't. Dimly rememberd something about "bin-utils"...
  11. Gave up on this, but noticed a warning that apt-get gave about not being able to use a read-only /var/lib/dpkg/lock.
  12. Figured, that probably /var/lib/dpkg was missing and needed creation
  13. Noticed, that this wasn't the case.
  14. Experienced a rare moment, that I wouldn't call lucid, but nevertheless ... The root filesystem was indeed mounted read only, and mount had lied to me!
  15. Moaned as I realized, that to install anything on the root file system I had to edit fstab and reboot. But everything on the root file system is read only now.
  16. Dealt with the pain, by writing this blog entry
  17. Rememberd the remount option mount -o remount,rw / ;)