# fdisk /dev/sda = Unable to read /dev/sda

## zialien

Hello,

I am attempting to repartition my old 1gig memory stick so that i can use it as a live boot usb for my new toy (eee pc) but I cannot get it to partition.

It currently (to my knowledge) has one partition only as when i put the drive in and look at dev only sda1 is created. On a related note the stick works under windows xp fine, mounts and everything under my gentoo box fine i just cannot use fdisk. Also under Xandros on my eee it does not detect the partition but it does try to mount the device.

When the stick is inserted we get

```

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

usb 1-4: configuration #1 chosen from 1 choice

hub 1-4:1.0: USB hub found

hub 1-4:1.0: 1 port detected

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

usb 1-4.1: configuration #1 chosen from 1 choice

scsi60 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 19

usb-storage: waiting for device to settle before scanning

scsi 60:0:0:0: Direct-Access     USB 2.0  Flash Disk       1.00 PQ: 0 ANSI: 0 CC

S

sd 60:0:0:0: [sda] 2031616 512-byte hardware sectors (1040 MB)

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 26 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

sd 60:0:0:0: [sda] 2031616 512-byte hardware sectors (1040 MB)

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 26 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

 sda: sda1

sd 60:0:0:0: [sda] Attached SCSI removable disk

sd 60:0:0:0: Attached scsi generic sg0 type 0

usb-storage: device scan complete

```

When i try a fdisk -l it just makes the memory stick go nuts and dmesg shows 

```

hub 1-4:1.0: cannot reset port 1 (err = -110)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

hub 1-4:1.0: cannot disable port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

hub 1-4:1.0: cannot disable port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

hub 1-4:1.0: cannot disable port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: cannot reset port 1 (err = -71)

hub 1-4:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

hub 1-4:1.0: cannot disable port 1 (err = -71)

hub 1-4:1.0: cannot disable port 1 (err = -71)

sd 60:0:0:0: SCSI error: return code = 0x00070000

end_request: I/O error, dev sda, sector 0

Buffer I/O error on device sda, logical block 0

Buffer I/O error on device sda, logical block 1

Buffer I/O error on device sda, logical block 2

Buffer I/O error on device sda, logical block 3

hub 1-4:1.0: hub_port_status failed (err = -71)

sd 60:0:0:0: SCSI error: return code = 0x00070000

end_request: I/O error, dev sda, sector 0

Buffer I/O error on device sda, logical block 0

sd 60:0:0:0: SCSI error: return code = 0x00070000

end_request: I/O error, dev sda, sector 2031608

Buffer I/O error on device sda, logical block 253951

sd 60:0:0:0: SCSI error: return code = 0x00070000

end_request: I/O error, dev sda, sector 2031608

Buffer I/O error on device sda, logical block 253951

sd 60:0:0:0: [sda] READ CAPACITY failed

sd 60:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00

sd 60:0:0:0: [sda] Sense not available.

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 00 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

sd 60:0:0:0: [sda] READ CAPACITY failed

sd 60:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00

sd 60:0:0:0: [sda] Sense not available.

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 00 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

sd 60:0:0:0: [sda] READ CAPACITY failed

sd 60:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00

sd 60:0:0:0: [sda] Sense not available.

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 00 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

sd 60:0:0:0: [sda] READ CAPACITY failed

sd 60:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00

sd 60:0:0:0: [sda] Sense not available.

sd 60:0:0:0: [sda] Write Protect is off

sd 60:0:0:0: [sda] Mode Sense: 00 00 00 00

sd 60:0:0:0: [sda] Assuming drive cache: write through

```

so I'm assuming that the READ CAPACITY failed is a very bad thing. I have tryed simply reformatting the file system by dding /dev/zero then user mkfs.vfat that did not help. I tried to flush the partition table with the other magic dd command and got an error of something like unable to write.

do people have any idea? My system is kernel 2.6.21-gentoo-r4 (as i have not rebooted for 175 days) the rest of my system is fully up to day (within a week of today anyways)

----------

## NeddySeagoon

zialien,

Are you sure your memory stick is partitioned at all ?

Many are not - they are organised like floppies with no partition table. Still, fdisk does not throw errors, it just shows rubbish.

----------

## zialien

Hello NeddySeagoon,

If it is not partitioned then that is strange. I assumed that because it mounted as /dev/sda1 that there was a partition. It would explain the dd error when i tried to wipe the partition table (something like cannot write). This means though that I cannot use it for boot purposes would that be correct? Or will it just mean the whole thing is the one partition and it somehow gets bootable?

Cheers

----------

## NeddySeagoon

zialien,

As long as /dev/sda1 is your USB stick, its partitioned an behaves like a hard drive

----------

## zialien

Hello NeddySeagoon,

So I guess this becomes a dead unsolvable topic due to crap hardware?

Thanks Anyways I will just buy another memory stick.

----------

## timeBandit

Don't run to the store just yet.  :Wink: 

Are you trying this as an ordinary user or as root? You need to be root to repartition a drive, because you need read/write access to the whole-disk device (/dev/sda in your case). A regular user ordinarily has full access only to the partition device(s) (/dev/sda1), which is insufficient.

----------

## zialien

It was all done as root. I don't run sudo before you ask.

----------

## NeddySeagoon

zialien,

A couple of things. The kernel has found the partition table - so its there.

Can dd read it?

```
dd if=/dev/sda of=/dev/null count=1 bs=512
```

any errors ?

What is the Vendor and Device ID of the memory stick from lsusb ?

----------

## zialien

dd:

```
dd if=/dev/sda of=/dev/null count=1 bs=512

dd: reading `/dev/sda': Input/output error

0+0 records in

0+0 records out

0 bytes (0 B) copied, 1.05568 s, 0.0 kB/s
```

lsusb:

```
Bus 001 Device 020: ID 067b:2515 Prolific Technology, Inc. Flash Disk Embedded Hub
```

----------

## NeddySeagoon

zialien,

Google has lots of posts with problems with that device but I didn't find any solutions or root causes.

Reads of the what should be the master boot record fail but the kernel gets a partition table.

Thats two pieces of conflicting evidence. It suggests the partition table is not at block zero and the kernel can tell.

You could try multiples of 512 for the bs in dd. Larger flash drives have 4096 byte native block sizes. However, dd should cope with that.

----------

## zialien

Ok, I have tried 512 - 4096 with the same error. This is all rather confusing.

Any more ideas?

----------

