LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 12-13-2011, 10:25 PM   #1
abubobe
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
DOC diskusage reading on embedded linux filesystem


Hi LQ members,
I just join today to this forum, with a question in my head

I have this embedded linux board. It's already with busybox. The disk storage is around 4GB (disk on chip). It's partitioned in to 2 (50MB and the remaining). It's formatted with EXT3 linux filesystem.

I would like to know from you guys if you know the explanation for this:
  1. i pumped in data to 2nd partition, 3208MB, and the diskusage is 97%
  2. i removed dataset above and pumped in another dataset to 2nd partition, 3178MB, and the diskusage shows 98%

Why is the reading of diskusage like that? In 2nd attemp i pumped in lesser data but the diskusage percentage was greater. I used "df -kh".

Please advice.

Thanks,
Abu Bobe
 
Old 12-13-2011, 11:28 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946
Disk space is allocated in blocks -- usually 4096 byte blocks for ext3, if I recall correctly. The size used by each file is rounded up to an integer number of blocks. (Certain filesystems can pack multiple short blocks into one physical block, so the above description does not apply to all filesystems. The ext* family of filesystems does not do that, though.)

This means that all files between 0 and 4096 bytes will always take up one block per file, 4096 bytes of disk space. All files between 4097 and 8192 bytes will take two blocks per file, 8192 bytes of disk space. And so on.

For example, on a typical ext filesystem with 4096 byte blocks, 100 files each being say 1 to 100 bytes in length will need twice the amount of disk space, than 50 files each being say 4000 to 4096 bytes in length. This is because in both cases, each file will need one block.

In your case, the latter set might just have had a lot more files, although their sizes were smaller, so they needed a larger number of blocks (including partially filled blocks) -- and therefore a larger percentage of the available disk space.

Does this answer your question?

Last edited by Nominal Animal; 12-13-2011 at 11:29 PM.
 
Old 12-14-2011, 12:18 AM   #3
abubobe
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Nominal Animal,

Quote:
Disk space is allocated in blocks -- usually 4096 byte blocks for ext3, if I recall correctly. The size used by each file is rounded up to an integer number of blocks. (Certain filesystems can pack multiple short blocks into one physical block, so the above description does not apply to all filesystems. The ext* family of filesystems does not do that, though.)

This means that all files between 0 and 4096 bytes will always take up one block per file, 4096 bytes of disk space. All files between 4097 and 8192 bytes will take two blocks per file, 8192 bytes of disk space. And so on.

For example, on a typical ext filesystem with 4096 byte blocks, 100 files each being say 1 to 100 bytes in length will need twice the amount of disk space, than 50 files each being say 4000 to 4096 bytes in length. This is because in both cases, each file will need one block.
Yes,, i ve read this somewhere

Quote:
In your case, the latter set might just have had a lot more files, although their sizes were smaller, so they needed a larger number of blocks (including partially filled blocks) -- and therefore a larger percentage of the available disk space.
... i didn't know that one, thanks for letting me know.

Do you think other posibility make sense? Ie. some spaces were actually occupied by a process (eg. tffs process that commit the data to DOC) as a swap/temp partition. Meaning, by the time i did "df -kh" the swap/temp area was not cleared yet. Or some spaces were occupied by filesystem journal? -- i could not find out how to prove it though

-- Abu Bobe
 
  


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
After filesystem what is next on embedded linux? odesus Linux - Embedded & Single-board computer 5 02-25-2009 06:05 AM
Shared Objects in Embedded Linux Filesystem ashok449 Linux - Kernel 5 07-06-2008 06:55 AM
Small linux for reading doc files on xp pc rajendra8 Linux - Distributions 4 04-25-2007 08:05 AM
Reading OpenOffice .doc document satimis Linux - General 7 08-06-2005 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration