USB flash drive has bad superblocks. Sandisk said damage "likely caused by partitioning"

Lord Evermore

Ars Scholae Palatinae
1,490
Subscriptor++
Specifically I'm talking about a USB 3.0 thumb drive, not an SSD or memory card. And a rather hefty one, full-sized rather than miniature.
I know. I found it. It just took a lot of searching because they use the same words for different formats and completely different device types across several years. Just putting "USB 3.0" into the search wasn't helpful. I ended up limiting the search to 2012 to 2016 to eliminate the decade of other devices with virtually the same name.
 

Gandalf007

Ars Tribunus Angusticlavius
6,878
Subscriptor
Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type
/dev/sda1 0,1,1 1023,254,63 63 58368062 58368000 27.8G 83 Linux
/dev/sda2 1023,254,63 1023,254,63 58368063 120176639 61808577 29.4G 83 Linux


I spoke with a rep. at Sandisk, and he claimed that this was probably caused by my creating more than one partition on the drive. Their drives, he said, "aren't made to handle more than on partition". That sounded like bullsh*t to me. I asked him for documentation as proof of his claim. So far, no proof.

He told me to repartition it with one partition only, and reformat. I did that. I'm running h2testw on it right now.

Can partitioning a Sandisk flash drive cause bad blocks, as Sandisk claims?
The act of partitioning itself, no. However... the partition table you listed could be problematic for flash media due to the partition starting at sector 63 rather than a round (base 2) number. The manufacturer may not reveal what the internal flash cell size is, but it's probably larger than a single 512 byte sector -- maybe 4 kB, 16 kB, 64 kB, or more. Unaligned partitions can cause excessive writes, where a write that should only affect one cell actually causes multiple cells to be erased and rewritten.

Historically Linux fdisk would align partitions to cylinder boundaries for DOS compatibility, but CHS geometry is meaningless nowadays, so modern versions of fdisk start the first partition at a 1MB offset (LBA 2048 for 512-byte sectors).
 

w00key

Ars Praefectus
5,907
Subscriptor
The act of partitioning itself, no. However... the partition table you listed could be problematic for flash media due to the partition starting at sector 63 rather than a round (base 2) number. The manufacturer may not reveal what the internal flash cell size is, but it's probably larger than a single 512 byte sector -- maybe 4 kB, 16 kB, 64 kB, or more. Unaligned partitions can cause excessive writes, where a write that should only affect one cell actually causes multiple cells to be erased and rewritten.

Historically Linux fdisk would align partitions to cylinder boundaries for DOS compatibility, but CHS geometry is meaningless nowadays, so modern versions of fdisk start the first partition at a 1MB offset (LBA 2048 for 512-byte sectors).
Whoa, well spotted. Alignment and big enough cluster size (default ext4's 4K should be fine) is a must have.