LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-07-2020, 05:29 AM   #1
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230
Blog Entries: 2

Rep: Reputation: 50
Caveat emptor 128GB USB sticks


Further to my recent post regarding 128GB USB sicks (and the VERY embarrassing 'SOLVED' due to my forgetting to create filesystems after using fdisk - call me a geriatric if you will) I've news rather more interesting to report.

To recap briefly, I purchased five cheap ($7) Chinese 128GB USB sticks for use initially as temporary secondary backup devices to evaluate them. My first requirement was to backup a commercial 128GB USB stick in order to safeguard my $70 investment. I assumed that the manufacturer may have used some sort of anti-copy protection similar to that on DVDs, so wasn't surprised when the first attempt failed. The second attempt used a second of the new sticks with similar results.

I then moved to the second requirement, to reformat a stick with two 16GB ext4 partitions and a single 96GB ext4 partition for the remainder. This appeared to be successful since the two 16GB partitions mounted successfully, but the third gave a "bad partition" error. This got me suspicious, so I fdisk'd the remaining two new sticks, only to find, not the single NTFS partition I'd expected, but:

Code:
qtm:~># fdisk /dev/sdd1
Welcome to fdisk (util-linux 2.33.1).

Disk /dev/sdd1: 125 GiB, 134217711616 bytes, 262143968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device      Boot      Start        End    Sectors  Size Id Type
/dev/sdd1p1      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p2      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p3      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p4      4294967295 5035196669  740229375  353G ff BBT

qtm:~>#
The three BBT partitions sized at 2TB - ??? - plus a fourth smaller BBT suggest that the device is in fact a "composite storage unit" of some sort. My deduction is that some - perhaps all - "128GB" USB sticks consist PHYSICALLY of 4 x 32GB memory cells "tied together" by a "management unit" that makes them appear as a single 128GB device. REFORMAT THIS AT YOUR PERIL!!!

Further experimenting with the initial two sticks confirmed something very strange going on. I first attempted a standard repartition into a single XFAT partition, but this failed on both. I then used the standard "trick" of wiping the first few megabytes of the device:

Code:
qtm:~># dd if=/dev/zero of=/dev/sdd bs=4M count=1000
dd: error writing '/dev/sdd': No space left on device
474+0 records in
473+0 records out
1985966080 bytes (2.0 GB, 1.8 GiB) copied, 2.4177 s, 821 MB/s
qtm:~>#
... so dd could only find 2GB of storage on the device. Attempting to write a partition table then gave:

Code:
qtm:~># fdisk /dev/sdd
Welcome to fdisk (util-linux 2.33.1).

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xb375fedc.

Command (m for help): o
Created a new DOS disklabel with disk identifier 0xa7c1ff84.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-3878839, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3878839, default 3878839): 

Created a new partition 1 of type 'Linux' and of size 1.9 GiB.

Command (m for help): q

qtm:~>#
In other words, the "128GB USB stick" is now a 2GB device, and I've no idea how to change this.

All suggestions appreciated.
 
Old 02-07-2020, 07:48 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,133
Blog Entries: 20

Rep: Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733Reputation: 4733
We had a thread on this sort of thing some time ago. Apparently a lot of ultra-cheap sticks bought online have only a fraction of the memory they are supposed to have. Basically it's a scam. If you use them for backup and then need to do a restore, you'll find that most of the dump isn't actually there.

See for example https://www.linuxquestions.org/quest...nt-4175649723/

Last edited by hazel; 02-07-2020 at 07:54 AM.
 
3 members found this post helpful.
Old 02-07-2020, 09:05 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,774

Rep: Reputation: Disabled
Try deleting all partitions, create a new mbr, create a new partition, & see how big it says it is.
 
1 members found this post helpful.
Old 02-07-2020, 09:15 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
cheap ($7) Chinese 128GB USB sticks : the ole if it is too good to be true then ... proverb should be applied here.
 
1 members found this post helpful.
Old 02-07-2020, 09:50 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,550

Rep: Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597
Sandisk 128Gb USB 3.0 sticks are on Amazon for around $20, so I'm sure there will be knock-off 4Tb USB keys coming along for $10 soon!
 
Old 02-07-2020, 04:50 PM   #6
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
> if it is too good to be true then ... proverb should be applied here.

True enough, but sometimes investigating is the only way to know what's happening. Thing is, the original format does seems to be there, although I haven't yet tested this; but reformatting definitely screws things up good and proper.

> We had a thread on this sort of thing some time ago.

Looked it up and it seems to confirm my deductions. Didn't know that there WERE terabyte USB sticks, but his complaint about them is very similar to mine.

HOWEVER, he DOES report success reformatting 128GB sticks. My guess continues to be that the quality sticks can be reformatted and repartitioned like a standard block device, but that the cheaper ones that DO work cannot be reformatted for the reasons I've given above.

Looks like we need a list of real and fake USB sticks in the hardware section. If my fdisk report above is correct, this may be the best way to distinguish them.

Last edited by tekra; 02-07-2020 at 04:53 PM.
 
Old 02-07-2020, 05:14 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,804

Rep: Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224
Quote:
Originally Posted by tekra View Post
Code:
Disk /dev/sdd1: 125 GiB, 134217711616 bytes, 262143968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device      Boot      Start        End    Sectors  Size Id Type
/dev/sdd1p1      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p2      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p3      4294967295 8589934589 4294967295    2T ff BBT
/dev/sdd1p4      4294967295 5035196669  740229375  353G ff BBT
Quote:
Originally Posted by tekra View Post
True enough, but sometimes investigating is the only way to know what's happening. Thing is, the original format does seems to be there, although I haven't yet tested this; but reformatting definitely screws things up good and proper.
That "original format" looks like what would be printed for a partition table filled with 0xff bytes instead of zeros. Take a look with hexedit or hexdump.
 
1 members found this post helpful.
Old 02-07-2020, 05:29 PM   #8
Hermani
Member
 
Registered: Apr 2018
Location: Delden, NL
Distribution: Ubuntu
Posts: 261
Blog Entries: 3

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by tekra View Post
Looks like we need a list of real and fake USB sticks in the hardware section. If my fdisk report above is correct, this may be the best way to distinguish them.
Normally this would be a nice idea. However, I've been to China and can report that they have a gazillion number of names for the same stuff. You can make a list as long as you can imagine, it will never be comprehensive.

Normally I am happy to order from China. Most of the times I get OK things. However I have heard and seen so much bad things with bad SD cards and bad USB sticks, I now avoid these at all cost. Even watched a video from someone who had bought a "1 TB USB drive" for $ 7. Of course it did not have 1 TB of space. It did have malware on it that deleted all data from the Windows test system (pun intended).

So if I need a USB key I just go down to the local computer store and buy one.
 
Old 02-07-2020, 05:46 PM   #9
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
> looks like what would be printed for a partition table filled with 0xff bytes instead of zeros. Take a look with hexedit or hexdump.

Good suggestion. As you can see, it's reported as a fuseblock FS with 4096 block size, so I used dd to read the first two into a file:

Code:
qtm:~># m
/dev/sdd1 on /media/root/76E8-CACF type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
qtm:~># dd if=/dev/sdd of=USB-128GB bs=4096 count=2
2+0 records in
2+0 records out
8192 bytes (8.2 kB, 8.0 KiB) copied, 0.0016364 s, 5.0 MB/s
qtm:~># ll U*
-rw-r--r-- 1 root root 8192 Feb  8 08:55 USB-128GB
qtm:~># hd USB-128GB 
00000000  fa 33 c0 8e d0 bc 00 7c  8b f4 50 07 50 1f fb fc  |.3.....|..P.P...|
00000010  bf 00 06 b9 00 01 f2 a5  ea 1d 06 00 00 be be 07  |................|
00000020  b3 04 80 3c 80 74 0e 80  3c 00 75 1c 83 c6 10 fe  |...<.t..<.u.....|
00000030  cb 75 ef cd 18 8b 14 8b  4c 02 8b ee 83 c6 10 fe  |.u......L.......|
00000040  cb 74 1a 80 3c 00 74 f4  be 8b 06 ac 3c 00 74 0b  |.t..<.t.....<.t.|
00000050  56 bb 07 00 b4 0e cd 10  5e eb f0 eb fe bf 05 00  |V.......^.......|
00000060  bb 00 7c b8 01 02 57 cd  13 5f 73 0c 33 c0 cd 13  |..|...W.._s.3...|
00000070  4f 75 ed be a3 06 eb d3  be c2 06 bf fe 7d 81 3d  |Ou...........}.=|
00000080  55 aa 75 c7 8b f5 ea 00  7c 00 00 49 6e 76 61 6c  |U.u.....|..Inval|
00000090  69 64 20 70 61 72 74 69  74 69 6f 6e 20 74 61 62  |id partition tab|
000000a0  6c 65 00 45 72 72 6f 72  20 6c 6f 61 64 69 6e 67  |le.Error loading|
000000b0  20 6f 70 65 72 61 74 69  6e 67 20 73 79 73 74 65  | operating syste|
000000c0  6d 00 4d 69 73 73 69 6e  67 20 6f 70 65 72 61 74  |m.Missing operat|
000000d0  69 6e 67 20 73 79 73 74  65 6d 00 00 00 00 00 00  |ing system......|
000000e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001b0  00 00 00 00 00 00 00 00  33 b8 2c fa 00 00 80 01  |........3.,.....|
000001c0  01 00 07 fe ff ff 20 00  00 00 e0 ff 9f 0f 00 00  |...... .........|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002000
qtm:~>#
Been a long time since I worked with MBRs etc, but the part'n tab should be in the first 512 bytes. Anyone who knows/remembers the offsets might be able to throw light on the above, but sorry, doesn't look like all FFs.
 
Old 02-07-2020, 05:55 PM   #10
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
> Normally this would be a nice idea ...

You're quite right. My concern is that I'd thought of making a "Debian on a stick', but rather than using the small ones as usually recommended, I was thinking of 128GB as being useful for real work. The Deb site gives a list of "Standard Pendrives":

https://wiki.debian.org/StandardPendrive

... but this dates from 2014. Perhaps a list of recommended manufacturers - esp. for Newbies etc - would be short, feasible and could be tested at various sizes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Desktop RAM sticks I bought are only about half as tall as the RAM sticks they're replacing Gregg Bell Linux - Newbie 7 06-07-2016 06:16 AM
[SOLVED] USB sticks don't work afe r being used as I.S.O boot sticks grahama Linux - Newbie 20 06-23-2015 06:23 PM
[SOLVED] "read-only filesystem" error on USB sticks = bad sticks? newbiesforever Linux - General 4 09-26-2013 05:33 PM
LXer: Feilner's OpenVPN a Good Read - With One Caveat LXer Syndicated Linux News 0 12-15-2006 11:54 AM
CAVEAT: /boot/kernel.h & how not to clobber your kernel sources (Conectiva, Red Hat) JCCyC LinuxQuestions.org Member Success Stories 0 08-07-2003 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration