LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-01-2010, 06:36 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
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 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...
 
Old 02-01-2010, 07:40 AM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,281
Blog Entries: 3

Rep: Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446
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.



The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

Last edited by onebuck; 02-02-2010 at 07:44 AM. Reason: EDIT: add missing link
 
Old 02-02-2010, 06:49 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
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?

Last edited by JZL240I-U; 02-02-2010 at 07:00 AM.
 
Old 02-02-2010, 06:53 AM   #4
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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
 
Old 02-02-2010, 07:10 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GrapefruiTgirl View Post
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....
I don't want to nitpicking, but as I understood it in the ext2/3 file systems the file names are stored in the inodes, i.e. structures of the file system itself. In other words the file system infrastructure is part of the files and thus part of my data.

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.

Last edited by JZL240I-U; 02-02-2010 at 07:12 AM.
 
Old 02-02-2010, 07:30 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by JZL240I-U View Post
So I got furious

What can be done here?

Thanks for reading this, I'm still fuming...
Getting mad at a USB stick is not going to be productive.......


Quote:
Interesting links, thanks, nut 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?
Well, did you read the parts about filesystem overhead?

"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....
 
Old 02-02-2010, 07:41 AM   #7
eyemole80
Member
 
Registered: Jun 2004
Distribution: Fedora Core 1
Posts: 47
Blog Entries: 1

Rep: Reputation: 16
Try creating the ext2/3 file system using "-m 0" parameter in mke2fs command. It will further reduce the disk usage overhead.
 
Old 02-03-2010, 08:28 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pixellany View Post
Getting mad at a USB stick is not going to be productive.......
I was (and am) mad at those people whose lazyness (stupidity?) wasted 200 MB in the best case and maybe hid something unwholesome in the worst. But then, "dd" be blessed.


Quote:
Originally Posted by pixellany View Post
Well, did you read the parts about filesystem overhead?...
Indeed I did and I knew before. But:

Quote:
Originally Posted by pixellany View Post
"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....
Well, I had it lowered to 4 kB. I am still experimenting and be back when I have more results.
 
Old 02-03-2010, 04:11 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
"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.
 
Old 02-03-2010, 04:38 PM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,281
Blog Entries: 3

Rep: Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446
Hi,

Yes, there are times when a penny should be wasted. Forget the penny earned bit!
 
Old 02-11-2010, 03:04 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pixellany View Post
"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.
Indeed. But it is a waste and a matter of principle for me -- darn, when I first could afford a computer (Atari Mega ST) it hat 1 (!) MB RAM and now we ignore the loss of 200 MB.

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 .
 
Old 02-12-2010, 04:42 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
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

I give up. If anybody knows a link where I can read up on this, I'd be grateful for your posting it here .
 
Old 02-12-2010, 07:28 AM   #13
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,281
Blog Entries: 3

Rep: Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446Reputation: 1446
Hi,

I posted links for a LFS in post #2. I'm sure that Google would provide a source for FAT details.

 
Old 02-22-2010, 11:54 AM   #14
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
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 .
 
Old 04-01-2010, 04:56 AM   #15
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Original Poster
Rep: Reputation: Disabled
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.
 
  


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
LXer: Installing "Sugar on a stick" (Strawberry Release) On A USB Stick LXer Syndicated Linux News 0 08-04-2009 03:50 PM
mount/umount usb stick - PQI Intelligent Stick 2.0 sandbag Linux - Software 5 05-06-2005 11:12 AM
fdisk and mke2fs with Sony memory stick Steve Riley Linux - General 3 01-25-2005 01:58 PM
basic fdisk and mke2fs with Sony memory stick Steve Riley Suse/Novell 0 01-24-2005 02:31 PM
USB problems: Memorex USB stick 256MB and PSX to USB adapter by Radio Shack Knuckles T15 Linux - Hardware 1 05-19-2004 06:58 PM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration