Bad sectors in flash drive.

anirudhghanta

New member
Local time
5:32 PM
Messages
3
Hi,
I need help in explicitly creating bad sectors in a flash drive. Is making bad sectors possible by repeadly disconnecting flash drive during file write process ??
How can a flash drive develop bad sectors in its memory ??

Thanks,
Anirudh
 

My Computer

OS
windows XP
Hi,
I need help in explicitly creating bad sectors in a flash drive. Is making bad sectors possible by repeadly disconnecting flash drive during file write process ??
How can a flash drive develop bad sectors in its memory ??

Thanks,
Anirudh

It is ill advised to disconnect a drive during the write process because the data can easily be corrupted and create bad sectors. Additionally, a flash drive has a limited number of write cycles and wears down over time, also, causing bad sectors.

HTH
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Professional x64
CPU
Intel i5 quad processor
Motherboard
DP67BG
Memory
16 GB
Graphics Card(s)
Radeon HD 5770
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Samsung SyncMaster
Screen Resolution
1920X1080
Hard Drives
WD 2TB (SATA Internal)
WD 1TB (USB External)
PSU
Corsair GS800
Case
Tower (Generic)
Cooling
3 Internal Fans
Keyboard
MS Wireless
Mouse
MS Optical Wired
Internet Speed
54 mbps
Antivirus
Emsisoft
Browser
IE-Version 9, Palemoon-Version 24.2.0
Hi,
I need help in explicitly creating bad sectors in a flash drive. Is making bad sectors possible by repeadly disconnecting flash drive during file write process ??
How can a flash drive develop bad sectors in its memory ??

Thanks,
Anirudh
Try formatting your flash drive. Then, in future never just disconnect without useing the Windows "Safely remove hardware and eject media" icon!
 

My Computer

Computer type
PC/Desktop
OS
Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Motherboard
ASUSTeK COMPUTER INC. P8H77-M
Memory
8.00 GB
Graphics Card(s)
Intel(R) HD Graphics 4000
Sound Card
On Board
Monitor(s) Displays
Dell 24"
Screen Resolution
1920 x 1080
Hard Drives
(1) INTEL SSDSC2CT180A3 ATA Device (2) ST500DM002-1BD142 ATA Device (3) WDC WD3200AAKS-75L9A0 ATA Device (4) Generic- Compact Flash USB Device (5) Generic- MS/MS-Pro USB Device (6) Generic- SD/MMC USB Device (7) Generic- SM/xD-Picture USB
PSU
500w Corsair
Case
Cooler Master
Cooling
3 Fans
Keyboard
Logitech MK300
Mouse
Logitech WOM
Internet Speed
75Mb
Antivirus
Norton 360
Browser
Firefox, Opera, IE
Hi,
I need help in explicitly creating bad sectors in a flash drive. Is making bad sectors possible by repeadly disconnecting flash drive during file write process ??
How can a flash drive develop bad sectors in its memory ??

Thanks,
Anirudh

I am curious to know what exactly is the purpose for creating bad sectors in a flash drive.

When you repeatedly keep writing and deleteing data, the flash drive will definitely age and bad sectors will be created.

One has to keep in mind, irrespective of how much data one writes into the pendrive ( one need not necessarily fill the pendrive) the flash controller tracks it and each time it writes to different sectors. In other words the data is spread uniformly among all sectors as you keep writing and erasing it so that all sectors age more or less uniformly.

The other point to note is that as bad sectors are created these are taken out of service and replaced by sectors reserved specifically for this purpose.. So in actual practice even if you manage to create bad sectors you may not notice it until........all the reserved sectors are exhausted and that point ....... your pendrive will become "write protected" ( The flash controller's safety mechanism will not allow you to write any more data into it. End of life and sudden death to the pendrive.)

So I presume you will never be able to see any bad sectors even if these are intentionally created by trying an accelerated aging process.
 

My Computer

OS
Windows 7 Home Premium 32 bit
Hi jumanji,

Thanks for the info, what I want to make clear is that - I am trying to write some data onto the usb stick using simple write commands in embedded c giving the write location and size and closing the file,Just to check if the file can be created of a particular size without writing any data into it . I also made it iterative and made it run for a while. Now the USB stick shows some bad sectors. My usb port is also a little malfunctioning.

Now, what i want to know is - Is there any way that my simple write algo went wrong without closing and started a new loop and can this cause bad sectors ??


Thanks and regards,
Anirudh
 

My Computer

OS
windows XP
1. How have you decided the USB stick shows some bad sectors?

2. What specific malfunction have you noticed in the USB port and how?

Well I am just curious. I am not a programming expert but what all I understand is that you are trying to create a sort of template of a fixed size and perhaps a fixed location ( whether logical or physical I do not know) for your file-writing (embedding). Beyond that it is all greek and latin to me :) and so I will not enter into it.

However as I had indicated in my previous post, in a flash storage device (e.g. USB stick, SD-Card), the flash controller implements a flash translation layer, so there is no actual correspondence of logical sectors and physical memory sectors. Bad flash sectors should be sorted out by the flash controller and remapped into the reserve sectors. So you will not come to know of the bad sectors in normal usage. And that is why my first question.

As far as the second question is concerned, it is well known that on some computers the files written on flash drives plugged into the front ports may become corrupt due to most probably interference in the cable. So I have been thinking whether this is the one you are referring to or experiencing.

You are doing some experimentation/trial. Then my intuition tells that

1.You should in the first instance use a known-to-be good new pen-drrive ( not an old pendrive that has seen many write/ read cycles and prone to develop bad sectors due to aging)

2. You should rather use the rear ports on the motherboard and not the front ports.

EDIT: Always format your flash drive with SD Formatter. https://www.sdcard.org/downloads/formatter_3/
 
Last edited:

My Computer

OS
Windows 7 Home Premium 32 bit
If you want to create corrupted files, you have to create a huge file and a file transfer protocol that demands a huge MTU, bit-depth, whatever. In the end, the header and footer encapsulating the data needs to practically span the whole thing. Like a poorly compressed file. Then interrupt it during the transfer.

That is just to clear up what I was reading in the thread. Alternatively, this is for getting bad sectors.
I am no expert in firmware but my suspicions are as follows:
- You could crack the drive open and scratch a memory cell physically. While being careful not to damage the others. (Good luck with that.)
- From a software point, you have to alter the OEM driver to stop it from running memory allocations. Otherwise, Windows will run with the driver's directions and attempt to prolong the life of the device by distributing the file accordingly. Defeating the purpose of any specific programming.
- Then you have to disable any level of automatic Trimming on external drives. (Not sure if it would get in the way, but disabling redundancy checks is always a good start to destroying a device.)
- Finally, build a program that writes over a specific sector an infinite number of times until the write fails. Keeping the bit-depth of the file low is recommended for speeding up the process.

As for delivering a script or method of accomplishing this, I am not educated enough to pull it off. Gonna have to get help elsewhere.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Sony
OS
Windows 8.1, 64-bit
CPU
Intel, CORE i5
Memory
8 Gb
Hard Drives
Samsung, 250 Gb, SSD
Antivirus
Ad-Aware
Browser
Opera, Chrome
Back
Top