Anyway to limit the amount of sectors the kernel tries to access?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
'dd if=/dev/zero of=/dev/sticklocation', then partitioning and formatting it should get your stick working again. If there's no malfunction then, yes, you should get full usable size.
I can't write (IO errors)
however, bad blocks works...]
perhaps I should add more information I forgot to include.
Windows XP can write/read the drive just like normal, the parititon is 1 Gig, but it still sees 3Gigs extra.
Linux however, cannot write or read, leading me to think that if I prevented the kernel from accessing the higher up sectors, everything would be a-ok and I could reset the partition table and use dd, etc.
Last edited by lambchops468; 05-16-2008 at 05:17 PM.
Hmm. AFAIK you can not deny the kernel from "accessing the higher up sectors" because that's not how things work. (Well you can, but that's HPA/DCO territory and that should not apply here.)
For fixed disks the Cylinder, Head Sector standard describes how a disk should be addressed in terms of hardware. Of course a Flash or USB stick device doesn't posess any physical CHS characteristics so partitioning software kind of wiggles values in a way that maximises but not exceeds the expected maximum storage capacity. Depending on the disks characteristics and formatting you end up with a device that has a Master Boot Record, a Partition Table (also containing Logical Block Addressing values if applicable) and a FAT(32) partition (which holds a Boot Record (which holds a Disk Parameter Block) one or two File Allocation Tables and the Root Directory). The PT holds the records for each partition: start "cylinder", end "cylinder", size in sectors, active flag and filesystem type ("/dev/sdb: unrecognized partition table type").
On device activation Linux (the kernel) looks for suitable block device drivers and does the low level handshaking with the device. This starts with looking at the block device itself ("usb-storage: device scan complete"), the MBR (if it needs to do something with it) then scanning the PT ("I/O error, dev sdb, sector n") to present available partitions to higher level kernel layers ("Buffer I/O error on device sdb2"). In terms of standards, protocols, compliance, Mcrsft Wndws is far more lenient, forgiving, than GNU/Linux ever will become (which definately is a Good Thing), and so Mcrsft Wndws being able to read slightly wonky disk layouts does not come as a surprise at all. Linux will not accept out of bounds values so if for instance in the PT a partitions amount of sectors exceeds what is "logical" for that partition given the start and end "cylinder" it will not accept add_disk() to proceed. Proceeding regardless would be comparable with trying to move a disks "head" beyond the partitions or even physical boundaries. AFAIK the same I/O errors show with read() or writes on already mounted filesystems where corruption makes one block point to a phantom block beyond the disks capacity. (Anyone want to correct me: BMG.)
Heh. All of this probably wasn't necessary to tell you the PT is corrupted, and maybe I should just revisit the OP and ask about the circumstances the disk died in in the first place. Maybe sloppy Mcrsft Wndws even has its purpose if it does allow you to delete PT records from there...
I've given up
I've bought a new 2GB flash drive.
I did erase the flash drive in windows using the windows dd port, but that didn't fix the hardware sector problems.
There is no sfdisk port for windows, so I've given up, and I can't find a windows tool that changes hardware geometry (Windows feels like a straitjacket...)
The problem is in the drive's actual hardware or whatever CHS numbers, not in the partition table (that doesn't exist anymore since the drive has been zeroed out up to its limit). It still reads the incorrect number of cylinders.
Last edited by lambchops468; 05-17-2008 at 03:52 PM.