Patch to read/write TiVo disks, which I used when my Maxtor started to throw bad blocks. There is no need to do any "byteswapping" in the IDE subsystem. [root@lembas tivo]# echo noop > /sys/block/uba/queue/scheduler [root@lembas tivo]# echo 32 > /sys/block/uba/queue/read_ahead_kb [root@lembas tivo]# dd_rescue -B 4k /dev/uba9 /dev/ubb9 diff -urp -X dontdiff linux-2.6.16-rc5/fs/partitions/mac.c linux-2.6.16-rc5-lem/fs/partitions/mac.c --- linux-2.6.16-rc5/fs/partitions/mac.c 2005-06-17 12:48:29.000000000 -0700 +++ linux-2.6.16-rc5-lem/fs/partitions/mac.c 2006-03-10 13:31:02.000000000 -0800 @@ -45,11 +45,14 @@ int mac_partition(struct parsed_partitio md = (struct mac_driver_desc *) read_dev_sector(bdev, 0, §); if (!md) return -1; - if (be16_to_cpu(md->signature) != MAC_DRIVER_MAGIC) { + if (be16_to_cpu(md->signature) == MAC_DRIVER_MAGIC) { + secsize = be16_to_cpu(md->block_size); + } else if (be16_to_cpu(md->signature) == TIVO_BOOT_MAGIC) { + secsize = 512; + } else { put_dev_sector(sect); return 0; } - secsize = be16_to_cpu(md->block_size); put_dev_sector(sect); data = read_dev_sector(bdev, secsize/512, §); if (!data) diff -urp -X dontdiff linux-2.6.16-rc5/fs/partitions/mac.h linux-2.6.16-rc5-lem/fs/partitions/mac.h --- linux-2.6.16-rc5/fs/partitions/mac.h 2005-06-17 12:48:29.000000000 -0700 +++ linux-2.6.16-rc5-lem/fs/partitions/mac.h 2006-03-10 12:42:03.000000000 -0800 @@ -32,6 +32,7 @@ struct mac_partition { #define MAC_STATUS_BOOTABLE 8 /* partition is bootable */ #define MAC_DRIVER_MAGIC 0x4552 +#define TIVO_BOOT_MAGIC 0x1492 /* Driver descriptor structure, in block 0 */ struct mac_driver_desc { diff -urp -X dontdiff linux-2.6.16-rc5/drivers/block/ub.c linux-2.6.16-rc5-lem/drivers/block/ub.c --- linux-2.6.16-rc5/drivers/block/ub.c 2006-02-26 23:03:55.000000000 -0800 +++ linux-2.6.16-rc5-lem/drivers/block/ub.c 2006-03-10 13:51:03.000000000 -0800 @@ -114,7 +113,7 @@ /* */ -#define UB_PARTS_PER_LUN 8 +#define UB_PARTS_PER_LUN 16 #define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */