Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Sunday, January 4, 2009

Using the 2GB iPod Shuffle with Linux

Updated 25. May 2009:
- Added fstab identifying by UUID

I spent some time figuring out how to do this, but finally found out how it all worked and what had to be done in order for it to worker properly. I am running Debian Testing.
General setup
1.) You need a package called gnupod-tools. If you are running debian as me, install them like this (as root):
apt-get install gnupod-tools
I am also in favor of using a graphical user interface, in my case Amarok.
apt-get install amarok
Next we are going to add you ipod to your fstab. Here are two methods, the first(Method A) and BEST one is identifying your ipod by UUID. This will save you a lot of problems:
Method A:
First find your players UUID, type
blkid /dev/sdb
This will give you your players UUID. Make sure /dev/sdb is the correct location of YOUR player. Next enter root mode and edit your /etc/fstab:
UUID=YOUR-UUID /mnt/ipod vfat sync, users, auto,umask=000 0 0
Method B:
As root edit your /etc/fstab and add the following line:
/dev/sdb /mnt/ipod vfat sync,user,noauto,umask=000 0 0
Make sure the /dev/sdb is the same as the one your ipod will be discovered as when connecting and create the /mnt/ipod dir. (mkdir /mnt/ipod)
3.) Now connect your ipod shuffle and mount it like this:
mount /mnt/ipod
3.) Delete everything on it
cd /mnt/ipod
rm -rf ./*

and let's make the file system with gnupod:
gnupod_INIT -m /mnt/ipod
Your ipod should now be ready to start adding music on. From here on you can either add them manually in bash or via Amarok. I will teach you how to do both.

Adding music to ipod shuffle in bash
This is pretty easy. All you have to do is use the gnupod_addsong command like this for every tune you want to add:
gnupod_addsong -m /mnt/ipod/ /home/user/My_Music/my_tune.mp3
After you have done this you have to build the library on your ipod by simply typing:
mktunes -m /mnt/ipod/
And eject it properly:
umount /dev/sdb
eject /dev/sdb

Your ipod shall now work properly.

Adding music to ipod shuffle via Amarok
Start up amarok, it shall now find your ipod automaticly. If it doesn't go to "Settings->Configure Amarok" and select "Media Devices". If there is no devices listed click "Autodetect Devices" and your /dev/sdb shall now appear. Now choose to use the "Apple iPod Media Device" plugin for this device. Click Apply and OK. Click the devices button on bottom left. Select the ipod shuffle device, and connect. Add music by dragging it to the list on the left, right click and press "Start transfer" to transfer the music. When you are done quit Amarok, and go into bash and build the ipod library by typing:
mktunes -m /mnt/ipod/
And eject it properly
umount /mnt/ipod
eject /mnt/ipod

Tips 1:
To tweak Amarok and make it easyer to use later, try this:
First let's make a new binary which incorporates a couple of commands when disconnecting. Enter root mode, and edit /usr/bin/ejectpod
Enter the following:
mktunes -m /mnt/ipod
umount /mnt/ipod
eject /mnt/ipod

Save and exit. Chmod /usr/bin/ejectpod to 755:
chmod 755 /usr/bin/ejectpod
Enter Amarok go to Devices and click the configure device button up right next to transfer. As post-disconnect command enter:
As Pre-connect command enter:
mount -a
OK, and you are ready. Now amarok should hopefully automaticly build the new databases and unmount the ipod when clicking disconnect.

And you are done!


  1. Great instructions...although I had a few problems with the instructions due to my Distro (Linux Mint, built off Ubuntu). I couldn't use apt-get install gnupod-tools. I had to download the gnupod-0.99.8.tgz and use that instead. This is due to a bug in 0.99.7 where mktunes was hanging with "Searching iPod via sysfs". Other than that...instructions were great...same info is found in info GNUpod after installing.

  2. Do you have to make a dir in /mnt with "mkdir /mnt/ipod" if you use method A (UUID)?