Xbox hard drive USB partition problem

Xavier Douville <[email protected]> Wed, 15 Feb 2006 20:03:18 -0500
Newsgroups gmane.linux.ports.xbox.devel
Message-ID <[email protected]>
Hi

I use a laptop with Linux 2.6.15 and the xbox-linux patch applied so
that I can mount fatx partitions.

I have a cheap USB to IDE adapter.

The only problem is that SCSI drives (and by the way USB drives) in
Linux can only have 15 partitions.
It means that sda50 wont work.

  8 block       SCSI disk devices (0-15)
                   0 = /dev/sda          First SCSI disk whole disk
                  16 = /dev/sdb          Second SCSI disk whole disk
                  32 = /dev/sdc          Third SCSI disk whole disk
                     ...
                 240 = /dev/sdp          Sixteenth SCSI disk whole disk

Partitions are handled in the same way as for IDE
                 disks (see major number 3) except that the limit on
                 partitions is 15

According to the file linux/Documentation/devices.txt, sda is major 8
(which is fine), but there is no way to have a 50th partition, as we use
for IDE drive (hda50 is major 3, minor 50).
IDE drives can have up to 63 partitions in Linux.

This is not hard to fix, we only need to change one line in 
fs/partitions/xbox.c:

the line is :

slot = 50;

the fix is :

slot = 10;

I tested it on my laptop (and it worked). I don't think this should 
break anything, except that we would now have to access our partitions 
as hda1* instead of hda5*. Anyways we can still name the file /dev/hda50 
even if its minor is 10 and not 50.

thanks for you good work!

Xavier Douville




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642