How I bricked my iTunes Server
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.
- Edited /etc/fstab to read rootfs / rootfs ro 00 instead of rootfs / rootfs rw 0 0, hoping that this would just work
- Checked with mount that it worked, it didn't (rootfs on / type rootfs (rw))
- Decided to revert /etc/fstab to avoid confusion later in life
- Noticed about three times in a row that saving the changed file didn't work.
- Examined fstab file permissions and my user id (root)
- Failed to see any reason, why it shouldn't work.
- Abandoned this problem and tried to figure out some other aesthetic problem in the boot process
- Figured out that I needed strings for that
- Tried apt-get install strings, knowing that it wouldn't work, which it didn't. Dimly rememberd something about "bin-utils"...
- 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.
- Figured, that probably /var/lib/dpkg was missing and needed creation
- Noticed, that this wasn't the case.
- 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!
- 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.
- Dealt with the pain, by writing this blog entry
- Rememberd the remount option mount -o remount,rw / ;)