LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   PNY 512M Memory stick error- cannot read sector 0 (https://www.linuxquestions.org/questions/linux-hardware-18/pny-512m-memory-stick-error-cannot-read-sector-0-a-606599/)

hal8000b 12-13-2007 02:51 PM

PNY 512M Memory stick error- cannot read sector 0
 
If anyone has a PNY 512M memory stick I could do with knowing the CHS geometry.

Heres what sfdisk /dev/sdb thinks about the memory stick:

[root@zen anc]# sfdisk /dev/sdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 489 cylinders, 64 heads, 32 sectors/track
read: Input/output error

sfdisk: read error on /dev/sdb - cannot read sector 0
/dev/sdb: unrecognized partition table type
Old situation:
No partitions found
Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).

/dev/sdb1 :quit
trailing junk after number

/dev/sdb1 :
/dev/sdb1 0+ 488 489- 500735+ 83 Linux
/dev/sdb2 :
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 :
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 :
/dev/sdb4 0 - 0 0 0 Empty
New situation:
Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sdb1 0+ 488 489- 500735+ 83 Linux
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Do you want to write this to disk? [ynq]
Please answer one of y,n,q
Do you want to write this to disk? [ynq] y
read: Input/output error

sfdisk: read error on /dev/sdb - cannot read sector 0
Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1


This looks bad, either cannot read sector 0 or just wrong geometry?
If I try and zero the boot sector:

dd if=/dev/zero of=/dev/sdb1 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 1.918e-05 seconds, 26.7 MB/s

It appears to write to sector 0 but on reinserting the drive I still get cannot read sector 0.


Output from kernel messages:

usb-storage: waiting for device to settle before scanning
Vendor: Model: USB Flash Memory Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdb: 1001472 512-byte hdwr sectors (513 MB)
sdb: Write Protect is off
sdb: Mode Sense: 0b 00 00 08
sdb: assuming drive cache: write through
SCSI device sdb: 1001472 512-byte hdwr sectors (513 MB)
sdb: Write Protect is off
sdb: Mode Sense: 0b 00 00 08
sdb: assuming drive cache: write through
sdb:<6>sd 7:0:0:0: SCSI error: return code = 0x08000002
sdb: Current: sense key: Medium Error
Additional sense: No additional sense information
Info fld=0x0
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0
sd 7:0:0:0: SCSI error: return code = 0x08000002
sdb: Current: sense key: Medium Error
Additional sense: No additional sense information
Info fld=0x0
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0


dmesg shows drive as 513M but its a 512M usb stick.
Here is hdparm and sdparm idea of the chs geometry:

hdparm -g /dev/sdb

/dev/sdb:
geometry = 489/64/32, sectors = 1001472, start = 0

sdparm -v /dev/sdb
/dev/sdb: USB Flash Memory 1.00
>> Read write error recovery mode page [0x1] failed
>> Caching (SBC) mode page [0x8] failed
>> Control mode page [0xa] failed
>> Informational exceptions control mode page [0x1c] failed


Has my pen drive completely lost it, I tried PNY web site but cannot find any geometries for the drives.

Thanks in advance.

Junior Hacker 12-16-2007 12:16 AM

Quote:

It appears to write to sector 0 but on reinserting the drive I still get cannot read sector 0.
When you write zeros to the first sector (MBR) (sector 0), you effectively erase any data contained within. Makes sense that the computer can't read a sector with nothing to read, doesn't it?
You need to re-partition the drive and format the partition. Creating a partition and formatting it sets up the MBR and then there will be something there the computer can understand in order to mount and access the drive.
This can all be done with Windows disk management in Windows, or with some applications available for Linux.


All times are GMT -5. The time now is 06:25 PM.