USB-stick empty but 200 MB used? Parameters for fdisk?
Hi all,
I recently got a 4 GB USB-stick (CBM V88) at a meeting. After removing all files to my hard disk it still had about 200 MB used space! I tried several kinds of deleting what ever that was -- to no avail. So I got furious and zeroed out the first 210 MB with dd and then used fdisk and mkfs to create a new FAT 16 partition (I need the stick to transfer data between windows and linux/bsd). So far so good. Then I noticed still 4096 kB used space with no file shown :mad: What can be done here? During fiddling with fdisk parameters heads / sectors / cylinders I noticed that there were something like 5125 blocks of 512 bytes not allocated (which is about 2,5 MB?!?). Can anyone point me to a reference how to calculate an optimized heads / sectors / cylinders count for a stick of the size of 4.108.070.912 bytes or, even better, explain it here for all interested readers? Thanks for reading this, I'm still fuming... |
Hi,
You can look at the 'Linux File System' section of 'Slackware-Links' to get some useful information. Basically the filesystem creation does have overhead for pointers to information stored on the device no matter the filesystem type. Look at the links to get a full description of LFS. 'Understanding UNIX / Linux file system' is one but there are other detailed links. :hattip: The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
Interesting links, thanks, but that does not really explain what I asked:
Why and how is there a chunk of hidden data on the stick, which refuse to get deleted? How do I allocate all available memory? |
If there is to be any sort of filesystem at all on the device, there will ALWAYS be space you cannot have; it is used by the device itself, for keeping track of what-all is on the device. There's no way around this, though you *might* look up "Linux Swap File Format" and see if that format would free up more space. BUT: using swap file format will make the device unusable for most purposes.
Alternately, the device could be one of the ones with that Windows U3 "technology" on it, in which case, you would need to use the Windows U3 tools to remove the stuff and free up the space. Regardless, if there's a filesystem on the device, there will be space you cannot have. Simple as that. Sasha |
Quote:
In this case (though I use FAT) I'd expect the physical memory in its entirety to be mapped on the file system plus data. As an aside, 2,5 MB just for file system housekeeping seems to be quite a lot. Tell you what: I factorized those 4.108.070.912 physical bytes of the stick (= 2^12 * 11 * 73 * 1249). Tonight I'll try to fit those numbers into the allowed ranges of fdisk's parameters and see if and what it brings. I'll report back when I know. |
Quote:
Quote:
"2GB" sd card Reformatted to Linux ext3, partition type 83: df: Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdd1 1952496 35716 1817596 2% /media/disk fdisk: /dev/sdd1 1 984 1983712+ 83 Linux It looks like there are two levels of overhead.... |
Try creating the ext2/3 file system using "-m 0" parameter in mke2fs command. It will further reduce the disk usage overhead.
|
Quote:
Quote:
Quote:
|
"Wasted 200MB"
With modern drives, you are talking ~ 0.1 % of the total capacity. In my book, it would almost never be worth ANY effort to improve that. Most users will never know--or care--if they are missing 200MB. |
Hi,
Yes, there are times when a penny should be wasted. Forget the penny earned bit! |
Quote:
And then I never was sure what might be hidden there, because 200 MB inaccessible on a USB stick is more than necessary IMHO. Lastly, I like to learn :). |
Well. I tried some more configurations. WinXP couldn't read them... So I went back to the defaults of fdisk for a FAT32 (LBA) file system (type "c" AFAIR). Now WinXP sees the stick again. It says 4069 bytes are used of a total capacity of 4.110.741.504 bytes (3,82GB). Linux sees a capacity of 4.118.806.528 bytes, i.e. 8.065.024 bytes more :scratch:
I give up. If anybody knows a link where I can read up on this, I'd be grateful for your posting it here :). |
Hi,
I posted links for a LFS in post #2. I'm sure that Google would provide a source for FAT details. :hattip: |
Sorry for being back late. And yes, I (re)-read the links. But so far nothing like "formatting USB-sticks for dummies" turned up in google ;)
I can live with what I have, but I'd like deeper insights into the CHS secrets of USB-stick formatting. I'll come back if/when I (ever) find some(any)thing ;). |
I tried it with this:
http://thunk.org/tytso/blog/2009/02/...se-block-size/ Costs 4kB now, which is acceptable and, I think, the usual size of an empty directory ona drive of this size. |
All times are GMT -5. The time now is 05:15 AM. |