Partitioning an Ipod to FAT32 and ext3

I recently inherited my sister’s “defective” (but fixed for 5$) 120GB Classic Ipod and managed to partition it the way I wanted. It was not a trivial process so I tought I’d share my experience with the web so others can benefit from it.

My music library is far from being 120GB so even if I feed the Ipod all my tunes, I’d still have a lot of free space on it. Granted, you can mount the Ipod as a mass storage device and stuff the rest with anything, but here’s the catch: Ipods will only format to FAT32 or HFS+ file systems if you use iTunes. As a consequence, if you pick HFS+, you will not be able to use them on windows and some *nix (if they lack the HFS+ support module) and if you choose FAT32, backup solutions such as backtintime will not work (they need a journaling file system).

So I took to partitioning my Ipod with two different partition using a different file system for each, FAT32 and EXT3. I tough it would be a simple task, but turns out that it wasn’t. Just formatting the Ipod and letting gtkpod rebuild it did not cut it; the device would stutter, only play the first few seconds of each track and give off artifacts while displaying the CD covers. And when plugged in iTunes, the software would report the device as corrupted and offer me to reset it. I thought that gtkpod must be missing on something so I should use iTunes instead yo rebuild it, but iTunes would still ask me to reset my iPod. Here is what worked after a fair amount of tinkering:

  1. Reset the iPod with iTunes (on a different computer since this tutorial assumes you are using a *nix).
  2. Plug it on Linux and run the following command on the user partition. My Ipod is a 6th generation classic, there is no partition for the firmware, it sits somewhere on the MCU flash, but it appears that older Ipod use a firmware partition so leave it alone. Paying attention to that particularity, here is the commands you need to run:
    1. Unmount the plugged int Ipod with umount  /dev/sdXY Where X is the device letter of your Ipod and Y is the partition number.
    2. dd if=/dev/sdXY of=ipod.bk bs=512M Where X is the user partition of you Ipod and Y is the partition number. This will effectively copy 512MB of raw bytes from you Ipod partition and save it to the ipod.bk file.
  3. Next, take your Ipod and format it the way you want using fdisk. If you have a firmware partition, do not destroy it! Keep the following points in mind:
    1. Use a Master Boot Record (MBR)
    2. All partitions should be primary
  4. Finally: dd of=/dev/sdXY if=ipod.bk bs=512M Where X is the user partition of you Ipod and Y is the partition number. This is going to copy back that 512MB file we extracted earlier from the Ipod, setting that partition the way it was before the repartitioning.

Voilà! Plug your Ipod in, upload music with you favorite app and do backups with your file system of choice. Mine is happily working with that setup: Ipod stuff on FAT32 and backintime on EXT3.

The quirk I got with this technique was that both iTunes and the Ipod report the full size of the internal hard drive as being available for music while in reality its not; it looks like the firmware keeps a record of the empty space withing the files of the user partition (why it is not computing it is anyone’s guess). You should probably be careful not to fill it up to a point where the two partitions would overlap (although that should not happen if the firmware is paying attention but then again, not tested).


Climate change (again)

Posted here:


I think we let ourselves carried over by the first’s commenters’s misconception about CO2. The debate (if there is to be one) should be about the post and in there, it’s indicated verbatim that CO2 isn’t toxic to humans and that it’s the greenhouse effect that is potentially harmful for the earth as a closed system.

Climate change is in my opinion part of a bigger issue: one of resource management. The earth can certainly afford a bit fossil fuel burning and resource usage as anyway, it will one day be engulfed by the heat of the sun as it expands towards its red giant state.

However, the alarming rate at which we are conducting those activities will very likely make us fall prey to Malthus’ law (population grows until ressources are all consummed, famine occurs and then population resorbs massively) very soon instead of us as a species living to see ourselves getting cooked by our star.
Technology (not policy) has certainly helped us averting that for while, but it won’t last forever if we keep consuming and growing like we are right now. As Carol Pullitzer clumsily suggested, it is not cars and industries that pollute and use resources, it’s humans; feel free to have you own conclusions about that, hers (birth control) is perfectly sound even if it is nowadays synonym with totalitarian policy.

And that is all simply because the earth is a closed system, and that  you cannot have infinite physical growth (economy of growth, yay!) inside a closed system. The earth is a balancing act, and we shall see return of pendulum sooner than expected if we keep going down that route.

A milestone

Too bad I work alone and mostly at nighttime. Otherwise, I would have some people around to share the sheer joy that I am experiencing right now. For a lack of that, I’ll turn to the web. Just an hour ago, I completed a major milestone in my main project line. I am ecstatic as with work of this magnitude, the light at the end of the tunnel is always months away( and right after, you get into another tunnel…) Here is the writeup on the situation.

I have had a fascination with oscilloscopes for a very long time. While being incredibly useful (for those who are into electronics that is), they have a mysterious sense to them that still gets me after all those years of hanging out with complicated machinery. I remember clearly seeing rows and rows of them during my first university year, having only a very rough idea of what they were for but still knowing, judging by their numbers, that they must be very useful for every electronics bench to get its own. They are what epitomizes the knobs and dials (screen in this case) strange and obscure apparatus of the modern age.

So much so that I decided to program one from scratch for my final engineering project; I had very ambitious plans for it. The electronics would be managed by a Microchip PIC18F4550 – a USB microcontroller – and the application on the host PC would be programmed in C#. Its killer feature would be that its display would be 3D, giving the user one more dimension for visualizing, combining and probing waveforms. Turned out implementing the USB stack was a major bitch (should have used Microchip’s ready-made one…) so I decided to get signals through the sound card input. No big deal, the main application was agnostic as to where its data came from. Then, the 3D part was a huge headache too (80% of the code, a primitive but complete 3D engine), but I got trough it and in the end it worked well enough for a public showing. I will post all its code and some screen shots when I find the motivation too, but for reasons that will be developed upon at this time, I decided no to further its development. Simply put, I had discovered the world of Open Source and realized that platform-locking my project (DirectX, .NET) was not inline with my philosophy of getting good electronic tools in the hand of the masses.

This new one is implemented on an OS of mine (Elements, but beware, the post is very outdated) and thus completely web oriented and RESTful. The user interface is described in XHTML, SVG and JavaScript with all of it getting served along with the oscilloscope function by an ATMega328p with 32kB of static EEPROM storage. That’s a web server, TCP/IP stack, a file system and oscilloscope running on 32kB of Flash, 32kB of EEPROM and 2kB of RAM embarked on a 16 MHz chip! It had been a web server for quite a while, but tonight, I got it to behave like a usable oscilloscope. I am a happy man…

The paradox of management

It recently occurred to me that the job of a manager (so often praised in our knowledge economy) is essentially a paradox, as its ultimate objective is to make itself obsolete.

A manager is essentially a problem solver. While the nature of the problems is certainly very vague, it goes from implementing a measure pushed down from higher up in the organization to dealing with a sick employee, but essentially, it all falls under the umbrella of problem solving because managers only have a very indirect responsibility on the product or service delivered by their organization.

It follows as a logical conclusion that a well managed entity will not have any problems, but that would be no permanent achievement to the manager as he knows very well that issues will soon reappear in the changing environment he works in. Incidentally, the best manager will not only have made his organization problem free, but will have implemented the mechanisms to solve them without any sort of oversight or implication on his part, since such are the characteristics of ideal processes. At this point, he will have fulfilled his role has a manager, he will be laid off or moved elsewhere, and the group of people he once led will continue to thrive and adapt without him.

Utopia aside, it feels to me like the most efficient, elegant and adaptable systems on this world always have an organic feel to them or are even naturally organic. Look at the web, look at social media, look at cities, look at society but most importantly, look at life around you.

There will always be a need for oversight and stewardship in the future, natural selection is too cruel for blunt application on human organizations, but I foresee that the current role of manager will redefine itself to that of an enabler, where the crux of the job is no longer to direct, but rather to create the conditions or more precisely, the ecosystem where an ideal can bloom, exist and subsist.

I ought to give credit to Matthew Crawford’s inspiring book, Shopclass as Soulcraft for an hint on this idea. In fact, it would not surprise me if he had thought of it before I did.

An impressive find

It looks like a cockroach but it has no antenna and appears to have its abdomen shell sutured preventing it from flying. Nonetheless, its by far the largest insect I’ve ever encountered in nature. While at my friend’s place, I grabbed the latest issue of National Geographic, opened a random page an saw a big photo of this very bug in all its splendor. It was part of a small feature on entomophagy. Turns out this is a benacus deyrolli, or a giant water bug as its commonly referred to. I should have been more careful, the Wikipedia article mentions that

Their bite is considered one of the most painful that can be inflicted by any insect (the Schmidt Sting Pain Index excludes insects other than Hymenoptera); the longer the bug is allowed to inject its saliva, the worse the resulting bite, and as the saliva liquefies muscle tissue, it can in rare instances do permanent damage. […] Occasionally when encountered by a larger predator, such as a human, they have been known to “play dead” and emit a fluid from their anus. Due to this they are assumed dead by humans only to later “come alive” with painful results.

When I was done taking the pictures, I released it in my frontyard only to find its empty exoskeleton two weeks after in my friend’s dog mouth.