Bug 4054 - USB keychain drive sda1 points to partition table, not partition
Summary: USB keychain drive sda1 points to partition table, not partition
Status: CLOSED DOCUMENTED
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Andries Brouwer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-17 03:21 UTC by Jason H
Modified: 2005-01-17 14:51 UTC (History)
0 users

See Also:
Kernel Version: 2.6.8.1-3-amd64-k8, also 2.6.8 and 2.6.10 on k7
Tree: Mainline
Regression: ---


Attachments
od -x of partition table (23.91 KB, text/plain)
2005-01-17 03:27 UTC, Jason H
Details

Description Jason H 2005-01-17 03:21:04 UTC
Distribution: Ubuntu warty
Hardware Environment: KT800 (Athlon64), KT600 (Athlon XP)
Software Environment: Ubuntu warty, also with 2.6.10 from hoary

Problem Description:
Dane-elec 512MB USB keychain drive (using factory FAT partitions) works fine in
windows, and on friend's 2.6.10-rc2-mm4 dual Athlon XP, but partition won't
mount on my K7/K8 machines.

On 2.6.8 kernels on both AMD64 and K7 machines, and 2.6.10 kernel on K7,
/dev/sda1 apparently points to the beginning of the disk instead of the
partition (or something; note weird sizes):

# fdisk /dev/sda       # Looks fine
...
Command (m for help): p

Disk /dev/sda: 504 MB, 504365056 bytes
32 heads, 16 sectors/track, 1924 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1924      492536    e  W95 FAT16 (LBA)

==================

# fdisk /dev/sda1   # Shouldn't work!

Command (m for help): p

Disk /dev/sda1: 2082.3 GB, 2082317979648 bytes
32 heads, 16 sectors/track, 7943412 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1   *           1        1924      492536    e  W95 FAT16 (LBA)

Mounting obviously fails.  dd dumps of sda on friend's machine and mine are
identical(!), but sda1 comes out different.  sda is 504365056 bytes, and his
sda1 is 504356864 but mine comes out to 504340480 (dd reports I/O error after
getting this far).  

$ head sdb1.hex    # od -x dump of partition from friend's machine (good)
0000000 3ceb 4490 4b4f 3130 302e 0031 1002 0001
0000020 0002 0002 f800 00f1 0010 0020 0010 0000
0000040 07f0 000f 0080 dd29 6cd2 0076 0000 0000
0000060 0000 0000 0000 4146 3154 2036 2020 c933
0000100 d18e fcbc 167b bd07 0078 76c5 1e00 1656
0000120 bf55 0522 7e89 8900 024e 0bb1 f3fc 06a4
0000140 bd1f 7c00 45c6 0ffe 4e38 7d24 8b20 99c1
0000160 7ee8 8301 3aeb a166 7c1c 3b66 8a07 fc57
0000200 0675 ca80 8802 0256 c380 7310 33ed fec9
0000220 d806 8a7d 1046 f798 1666 4603 131c 1e56

$ grep "3ceb 4490" sda1.hex  # But on my machines, it starts later
0020000 3ceb 4490 4b4f 3130 302e 0031 1002 0001

$ head sdb.hex  # This is what I see at the beginning of both sda and sda1
0000000 c033 d08e 00bc fb7c 0750 1f50 befc 7c1b
0000020 1bbf 5006 b957 01e5 a4f3 becb 07be 04b1
0000040 2c38 097c 1575 c683 e210 cdf5 8b18 8b14
0000060 83ee 10c6 7449 3816 742c bef6 0710 ac4e
0000100 003c fa74 07bb b400 cd0e eb10 89f2 2546
0000120 8a96 0446 06b4 0e3c 1174 0bb4 0c3c 0574
0000140 c43a 2b75 c640 2546 7506 bb24 55aa b450
0000160 cd41 5813 1672 fb81 aa55 1075 c1f6 7401
0000200 8a0b 88e0 2456 06c7 06a1 1eeb 6688 bf04
0000220 000a 01b8 8b02 33dc 83c9 05ff 037f 4e8b

# tail /var/log/messages
Jan 17 03:51:59 erg kernel: usb 5-5: new high speed USB device using address 7
Jan 17 03:51:59 erg kernel: scsi11 : SCSI emulation for USB Mass Storage devices
Jan 17 03:51:59 erg kernel:   Vendor:           Model: USB Flash Memory  Rev: 1.00
Jan 17 03:51:59 erg kernel:   Type:   Direct-Access                      ANSI
SCSI revision: 02
Jan 17 03:52:00 erg kernel: SCSI device sda: 985088 512-byte hdwr sectors (504 MB)
Jan 17 03:52:00 erg kernel: sda: Write Protect is off
Jan 17 03:52:00 erg kernel:  /dev/scsi/host11/bus0/target0/lun0: [CUMANA/ADFS]
p1<5>Attached scsi removable disk sda at scsi11, channel 0, id 0, lun 0
Jan 17 03:52:00 erg kernel: Attached scsi generic sg4 at scsi11, channel 0, id
0, lun 0,  type 0
Jan 17 03:52:00 erg scsi.agent[8363]: disk at
/devices/pci0000:00/0000:00:10.4/usb5/5-5/5-5:1.0/host11/11:0:0:0
Comment 1 Jason H 2005-01-17 03:27:14 UTC
Created attachment 4425 [details]
od -x of partition table

/dev/sda (also sda1) from beginning to start of where sda1 should begin (od -x
output).  I assume that covers the MBR and partition table.
Comment 2 Andries Brouwer 2005-01-17 14:49:22 UTC
This is a consequence of enabling CONFIG_ACORN_PARTITION_CUMANA:
a 1 in 256 probability of getting any random partition recognized
as CUMANA/ADFS. Solution: do not enable CONFIG_ACORN_PARTITION_CUMANA.

Note You need to log in before you can comment on or make changes to this bug.