# udev and ipod usb

## nadi

Hei gentoos,

I just got an ipod, and tried to connect it (after formatting it in windows) to the usb 2.0 in my laptop. So I installed for this the latest kernel 2.6.11-r4 and installed udev filesystem, working properly, I believe. I updated fstab to include the next line

```

/dev/ipod                /mnt/ipod      vfat     sync,user,noauto,rw,nodev,nosuid, umask=000    0 0

```

and created a rule in /etc/udev/rules.d/10-local.rules

```
 

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

```

I also updated the kernel to include the all the necessary modules (compiled all in to the kernel but sbp2 as module). So when connecting the ipod to the usb, I get the next message in the dmesg:

```

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

usb 1-3: configuration #1 chosen from 2 choices

scsi4 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 8

usb-storage: waiting for device to settle before scanning

  Vendor: Apple     Model: iPod              Rev: 2.70

  Type:   Direct-Access                      ANSI SCSI revision: 04

SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)

sda: Write Protect is off

sda: Mode Sense: 64 00 00 08

sda: assuming drive cache: write through

SCSI device sda: 2032640 512-byte hdwr sectors (1041 MB)

sda: Write Protect is off

sda: Mode Sense: 64 00 00 08

sda: assuming drive cache: write through

 /dev/scsi/host4/bus0/target0/lun0: p1

Attached scsi removable disk sda at scsi4, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi4, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

```

but when running 

```

root@nadi barc # mount /mnt/ipod/                                              

mount: /dev/ipod is not a block device

```

and gtkpod does not recognize the ipod. when mounting the ipod as 

mount /dev/sda1 /mnt/ipod

I get the see the files, but gtkpod can still not recognize the ipod.

can anyone help me, please? I hate using windows only because of that!

Nadi

----------

## nadi

when I mount it as 

```
 mount /dev/sda1 /mnt/ipod
```

and then try some program like gnupod, Iget permission problem:

```

barc@nadi barc $ gnupod_INIT.pl -m /mnt/ipod

gnupod_INIT.pl 0.98 (C) Adrian Ulrich

warning: Could not write to /mnt/ipod, iPod mounted read-only? (Permission denie     

d)

Your iPod is mounted at /mnt/ipod, ok ?

*********************************************************

This tool creates the default directory tree on your iPod

and creates an *empty* GNUtunesDB (..or convert your old

iTunesDB to a new GNUtunesDB).

You only have to use this command if

    -> You never used GNUpod with this iPod

 or -> You did an 'rm -rf' on your iPod

btw: use 'gnupod_addsong -m /mnt/ipod --restore'

     if you lost your songs on the iPod after using

     gnupod_INIT.pl (..but this won't happen, because

     this tool has no bugs ;) )

*********************************************************

Hit ENTER to continue or CTRL+C to abort

Creating directory structure on /mnt/ipod

> AppFolders:

Could not create /mnt/ipod/iPod_Control (Permission denied)

```

----------

## nadi

anyone? no?

----------

## Sardien

hi  :Smile: 

i'm not sure but I think the udev rule might not be working which is why you get the "/dev/ipod is not a block device" error.

Are you sure that the udev rule has been entered correctly? SYSFS{model}="iPod            " <-- that's iPod with 12 spaces .

I think you get the permission problems when you use 'mount /dev/sda1 /mnt/ipod' because I think you need to specify options such as user,rw. Does "mount -t vfat /dev/sda1 /mnt/ipod user,rw" work properly?

I'm currently using the udev method, I've got the same rule as the one you pasted & its working for me.

Have you tried udev with anything else (maybe udev in itself is not working, not the rule)?

Hope this helps!

Richard  :Smile: 

----------

## nadi

I copied the rule from someone else, which is working in his (it was one of the threads about ipods). 

Still does not working. I am able to mount as root /mount -t vfat /dev/sda1 /mnt/ipod and copy files to it, but it is hopeless, even if I copy mp3 to my shuffle, I cannot hear them, they are not recognized by the shuffle. I did umounted the ipod before disconnecting it.

thx anyway Richard.

----------

## jnihil

I mount /dev/sda2 as vfat for my ipod, not sda1.

This is what fdisk shows for my ipod:

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1               1           5       40131    0  Empty

/dev/sda2   *           6        2431    19486845    b  W95 FAT32

Not sure what's in sda1.  :Very Happy: 

----------

## nadi

oh, fdisk is showing on my machine 

```
   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1         397     1016300    b  W95 FAT32

```

so I guess sda1 is ok to use.

----------

## kriz

```

#iPod

BUS="scsi", KERNEL="sd?1", SYSFS{model}="iPod", NAME="iPod"

```

and 

```

/dev/iPod      /mnt/ipod   vfat      sync,user,noauto,umask=000   0 0

```

works perfect!

----------

## rommel

have you read this

----------

## nadi

Thanks rommel. I fixed hte problem. fstab and the correct rule. I did not use the name of the ipod/camera. I am using the serial number.

----------

