LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   wrong size reported on usb stick (8MB) (https://www.linuxquestions.org/questions/linux-general-1/wrong-size-reported-on-usb-stick-8mb-882637/)

vonbiber 05-25-2011 10:57 AM

wrong size reported on usb stick (8MB)
 
Today, someone who had problems with his usb flash drive
showed it to me.
I plugged it in my linux box.
When the command
Code:

cat /proc/partitions
only showed
Code:

...
... sdb

and no partition name (sdb1, etc.). So I ran fdisk on it
I deleted all the partitions (4 in all) and recreated
a single partition taking up the whole drive and marked
it as c (win32 vfat)
I exited fdisk (w) and formatted the new partition
Code:

mkdosfs -F 32 /dev/sdb1
Then
Code:

mount /mnt/sdb1
df -h /mnt/sdb1

This displayed '8MB'
I don't know the real size of the stick but it should
be at least 4GB I think
Does anybody have a clue on what's happening there?

T3RM1NVT0R 05-25-2011 11:09 AM

@ Reply
 
Hi there,

Lets try the following:

1. fdisk /dev/sdb
2. Delete all the partitions it is showing up there.
3. Create a new partition and let the start and end of the cylinder to be default (whatever it prompt)
4. Write it to partition table.
5. mkfs.ext3 /dev/sdb1
6. mkdir /mnt/usb
7. mount /dev/sdb1 /mnt/usb
8. df -h (and let us know the output)

TobiSGD 05-25-2011 11:13 AM

Also, the output of fdisk -l /dev/sdb could help.

peter1234 05-26-2011 08:42 AM

This might help in finding the problem ......

-What is the brand name of usb flash drive and is it genuine? Because there are counterfeit usb flash
drive that will say 8Gb when in fact the actual capacity is very little. The counterfeiters change some
config on the flash drive, so when plugged in the OS will report the advertised amount, but when you are saving data it will take
unusually long time to save and you will not be able to save close to advertised amount or you will get a read/write errors.

-Lastly is the usb flash drive over the hill? Flash drive memory cells have a certain read/write cycle lifespan after which the cell become
unusable, so if this flash drive have gone through lot of read/write cycles then then it is on it's way out.

-If above is not applicable and what others said did not help, try repartition in a win PC and format
and see .........



.

vonbiber 05-27-2011 06:54 AM

I ran gparted, selected the device (/dev/sdb)
deleted the single partition I previously created with fdisk
Here's what gparted reports

Code:

Partition    File System    Size      Used    Unused    Flags
unallocated    unallocated  8.00 MiB  ---    ---

I didn't write the changes.
I ran fdisk to delete the partition:
Code:

fdisk /dev/sda
d
Selected partition 1
p

Disk /dev/sdb: 8 MB, 8388608 bytes
1 heads, 16 sectors/track, 1024 cylinders, total 16384 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
Disk identifier: 0xc4530a7f

  Device Boot  Start    End Blocks  Id System

The first time I created a single partition of type c (vfat 32)
and formatted it with 'mkfsdos -F 32'
The second time I recreated a single partition of linux type
and formatted it (ext3). df reported
Code:

Filesystem    Size  Used  Avail  Use%    Mounted on
/dev/sdb1    6.8M  1.1M    5.4M    17%    /mnt/usb

Quote:

-What is the brand name of usb flash drive and is it genuine? Because there are counterfeit usb flash
drive that will say 8Gb when in fact the actual capacity is very little. The counterfeiters change some
config on the flash drive, so when plugged in the OS will report the advertised amount, but when you are saving data it will take
unusually long time to save and you will not be able to save close to advertised amount or you will get a read/write errors.
Brand:
It's pretty worn out but it looks like something like
PNY is written on it.
As for the capacity, even if the manufacturer boasts 8G it should
be at least 1GB. As far as now the smallest capactiy is 128MB

Quote:

-Lastly is the usb flash drive over the hill? Flash drive memory cells have a certain read/write cycle lifespan after which the cell become
unusable, so if this flash drive have gone through lot of read/write cycles then then it is on it's way out.
Possibly, but then why does it display 8MB instead of nothing at all?

vonbiber 05-27-2011 09:47 AM

Another strange thing.
I formatted the flash drive in vfat.
I inserted it on a Windows XP system. The Property dialog
displayed this info
used space: 7209984 bytes
6.87 MB

available space: 0 bytes

And yet the disk is empty.
Next I inserted it in a linux box and copied a file
on it. I reinserted the stick in the XP machine and
my file was there (it's a simple text file of about 1140 bytes).


All times are GMT -5. The time now is 09:29 AM.