Rockbox Technical Forums

Third Party => Repairing and Upgrading Rockbox Capable Players => Topic started by: beanxinh on August 07, 2011, 01:26:45 AM

Title: Gigabeat S with 160Gb HDD
Post by: beanxinh on August 07, 2011, 01:26:45 AM
Hi
I have a Gigabeat S60. Recently I got a used 160Gb MK1634GAL and trying to put it on my Gigabeat. Both the offical firmware and rockbox can recognize only 128GiB. I try to search on the internet and rockbox forum and come up with some confusing answers. Some say that the limitation can only remove by changing both the rockbox bootloader and the firmware. Adding two line to the coed

#define HAVE_LBA48
#define MAX_PHYS_SECTOR_SIZE 4096
Some say that I only need to change the code and recompile it.
What should I do
Pls help
Thank a lot

Edit: I took a look in the gigabeats.h and found that the line
#define HAVE_LBA48
already exist in the code but my player still can't recognize the extra space. How can I know if the gigabeat use the USB to ATA bridge that support LBA48 because I couldn't find that information in the wiki

Edit 2: I can only find the  the wiki for gigabeat F/X
http://www.rockbox.org/wiki/GigabeatInfo
I could only find that USB 2.0 ATA bridge Cypress EZ-USB AT2 for the F and Cypress EZ-USB AT2LP for the X but no mention of the one that use in the S. Both the USB 2.0 ATA bridge on F/X support 48 bit addressing
Title: Re: Gigabeat S with 160Gb HDD
Post by: gevaerts on August 07, 2011, 08:05:03 AM
The in-flash boot code on the gigabeat S does not like disks larger than 128GB. People have various ideas to work around these limitations, but given the price of such disks and the uncertainty of the outcome, nobody ever actually tried.

Since you now have both a gigabeat S and such a disk, you're in a good position to finally verify these ideas.

The best person to talk to about this is torne, either here on on irc.
Title: Re: Gigabeat S with 160Gb HDD
Post by: jhMikeS on August 07, 2011, 08:14:26 AM
There is no USB bridge IC in the Gigabeat S. It uses the ARC OTG controller and the software stack.
Title: Re: Gigabeat S with 160Gb HDD
Post by: beanxinh on August 07, 2011, 01:04:46 PM
I finally able to make rockbox recognize the full size of the disk. I made a silly mistake  :-[. I forgot to reformat the HDD after installing rockbox so rockbox can only see the 128Gb partition that the OF create. But now I have problem trying to change the size of the partition. If I changed the size of the partition to 160Gb the gigabeat will trying to reformat the partition back to 128GiB after I hard reset the device.I'll try to find a work around for it
Title: Re: Gigabeat S with 160Gb HDD
Post by: torne on August 07, 2011, 02:31:06 PM
You cannot create a partition which is larger than 128GB; the flash bootloader will always reformat it.

Let the original firmware format it, leave the existing partitions alone, then create a third partition on the drive which occupies the remaining space. You will need to set the third partition type to 0xFF (normal partitioning tools will almost certainly not let you do this, as this type is supposed to mean "partition does not exist"). This shouldn't trigger reformatting.

You then need to make a custom build of rockbox with multivolume support to allow it to see both data partitions. LBA48 support is already enabled as you saw, and there is no need to touch any of the sector size settings.

Nobody has actually tried this yet, but in theory it should work. If you want help with this then the easiest way is to ask people on IRC probably (especially me, but various others may be able to help too). We would quite like to see someone try this and prove it works so we can document how to do it :)
Title: Re: Gigabeat S with 160Gb HDD
Post by: beanxinh on August 09, 2011, 10:15:50 AM
I can at last make rockbox see all of my HDD. Thank Torne and gevaerts alot for their help.
This is what I did to make it work
- Make a live ubuntu usb.
- Follow this instruction up to the Gettign start part. Don't compile it now
  http://www.rockbox.org/wiki/LinuxSimpleGuideToCompiling
- Remove from firmware/target/arm/imx31/gigabeat-s/usb-target.h

#define USBSTOR_READ_SECTORS_FILTER() \
    ({ if (cur_cmd.sector == 0) \
            usb_fix_mbr(cur_cmd.data[cur_cmd.data_select]); \
    0; })

/* Disallow MBR writes entirely since it was "fixed" in usb_fix_mbr */
#define USBSTOR_WRITE_SECTORS_FILTER() \
    ({ cur_cmd.sector != 0 ? 0 : -1; })

- Apply the patch http://paste.debian.net/125614/
- Compile rockbox
- After Rockbox reset linux will no longer recognize rockbox partition. Just follow this guide to repair it   
http://www.rockbox.org/wiki/GigabeatSInstallation#Step_2_45_Fix_your_Gigabeat_39s_partition_table
- Unlug then replug the Gigabeat then use Gpart to create a FAT32 partition on the unsed space from the HDD
- fdisk /dev/sdz
t
3
ff
w
- Unplug the USB. rockbox should now see the new partition as <HD1>
- Recompile rockbox without the change in usb-target.h
- After rockbox reset windows can now recognize the new partition.
Cheer  ;D

Edit: the copy speed is very slow max at 2MB/s. Is there anyway to improve it ?
Title: Re: Gigabeat S with 160Gb HDD
Post by: torne on August 09, 2011, 12:56:04 PM
Glad this worked; we can hopefully write a plugin which will automate this process, and incorporate the required changes into the regular builds...
Title: Re: Gigabeat S with 160Gb HDD
Post by: beanxinh on August 10, 2011, 08:55:47 AM
I have connected the HDD to a ZIF to USB adapter and copy the Ubuntu Image to it in 50s with the average speed 14MB/s way higher than the average 2MB/s of rockbox.Are there anyway that I can improve the transfer rate of rockbox?

This is the information about my HDD that Rockbox give:
Model:TOSHIBA MK1634GAL
Firmware: VS210A
Size:131071MB
Free:80037MB
Spinup Time:2430ms
Power mgmt:unsupported
Noise mgmt:unsupported
Read-ahead: enable
PIO modes: 0 1 2 3 4
Cycle times: 120ns/120ns
Physical sector size: 4096
MDMA mode : 0 1 2
MDMA cycle times: 120ns/120ns
UDMA mode: 0 1 2 3 4 5
IORDY support:yes
IORDY disable: yes
Cluster size:32768 bytes
DMA mode:UDMA 4

Thank
Title: Re: Gigabeat S with 160Gb HDD
Post by: Ste- on October 14, 2011, 07:05:43 AM
I can at last make rockbox see all of my HDD. Thank Torne and gevaerts alot for their help.
This is what I did to make it work
- Make a live ubuntu usb.
- Follow this instruction up to the Gettign start part. Don't compile it now
  http://www.rockbox.org/wiki/LinuxSimpleGuideToCompiling
- Remove from firmware/target/arm/imx31/gigabeat-s/usb-target.h

#define USBSTOR_READ_SECTORS_FILTER() \
    ({ if (cur_cmd.sector == 0) \
            usb_fix_mbr(cur_cmd.data[cur_cmd.data_select]); \
    0; })

/* Disallow MBR writes entirely since it was "fixed" in usb_fix_mbr */
#define USBSTOR_WRITE_SECTORS_FILTER() \
    ({ cur_cmd.sector != 0 ? 0 : -1; })

- Apply the patch http://paste.debian.net/125614/
- Compile rockbox
- After Rockbox reset linux will no longer recognize rockbox partition. Just follow this guide to repair it   
http://www.rockbox.org/wiki/GigabeatSInstallation#Step_2_45_Fix_your_Gigabeat_39s_partition_table
- Unlug then replug the Gigabeat then use Gpart to create a FAT32 partition on the unsed space from the HDD
- fdisk /dev/sdz
t
3
ff
w
- Unplug the USB. rockbox should now see the new partition as <HD1>
- Recompile rockbox without the change in usb-target.h
- After rockbox reset windows can now recognize the new partition.
Cheer  ;D

Edit: the copy speed is very slow max at 2MB/s. Is there anyway to improve it ?


Thanks for the information above.
I was able to install a 240gb disk into my Gigabeat S.

127gb on first partition and 95.3 on the second.
Thanks again, it's working perfectly.