# ipod mini / usb / udev / no fdisk...[solved]

## bgrundy

Hi all,

I have a brand new Ipod mini that I'm trying to use under Gentoo.  I've tried both 2.6 and 2.4 kernels to no avail.  The kernel is "seeing" the apple Ipod, but there are no device nodes suitable for mounting.  In other words, I can see the device detected as /dev/sda, but there are no partitions...

Following is some useful informaion:

The modules install fine.  USB 2.0 and USB storage.

```
jupiter ~ # modprobe ehci_hcd

jupiter ~ # lsmod

Module                  Size  Used by

usb_storage            98064  0

ehci_hcd               29704  0

usbcore               104184  3 usb_storage,ehci_hcd

jupiter ~ # dmesg

...

ehci_hcd 0000:02:09.2: NEC Corporation USB 2.0

ehci_hcd 0000:02:09.2: irq 9, pci mem 0xeb800000

ehci_hcd 0000:02:09.2: new USB bus registered, assigned bus number 1

ehci_hcd 0000:02:09.2: park 0

ehci_hcd 0000:02:09.2: USB 2.0 initialized, EHCI 1.00, driver 10 Dec 2004

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 5 ports detected

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

```

usb_storage gives some funny messages.  Not sure if this has any bearing:

```
usb-storage: Bulk Command S 0x43425355 T 0xc L 0 F 0 Trg 0 LUN 0 CL 6

usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes

usb-storage: Status code 0; transferred 31/31

usb-storage: -- transfer complete

usb-storage: Bulk command transfer result=0

usb-storage: Attempting to get CSW...

usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

usb-storage: Status code 0; transferred 13/13

usb-storage: -- transfer complete

usb-storage: Bulk status result = 0

usb-storage: Bulk Status S 0x53425355 T 0xc R 0 Stat 0x0

usb-storage: scsi cmd done, result=0x0

usb-storage: *** thread sleeping.

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

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

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad LUN (0:1)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (1:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (2:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (3:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (4:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (5:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (6:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand alled

usb-storage: *** thread awakened.

usb-storage: Bad target number (7:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: device scan complete
```

But eventually, I get this and all seems well:

```
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

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

```

A peek at /var/log/messages seems to indicate that my ipod should be visible at /dev/sda:

```
jupiter ~ # tail /var/log/messages

Jun 10 22:27:45 localhost kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00

Jun 10 22:27:45 localhost kernel: SCSI device sda: 7999488 512-byte hdwr sectors (4096 MB)

Jun 10 22:27:45 localhost kernel: sda: Write Protect is off

Jun 10 22:27:45 localhost kernel: SCSI device sda: 7999488 512-byte hdwr sectors (4096 MB)

Jun 10 22:27:45 localhost kernel: sda: Write Protect is off

Jun 10 22:27:45 localhost kernel:  /dev/scsi/host0/bus0/target0/lun0:<7>usb-storage: queuecommand called

Jun 10 22:27:46 localhost kernel:  [mac] p1 p2 p3

Jun 10 22:27:46 localhost kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Jun 10 22:27:46 localhost kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

Jun 10 22:27:47 localhost scsi.agent[8457]: disk at /devices/pci0000:00/0000:00:1e.0/0000:02:09.2/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0

```

The most interesting part of this is the identification of the Mac partitions:

```
Jun 10 22:27:46 localhost kernel:  [mac] p1 p2 p3
```

But still, fdisk refuses to see the nodes.

```
jupiter ~ # fdisk -l /dev/sda

Disk /dev/sda: 4095 MB, 4095737856 bytes

126 heads, 62 sectors/track, 1024 cylinders

Units = cylinders of 7812 * 512 = 3999744 bytes

Disk /dev/sda doesn't contain a valid partition table
```

Strangely enough, Parted *does* see the partitions:

```
jupiter ~ # parted /dev/sda

GNU Parted 1.6.22

Copyright (C) 1998 - 2005 Free Software Foundation, Inc.

This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY

WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Using /dev/sda

(parted) p

Disk geometry for /dev/sda: 0.000-3906.000 megabytes

Disk label type: mac

Minor    Start       End     Filesystem  Name                  Flags

1          0.000      0.030              partition map

2          0.031     32.030              firmware

3         32.031   3905.999              disk

```

Here's some relevent kernel config items:

```
jupiter linux # cat .config | grep CONFIG_EFI

# CONFIG_EFI is not set

# CONFIG_EFI_PARTITION is not set

jupiter linux # cat .config | grep MAC

CONFIG_MAC_PARTITION=y

jupiter linux # cat .config | grep DOS

# DOS/FAT/NT Filesystems

CONFIG_MSDOS_FS=m

CONFIG_MSDOS_PARTITION=y
```

Good Lord, what gives.  I'm racking my brain here...  I included the EFI stuff because of what I've seen on google.  I've searched high and low for an answer, but none help.  

Any ideas...anyone....please?Last edited by bgrundy on Sat Jun 11, 2005 5:05 pm; edited 1 time in total

----------

## poOoch

Perhaps you need also :

```

CONFIG_HFS_FS=m

CONFIG_HFSPLUS_FS=m

```

cheers

----------

## bgrundy

Thanks for the response.  I should have noted that I do in fact have HFSPLUS support:]

By the way, this is with kernel version 2.6.11-gentoo-r8

```
 cat /usr/src/linux/.config | grep HFS.*FS

CONFIG_HFS_FS=m

CONFIG_HFSPLUS_FS=m
```

Having the filesystem support is really not the issue.  The *partitions* are not seen on sda.  Even without the FS support, if I could see the partitions I could convert the ipod to fat with dd and mkfs.vfat (which is my intention).  I cannot even get that far.  I'm really thinking it's something silly to do with udev.  I wish I had another (different distro) system to play with. 

 Hmmm perhaps I'll see if a Knoppix disk or something see's it any better...

----------

## bgrundy

Bahhh! I should have known.  Issue solved.  I was waiting for fdisk to report the partitions before moving on.  Apparently fdisk does not recognize the apple partitions, even though support is in the kernel.  That's why parted saw the partitions.  Thanks.

----------

## echo6

Hi Barry!

If the Ipod uses Apple Partion table then you'll need to emerge mac-fdisk  :Smile: 

----------

## bgrundy

 *echo6 wrote:*   

> 
> 
> If the Ipod uses Apple Partion table then you'll need to emerge mac-fdisk 

 

...which is what I ended up doing. Some googling for parted and mac partitions pointed this out to me...

Where were you back in June??  :Razz:    (poking fd with your gentoo stick, no doubt...  :Twisted Evil:  )

----------

