# iPod and Gentoo

## rmh3093

[*]To get your iPod device node to show up as "/dev/ipod", create the file "/etc/udev/rules.d/00-ipod.rules" and paste the following code into it.

PC Formated iPod (vfat)

```
BUS="scsi", SYSFS{model}="iPod*", KERNEL="sd?2", NAME="%k", SYMLINK="ipod"
```

Mac Formated iPod (hfs)

```
BUS="scsi", SYSFS{model}="iPod*", KERNEL="sd?3", NAME="%k", SYMLINK="ipod"
```

[*]To set the permissions so that non-root users can mount/unmount and read/write to the iPod paste the following code into the file "/etc/security/console.perms".

```
<ipod>=/dev/ipod

<console>  0600 <ipod>       0600 root
```

[*]To easily mount your iPod add the following code to "/etc/fstab".

```
/dev/ipod /media/ipod vfat users,exec,noauto,managed 0 0
```

[*]To disconnect your iPod properly run the following command:

Eject your iPod as root

```
eject /media/ipod
```

To run eject as a non-root user run this once

```
chmod +s /usr/bin/eject
```

----------

## cappycdn

Just implemented your suggestions and I wanted to report a success!

I was able to plug-in my wife's ipod shuffle and it showed up immediately.  I then copied the files over and they all played successfully.

Thank you for the great info.

----------

## CptnObvious999

Cool, don't have an iPod but with some minor modifications works with my iAudio X5L. Heres the rule:

```
BUS="scsi", SYSFS{model}="MK3006GAL", KERNEL="sd?1", NAME="%k", SYMLINK="iaudio"
```

then change all the other stuff to use iaudio instead of ipod and you're golden.  :Cool: 

----------

## cappycdn

 *Quote:*   

> 
> 
> PC Formated iPod (vfat) 
> 
> ```
> ...

 

Out of curiousity...the only difference here is that KERNEL="sd?2/3 is different?  Why note the difference here?  Does it matter?  Or is this to account for more then one ipod connected with different filesystems?

----------

## rmh3093

 *cappycdn wrote:*   

>  *Quote:*   
> 
> PC Formated iPod (vfat) 
> 
> ```
> ...

 

From what I have read, if your iPod was formatted using Mac software it creates 3 partitions, sd?1 is for the firmware (same as on the PC formatted iPods), sd?2 has some other sorta of data probably associated with MacOS or HFS+ journal type of info, and then sd?3 which contains all the data on your iPod. Since we are only interested in the data partition being mapped to /dev/ipod we uses that KERNEL= line to specify the partition number. Also, since some iPods come preformated with HFS and some with VFAT I thought I should mention both. I don't have a Mac so I can't reformat mine to prove this so if I am wrong someone please let me know so I can fix things.

----------

## furanku

 *rmh3093 wrote:*   

> Also, since some iPods come preformated with HFS and some with VFAT I thought I should mention both. I don't have a Mac so I can't reformat mine to prove this so if I am wrong someone please let me know so I can fix things.

 

AFAIK the newer iPods come all with a HFS filesystem, it's just iTunes for Windows that reformats them silently in the background if it detects a "virgin" iPod.

----------

## LordArthas

Hello!

This works like a charm on my iPod Nano (VFAT). Thank you for the excellent tutorial.

I only have a minor problem. When I eject /mnt/ipod I get the following message:

```

eject: unable to eject, last error: Invalid argument

```

However, the device seems to be properly ejected as the iPod display stops showing the "do not disconnect" message.

Michele.

----------

## cappycdn

I too received that error message though it appeared to hae actually ejected fine as media:// in konqueror no longer showed the ipod. *shrugs* suggestions?

----------

## rmh3093

 *furanku wrote:*   

>  *rmh3093 wrote:*   Also, since some iPods come preformated with HFS and some with VFAT I thought I should mention both. I don't have a Mac so I can't reformat mine to prove this so if I am wrong someone please let me know so I can fix things. 
> 
> AFAIK the newer iPods come all with a HFS filesystem, it's just iTunes for Windows that reformats them silently in the background if it detects a "virgin" iPod.

 

Well I just bought a new video iPod and it has never been connected to a Windows or Mac computer and it was formatted with vFat... IIRC, you can buy them from stores in either format.

----------

## fluffyzzz

i'm a relative newbie and i'm not sure whats going on, but I have followed the given instruction and am not able to write to my ipod:

miyazaki ipod # mkdir k

mkdir: cannot create directory `k': Read-only file system

and in KDE

Could not make folder /mnt/ipod/k.

What manages wether the device is read-only?

----------

## rmh3093

are u a member of the users group?

----------

## fluffyzzz

yes, I just checked in /etc/group and I am a member of users.

how else might the system decide that the ipod is read-only?

----------

## dgaffuri

 *cappycdn wrote:*   

> I too received that error message though it appeared to hae actually ejected fine as media:// in konqueror no longer showed the ipod. *shrugs* suggestions?

 

Upgrade eject to (keyword masked) 2.1.0 to avoid the error message.

----------

## TheSoko

Will KDE with the hal and dbus USE variables automagically detect an iPod?

----------

## furanku

Yes, KDE will detect an iPod as a USB mass storage device, like an USB stick or an externel hard disc.

With amarok (as you asked for KDE based solutions, there's of course also gtkpod and some console based tools for that) you will be able to transfer your mp3s to the iPod and integrate them in the iTunes db on the iPod. AFAIK there's currently just basic video/photo integration for 5g/Photo iPods in gtkpod, but you can use transcode to convert videos into the formats needed by the iPod. Some projects (like MythTV) are currently working on iPod integration.

----------

## Sophisto

Just to confirm and thank you for this nice little guide! My iPod works perfectly apart from when i try and eject it same thing that mefiele described happens but to me that problem is insignificant!

thanks again

----------

## neenee

thanks for sharing this  :Wink: 

it worked fine for me, though i use debian.

----------

## soulfire

great howto, thank you !!

----------

## Kernel_Klink

 *rmh3093 wrote:*   

>  *furanku wrote:*    *rmh3093 wrote:*   Also, since some iPods come preformated with HFS and some with VFAT I thought I should mention both. I don't have a Mac so I can't reformat mine to prove this so if I am wrong someone please let me know so I can fix things. 
> 
> AFAIK the newer iPods come all with a HFS filesystem, it's just iTunes for Windows that reformats them silently in the background if it detects a "virgin" iPod. 
> 
> Well I just bought a new video iPod and it has never been connected to a Windows or Mac computer and it was formatted with vFat... IIRC, you can buy them from stores in either format.

 

The 5th gen iPods are no longer sold in different formats.  They will support both formats but I am not sure what format is default out of the box.

----------

## irfanmohammed

I followed the instructions for the udev rules and the /dev/ipod doesnt show up.

```
my dmesg output is as follows:

VFS: Mounted root (ext3 filesystem) readonly.

Freeing unused kernel memory: 212k freed

kjournald starting.  Commit interval 5 seconds

  Vendor: Apple     Model: iPod              Rev: 1.50

  Type:   Direct-Access                      ANSI SCSI revision: 00

usb-storage: device scan complete

Adding 1004052k swap on /dev/hda2.  Priority:-1 extents:1

EXT3 FS on hda3, internal journal

Adding 3145720k swap on /swapfile.  Priority:-2 extents:2035

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

cisco_ipsec: module license 'Proprietary' taints kernel.

Cisco Systems VPN Client Version 4.6.00 (0045) kernel module loaded

usb 1-1: USB disconnect, address 2

usb 2-1: new full speed USB device using uhci_hcd and address 2

usb 2-1: device descriptor read/64, error -71

usb 2-1: device descriptor read/64, error -71

usb 2-1: new full speed USB device using uhci_hcd and address 3

usb 2-1: device descriptor read/64, error -71

usb 2-1: device descriptor read/64, error -71

usb 2-1: new full speed USB device using uhci_hcd and address 4

usb 2-1: device not accepting address 4, error -71

usb 2-1: new full speed USB device using uhci_hcd and address 5

usb 2-1: device not accepting address 5, error -71

usb 1-1: new high speed USB device using ehci_hcd and address 5

scsi1 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 5

usb-storage: waiting for device to settle before scanning

  Vendor: Apple     Model: iPod              Rev: 1.50

  Type:   Direct-Access                      ANSI SCSI revision: 00

usb-storage: device scan complete

```

doesnt show any information about the device. any help is appreciated.

----------

## neenee

if you are plugging in your ipod in one of your front usb

ports, try one of the back ports instead. i and several

others have had this problem as well and switching to

a back port helped.

----------

## frostschutz

Doesn't work for me either. Do I have to do something to udev to make it see the new rules? Can I somehow add a debug message to a rule so I can see wether it's been checked or not, or are they supposed to work right when I change the rule files? I also tried following the writing udev rules guide to no avail...

EDIT:

Found the problem - for some reason, the rules line posted above works for me only if I use == instead of = for comparisons. According to manpage, a single = means assignment.

----------

## irfanmohammed

Can you post the exact changes after the "==" changes in all the files posted in the original message?

I couldnt get to it to work.

Thanks.

----------

## frostschutz

Okay. The rules I'm using now are slightly different from the one posted above, though.

In /etc/udev/rules.d/00-custom.rules:

```
BUS=="scsi", KERNEL=="sd*", SYSFS{model}=="*iPod*", SYMLINK+="usb/ipod%n"
```

Creates a /dev/usb/ipod, as well as /dev/usb/ipod<number> (one device per partition, like with harddisks you have hda, hda1, hda2, ...).

If it doesn't work, check if and how your iPod is detected. You can then use udevinfo to verify the SYSFS entries (maybe your model description is differently written?), for example if your iPod is /dev/sda, you can issue the following command: 

```
udevinfo -p /sys/block/sda -a /dev/sda
```

 - if your iPod is not detected at all, your problem lies elsewhere.

Please note that for exact string matches, you have to respect upper/lower case as well as spaces (I'm just using wildcards instead though).

----------

## torf

Although you guys gave me a good starting point I'm not able to get my iPod Shuffle to work. It is detected fine by the system and I can mount it manually using

```
# mount -t vfat /dev/sda1 /mnt/ipod
```

Also, udevtest tells me my rules (which are placed in /etc/udev/rules.d/10-local.rules) are working fine:

```
# udevtest /sys/block/sda/sda1 usb

main: looking at device '/block/sda/sda1' from subsystem 'usb'

main: opened class_dev->name='sda1'

udev_rules_get_name: reset symlink list

udev_rules_get_name: add symlink 'ipod'

udev_rules_get_name: rule applied, 'sda1' becomes 'sda1'

create_node: creating device node '/dev/sda1', major = '8', minor = '1', mode = '0660', uid = '0', gid = '0'

create_node: creating symlink '/dev/ipod' to 'sda1'
```

Nevertheless, /dev/ipod is never created. Of course I ran udevstart after each modification of the rules file which now looks like this:

```
SYSFS{model}="iPod*", KERNEL="sd?1", NAME="%k", SYMLINK="ipod"
```

Changing the "=" in the comparisons to a "==" didn't change anything. Here's the output of udevinfo:

```
device '/sys/block/sda/sda1' has major:minor 8:1

  looking at class device '/sys/block/sda/sda1':

    KERNEL=="sda1"

    SUBSYSTEM=="block"

    SYSFS{dev}=="8:1"

    SYSFS{size}=="2032350"

    SYSFS{start}=="34"

    SYSFS{stat}=="      43       86        0        0"

follow the "device"-link to the physical device:

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-3/2-3:1.0/host6/target6:0:0/6:0:0:0':

    BUS==""

    ID=="6:0:0:0"

    DRIVER=="sd"

    SYSFS{detach_state}=="0"

    SYSFS{device_blocked}=="0"

    SYSFS{max_sectors}=="240"

    SYSFS{model}=="iPod            "

    SYSFS{queue_depth}=="1"

    SYSFS{queue_type}=="none"

    SYSFS{rev}=="2.70"

    SYSFS{scsi_level}=="5"

    SYSFS{state}=="running"

    SYSFS{timeout}=="30"

    SYSFS{type}=="0"

    SYSFS{vendor}=="Apple   "

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-3/2-3:1.0/host6/target6:0:0':

    BUS==""

    ID=="target6:0:0"

    DRIVER=="unknown"

    SYSFS{detach_state}=="0"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-3/2-3:1.0/host6':

    BUS==""

    ID=="host6"

    DRIVER=="unknown"

    SYSFS{detach_state}=="0"

 looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-3/2-3:1.0':

    BUS==""

    ID=="2-3:1.0"

    DRIVER=="usb-storage"

    SYSFS{bAlternateSetting}==" 0"

    SYSFS{bInterfaceClass}=="08"

    SYSFS{bInterfaceNumber}=="00"

    SYSFS{bInterfaceProtocol}=="50"

    SYSFS{bInterfaceSubClass}=="06"

    SYSFS{bNumEndpoints}=="02"

    SYSFS{detach_state}=="0"

    SYSFS{interface}=="Internal Device"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-3':

    BUS==""

    ID=="2-3"

    DRIVER=="usb"

    SYSFS{bConfigurationValue}=="1"

    SYSFS{bDeviceClass}=="00"

    SYSFS{bDeviceProtocol}=="00"

    SYSFS{bDeviceSubClass}=="00"

    SYSFS{bMaxPower}=="500mA"

    SYSFS{bNumConfigurations}=="2"

    SYSFS{bNumInterfaces}==" 1"

    SYSFS{bcdDevice}=="1001"

    SYSFS{bmAttributes}=="80"

    SYSFS{configuration}=="Apple iPod"

    SYSFS{detach_state}=="0"

    SYSFS{devnum}=="8"

    SYSFS{idProduct}=="1300"

    SYSFS{idVendor}=="05ac"

    SYSFS{manufacturer}=="Apple"

    SYSFS{maxchild}=="0"

    SYSFS{product}=="iPod            "

    SYSFS{serial}=="000A2700100908AE"

    SYSFS{speed}=="12"

    SYSFS{version}==" 2.00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2':

    BUS==""

    ID=="usb2"

    DRIVER=="usb"

    SYSFS{bConfigurationValue}=="1"

    SYSFS{bDeviceClass}=="09"

    SYSFS{bDeviceProtocol}=="00"

    SYSFS{bDeviceSubClass}=="00"

    SYSFS{bMaxPower}=="  0mA"

    SYSFS{bNumConfigurations}=="1"

    SYSFS{bNumInterfaces}==" 1"

    SYSFS{bcdDevice}=="0206"

    SYSFS{bmAttributes}=="e0"

    SYSFS{configuration}==""

    SYSFS{detach_state}=="0"

    SYSFS{devnum}=="1"

    SYSFS{idProduct}=="0000"

    SYSFS{idVendor}=="0000"

    SYSFS{manufacturer}=="Linux 2.6.11-gentoo-r5 ohci_hcd"

    SYSFS{maxchild}=="3"

    SYSFS{product}=="nVidia Corporation nForce2 USB Controller _#2_"

    SYSFS{serial}=="0000:00:02.1"

    SYSFS{speed}=="12"

    SYSFS{version}==" 1.10"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1':

    BUS==""

    ID=="0000:00:02.1"

    DRIVER=="ohci_hcd"

    SYSFS{class}=="0x0c0310"

    SYSFS{detach_state}=="0"

    SYSFS{device}=="0x0067"

    SYSFS{irq}=="11"

    SYSFS{local_cpus}=="1"

    SYSFS{subsystem_device}=="0x5700"

    SYSFS{subsystem_vendor}=="0x1462"

    SYSFS{vendor}=="0x10de"

  looking at the device chain at '/sys/devices/pci0000:00':

    BUS==""

    ID=="pci0000:00"

    DRIVER=="unknown"

    SYSFS{detach_state}=="0"
```

Thanks in advance for any pointers on this!

----------

## rmh3093

try renaming your udev rule to "00" instead of "10" to guarantee its the first rule used

----------

## torf

Thanks for the tip, but that didn't change anything  :Confused: 

Any more ideas?

----------

## frostschutz

Now that's weird, because my udevtest output looks essentially the same (in this example from my cardreader):

```
$ udevtest /sys/block/sda usb

main: looking at device '/block/sda' from subsystem 'usb'

main: opened class_dev->name='sda'

udev_rules_get_name: add symlink 'usb/cardreader_cf'

udev_rules_get_name: rule applied, 'sda' becomes 'sda'

create_node: creating device node '/dev/sda', major = '8', minor = '0', mode = '0660', uid = '0', gid = '6'

create_node: creating symlink '/dev/usb/cardreader_cf' to '../sda'
```

And of course the symlink is there like it should be - udevtest says it will create the link after all. The first thing I'd check if the device was missing after udev confirmed it's existance, is wether or not udev is actually mounted & running properly. You're not using devfs / an old kernel / an old version of udev by any chance?

----------

## irfanmohammed

I updated my kernal 2.6.15-gentoo-r1 and everything worked like a charm. Thanks.

----------

## torf

Okay, this is strange. Just tried it again - it worked  :Very Happy: . Didn't change anything on the setup except for shutting down and booting again. But shouldn't have udevstart restarted udev anyway? Well, it works now, I'm happy. Thanks for your tips, guys, and sorry for the confusion.

----------

## pussi

There is problem when using ivman and Gnome that it shows both ipod partitions like "Apple iPod Music Player" and "Apple iPod Music Player (2)".

I fixed that by creating the following /usr/share/hal/fdi/policy/10osvendor/10-ipod-policy.fdi file:

```
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2">

  <device>

    <match key="block.is_volume" bool="true">

      <match key="block.storage_device" string="/org/freedesktop/Hal/devices/storage_model_iPod">

   <match key="volume.partition.number" int="0x1">

     <merge key="block.storage_device" type="string">/org/freedesktop/Hal/devices/foo</merge>

     <merge key="volume.policy.should_mount" type="bool">false</merge>

        </match>

   <match key="volume.fstype" string="hfs">

     <match key="volume.partition.number" int="0x2">

       <merge key="block.storage_device" type="string">/org/freedesktop/Hal/devices/foo</merge>

       <merge key="volume.policy.should_mount" type="bool">false</merge>

     </match>

        </match>

      </match>

    </match>

  </device>

</deviceinfo>
```

I haven't tested it with hfs-formatted iPod (actually I'm not sure if the problem even exists with them), so let me know if it don't work.

----------

## rush_ad

 *LordArthas wrote:*   

> Hello!
> 
> This works like a charm on my iPod Nano (VFAT). Thank you for the excellent tutorial.
> 
> I only have a minor problem. When I eject /mnt/ipod I get the following message:
> ...

 

i seem to have the same problem. found any solution?

----------

## dougthug

Make sure you have eject 2.1.0 installed.  This just went stable on x86 a week or so ago.  Also, if you are trying to use it as a user other than root, you may need to

```
chmod +s /usr/bin/eject
```

Doing both of these made it so that when I right-click my iPod in Gnome and 'Unmount Volume' it does it cleanly and error free as my normal user.  Hope this helps...

----------

## rush_ad

 *dougthug wrote:*   

> Make sure you have eject 2.1.0 installed.  This just went stable on x86 a week or so ago.  Also, if you are trying to use it as a user other than root, you may need to
> 
> ```
> chmod +s /usr/bin/eject
> ```
> ...

 

yes, this worked very well. thanks a lot.

----------

## Fanatic

 *pussi wrote:*   

> There is problem when using ivman and Gnome that it shows both ipod partitions like "Apple iPod Music Player" and "Apple iPod Music Player (2)".
> 
> I fixed that by creating the following /usr/share/hal/fdi/policy/10osvendor/10-ipod-policy.fdi file:
> 
> ```
> ...

 

Great, just what I've been looking for! I had the exact same problem with kde.    :Cool: 

----------

## UberLord

 *rmh3093 wrote:*   

> [*]To disconnect your iPod properly run the following command:
> 
> Eject your iPod as root
> 
> ```
> ...

 

The chmod +s should not be required with sys-apps/eject-2.1.4-r1 and a 2.6.16 based kernel  :Smile: 

----------

## ARC2300

 *UberLord wrote:*   

>  *rmh3093 wrote:*   [*]To disconnect your iPod properly run the following command:
> 
> Eject your iPod as root
> 
> ```
> ...

 

I still needed to do the chmod +s, but I'm on ~x86, so that may make the difference.

----------

## MilkSjeik

Works with my gf's iPod nano.

But when I browse the pod, I get:

```
milksjeik@MelxacoTux /mnt/ipod $ ls -l

totaal 16

drwxr-xr-x  2 milksjeik users 4096 mei  5 18:46 Calendars

drwxr-xr-x  2 milksjeik users 4096 mei  5 18:46 Contacts

drwxr-xr-x  5 milksjeik users 4096 mei  5 18:46 iPod_Control

drwxr-xr-x  2 milksjeik users 4096 mei  5 18:46 Notes
```

Where do I put the music? I see the same folders on wintendo btw, but with iTunes it's possible to dump music on it. How do I do it with gentoo?

Edit: It's possible with something like Amarok. Does somebody now how I can browse it directly?

----------

## pussi

You have to do it with some application. There's at least gtkpod, amarok and banshee that support ipods

----------

## vandalman

Here is the rule that I used to get it to work:

```
BUS=="scsi", SYSFS{model}=="iPod", KERNEL="sd?", SYMLINK="ipod"
```

My iPod Mini shows up as /dev/sda

Thanks!

----------

## LD

I tried that rule, and had to remove the bus. I'm using a Dell E1505 with SATA hard drive so the hard drive comes up as sda and all the usb drives are coming up as ubb. 

ANy idea what is causing this?

----------

## sdfg

Sorry to be a necromancer, but I need some help.

I've followed this so far. My /etc/udev/rules.d/00-ipod.rules is 

```
BUS=="scsi", SYSFS{model}=="iPod*", KERNEL=="sd?2", NAME=="%k", SYMLINK=="ipod"
```

However, udevinfo -p /sys/block/sda -a /dev/sda returns 

```
Udevinfo starts with the device specified by the devpath and then

walks up the chain of parent devices. It prints for every device

found, all possible attributes in the udev rules key format.

A rule to match, can be composed by the attributes of the device

and the attributes from one single parent device.

```

and udevtest /sys/block/sda/sda1 usb returns 

```
unable to open device 'usb'
```

.

Can anyone help?

----------

## Itazuki

Yeah i've tried the following lines in /etc/udev/rules.d/60-ipod.rules.

BUS=="usb", SYSFS{manufacturer}=="Apple", SYSFS{product}=="iPod", KERNEL=="sd?2", GROUP="plugdev", SYMLINK+="ipod"

then i tried 

BUS=="usb", SYSFS{manufacturer}=="Apple", SYSFS{product}=="iPod", KERNEL=="ub?2", GROUP="plugdev", SYMLINK+="ipod"

then i tired

BUS=="SCSI", SYSFS{manufacturer}=="Apple", SYSFS{product}=="iPod", KERNEL=="sd?2", GROUP="plugdev", SYMLINK+="ipod"

I did udevstart after changing the rule in that file each time but /dev/ipod is not created, i have a 1GB nano and it's Windows formatted.

udevinfo -p /sys/block/sda -a /dev/sda returns

udevinfo starts with the device the node belongs to and then walks up the

device chain, to print for every device found, all possibly useful attributes

in the udev key format.

Only attributes within one device section may be used together in one rule,

to match the device for which the node will be created.

udevtest /sys/block/sda

main: unable to open '/sys/block/sda'

any ideas? i can mount it by mount -t vfat /dev/sda2 /mnt/ipod

----------

## bdm

I got mine to work too with the help of roger55!

/etc/udev/rules.d/60-ipod.rules

```
BUS=="scsi", SYSFS{vendor}=="Apple*", SYSFS{model}=="iPod*", KERNEL=="sd?2", SYMLINK+="ipod"
```

Last edited by bdm on Sat Oct 21, 2006 11:10 pm; edited 1 time in total

----------

## sdfg

I got mine working, but /dev/ipod doesn't exist. Not that I'm bothered. /dev/ipod is just a convinient pointer - /dev/sda1 works just the same. That's how I sorted it out, just enter the info in fstab, tell udev to automount, and away it goes.

----------

## thomas.g

[quote="rmh3093"][*]To get your iPod device node to show up as "/dev/ipod", create the file "[i]/etc/udev/rules.d/00-ipod.rules[/i]" and paste the following code into it.

[list]PC Formated iPod (vfat)

[code]BUS="scsi", SYSFS{model}="iPod*", KERNEL="sd?2", NAME="%k", SYMLINK="ipod"[/code]

Mac Formated iPod (hfs)

[code]BUS="scsi", SYSFS{model}="iPod*", KERNEL="sd?3", NAME="%k", SYMLINK="ipod"[/code][/list]

[*]To set the permissions so that non-root users can mount/unmount and read/write to the iPod paste the following code into the file "[i]/etc/security/console.perms[/i]".

[code]<ipod>=/dev/ipod

<console>  0600 <ipod>       0600 root[/code]

[*]To easily mount your iPod add the following code to "[i]/etc/fstab[/i]".

[code]/dev/ipod /media/ipod vfat users,exec,noauto,managed 0 0[/code]

[*]To disconnect your iPod properly run the following command:

[list]Eject your iPod as root

[code]eject /media/ipod[/code]

To run eject as a non-root user run this once

[code]chmod +s /usr/bin/eject[/code][/list][/quote]

My name is Thomas Geraets, and I love iPod!!!

\o/

----------

## MattSharp

Great thread, very helpful. Quick question.....

Once I run eject, is there anyway to "re-mount" it without disconnecting it and reconnecting it? Not a huge deal, just wondered.

----------

## hgerstung

Hi! Found  a shiny new ipod video 30GB under the Christmas tree and already "integrated" it in my car (icelink), now I am looking for nice software to organize my music, videos and photos on my Gentoo box. 

So far I am able to mount it and I already tried AmaroK and gtkpod, but both don't seem to be what I am looking for. I just installed floola (www.floola.com), which does not seem to be available in portage, and this looks slightly better, it seems to be faster and more eye-friendly than gtkpod and at least claims that it is supporting video files (unlike AmaroK).

My question is: How do you manage to put your video files on the ipod? I already found a howto which includes a ffmpeg-based script to convert my video files into an ipod-friendly format, but I did not manage to find the resulting .mov file on my ipod, no matter in which directoy I copied it. Floola somehow does not want me to add a .mov (or .mpg) file and AmaroK tells me that my player is not capable of playing this file when I put it in a playlist and choose "Transfer". 

Best Regards,

Heiko

----------

## rmh3093

wow i just tried floola and it definitely looks way nicer... too bad the dev dosent have the source code posted

----------

## gerdesj

 *torf wrote:*   

> Okay, this is strange. Just tried it again - it worked . Didn't change anything on the setup except for shutting down and booting again. But shouldn't have udevstart restarted udev anyway? Well, it works now, I'm happy. Thanks for your tips, guys, and sorry for the confusion.

 

```
#udevcontrol reload_rules
```

Does the job of re-reading the config.  I have seen several places on the web suggesting udevstart, which only starts udev and presumably does not do a restart or a re read.

Cheers

Jon

----------

## chidorex

Thanks to rmh3093 for a great HOWTO.

 *frostschutz wrote:*   

> Okay. The rules I'm using now are slightly different from the one posted above, though.
> 
> In /etc/udev/rules.d/00-custom.rules:
> 
> ```
> ...

 

Thanks frostshutz for the correction. I am now able to get my ipod as /dev/ipod.

However, although I can see the ipod being automatically mounted under /media, and also can copy music files to my ipod, I am not able to listen to any music. According to the manual, a blinking led (from green to orange) means the iPod has no songs. I am using Amarok under Gnome, and as it is KDE based, it could be that it is not connecting properly.

I added the device to Amarok manually as /media/IPOD, since the automatic detection of Media Devices on Amarok did not find it, stating:

```
No new media devices were found. If you feel this is an error, ensure that the DBUS and HAL daemons are running and KDE was built with support for them. You can test this by running "dcop kded mediamanager fullList" in a Konsole window.
```

Executing the suggested command I get 

```
# dcop kded mediamanager fullList

ERROR: Couldn't attach to DCOP server!
```

I don't have a clue to what is going on.

Can anybody suggest a solution?

Thanks.

----------

## Nihilus

What about 

```
euse -E ipod
```

?   :Wink: 

----------

## chidorex

 *Nihilus wrote:*   

> What about 
> 
> ```
> euse -E ipod
> ```
> ...

 

Oh my god!!!! An eye opener. Did not even know there was an ipod USE var. Thanks Nihilus.

I am emerging Amarok again as we speak. I don't have my ipod with me right now, but I will try tomorrow and will post back the results.

----------

## chidorex

I emerged amarok with the ipod use flag and I get the same response.

I don't know too much about dcop, but trying this same command from my own user instead than from root I get the following:

```
rex@elrond ~ $ dcop kded mediamanager fullList

call failed

rex@elrond ~ $ dcop

amarok

kded

kcookiejar

klauncher

rex@elrond ~ $ dcop kded

MainApplication-Interface

kbuildsycoca

kcookiejar

kded

kdetrayproxy

kpasswdserver

ksycoca

kwalletd

qt/kded
```

This gives me the idea that I do not have the variables or attributes dcop expects when I issue the "dcop kded mediamanager fullList" command.

Dumb question: Do I need to add qt3, qt4 and/or kde to my use vars? I disabled them since I use gnome.

Any help will be greatly appreciated.

----------

## gerdesj

 *chidorex wrote:*   

> Thanks to rmh3093 for a great HOWTO.
> 
> Executing the suggested command I get 
> 
> ```
> ...

 

You are probably running the dcop command as root in a console.  root is (probably) not running the desktop session and hence does not have a dcop server running.  

Run that command as your logged in user.

Cheers

Jon

----------

## chidorex

 *gerdesj wrote:*   

> You are probably running the dcop command as root in a console.  root is (probably) not running the desktop session and hence does not have a dcop server running.  
> 
> Run that command as your logged in user.

 

Thanks Jon. I tried it with my user already. My results are on my last post. However, I do not know what to do from there, since mediamanager is not in the "options" for dcop kded.

Any suggestions?

----------

## gerdesj

 *chidorex wrote:*   

> Thanks Jon. I tried it with my user already. My results are on my last post. However, I do not know what to do from there, since mediamanager is not in the "options" for dcop kded.
> 
> Any suggestions?

 

Hmm, where to start! I'm not near my Gentoo boxen at the moment but I suggest you start with revdep-rebuild.

Also, is control center/kde components/service manager/mediamanager actually shown as running?

Cheers

Jon

----------

## chidorex

 *gerdesj wrote:*   

> Hmm, where to start! I'm not near my Gentoo boxen at the moment but I suggest you start with revdep-rebuild.

 

I did and the only apps rebuilt were the gimp and gaim. Not much there.

 *gerdesj wrote:*   

> Also, is control center/kde components/service manager/mediamanager actually shown as running?

 

Mmmmm. I don't know what to look for.

Here is a grep of processes running kde:

```
$ ps ax | grep kde

 3336 ?        Ss     0:00 kdeinit Running...                

 3340 ?        S      0:00 dcopserver [kdeinit] --nosid --suicide

 3342 ?        S      0:00 klauncher [kdeinit]               

 3344 ?        S      0:00 kded [kdeinit]                    

 3350 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarokPGQ8Ea.slave-socket

 3351 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarokMjSckb.slave-socket

 3352 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarok4mOxwa.slave-socket

 3365 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarokMz2vLa.slave-socket

 3366 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarokHu1lvc.slave-socket

 3367 ?        S      0:00 kio_file [kdeinit] file /tmp/ksocket-rex/klauncherIbM9Ma.slave-socket /tmp/ksocket-rex/amarokvr4Gzb.slave-socket

 3386 pts/2    R+     0:00 grep --color=auto kde
```

All of these were started with amarok. Any particular process I should look for?

I have to ask again. Do I need to add qt or kde to my USE variables?

Thanks Jon.

----------

## gerdesj

 *chidorex wrote:*   

> I did and the only apps rebuilt were the gimp and gaim. Not much there.
> 
>  *gerdesj wrote:*   Also, is control center/kde components/service manager/mediamanager actually shown as running? 
> 
> I have to ask again. Do I need to add qt or kde to my USE variables?
> ...

 

Load the Control Centre and follow the path above (ie click on the tabs etc) to check whether media manager is listed/running.

I have qt3 qt4 and kde as USE flags on my systems.  Not sure if they are absolutely necessary for all this.  Also, I installed using the kde-meta package

Cheers

Jon

----------

## pussi

 *chidorex wrote:*   

> I have to ask again. Do I need to add qt or kde to my USE variables?
> 
> Thanks Jon.

 You don't, but they are useful if you're using KDE.

EDIT: run ps -A | grep dbus and ps -A | grep hald to make sure you have dbus and hal daemons running.

Also, you could try adding hal and dbus in your USE-flags and running emerge -ND world

----------

## discostu

How does this udev rule change if my ipod nano mounts on /dev/uba3?

I tried changing it just to this, but no luck so far.

```
SYSFS{model}=="*iPod*", KERNEL="uba*", SYMLINK="ipod"
```

I've been trying to figure out how i can print the information like "model" for /dev/uba3.

"udevinfo -n /dev/uba3 -q all" doesn't print anything useful.

Thanks.

EDIT: Nevermind, I found my answer on the gentoo wiki: http://gentoo-wiki.com/HARDWARE_iPod

----------

## chidorex

 *gerdesj wrote:*   

> Load the Control Centre and follow the path above (ie click on the tabs etc) to check whether media manager is listed/running.

 

I assume you use KDE. I would need to install KDE's Control Center and I don't think I want to do that (only if I need to). You think I need to???

----------

## chidorex

 *pussi wrote:*   

>  *chidorex wrote:*   I have to ask again. Do I need to add qt or kde to my USE variables?
> 
> Thanks Jon. You don't, but they are useful if you're using KDE.

 

OK. I'll leave them out and will stick with Gnome for now.   :Smile: 

 *pussi wrote:*   

> run ps -A | grep dbus and ps -A | grep hald to make sure you have dbus and hal daemons running.
> 
> Also, you could try adding hal and dbus in your USE-flags and running emerge -ND world

 

I already have those USE flags in my make.conf.

The ps result is:

```
elrond # ps -A | grep dbus

 5846 ?        00:00:00 dbus-daemon

 8029 ?        00:00:00 dbus-launch

 8030 ?        00:00:00 dbus-daemon

elrond # ps -A | grep hal

 5918 ?        00:00:01 hald

 5919 ?        00:00:00 hald-runner

 5927 ?        00:00:00 hald-addon-acpi

 5932 ?        00:00:00 hald-addon-keyb

 5950 ?        00:00:00 hald-addon-stor
```

Anything I am missing?

Thanks pussi.

----------

## Diavolo

Hi,

I don't know why but my iPod now gets mounted on /media/uba2 insead of /media/ipod. I changed nothing, /dev/ipod is created and the fstab entry is okay.

Any idea?

----------

## oglueck

For my 3G iPod I use the following rule. Please note that this one explicitly selects the data partition. I think you can ommit the plugdev group, as HAL does that automatically.

[code]# iPOD - get the right partition with start attribute

SUBSYSTEM=="block", KERNEL=="sd??", ATTR{start}=="65600", ATTRS{model}=="iPod            ",

 ATTRS{vendor}=="Apple   ", SYMLINK+="ipod", GROUP="plugdev"[/code]

----------

