FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > EXT3 Users

 
 
LinkBack Thread Tools
 
Old 02-07-2011, 01:45 PM
Stephane Cerveau
 
Default Compute the real total size of a partition formated in EXT3

Dear All,

*

In order to have a real percentage of freespace for a user interface, I’m trying to compute the size available on a 4GB USB key formatted in Ext3. Indeed after format, when I ask
df to give a summary of size, it tells that there is 75MB already used.

I would like to know the meaning of this 75MB ( is it the journal??) and especially how I can compute this when I want, whithout parsing the partition and the size of the file(s).

/dev/sda1 ********** 3.7G ***** 71.5MB ************** 3.4G 2% /mnt/internal*** **************


*

Best regards.

*

Stéphane Cerveau

Software Engineer

scerveau@awox.com

Phone:
+33 4 99 53 27 39



93, Pierre Duhem

34000 Montpellier

FRANCE

Phone: +33 4 67 47 10 00


Fax:***** +33 4 67 47 10 15





*






__________ Information from ESET NOD32 Antivirus, version of virus signature database 5853 (20110207) __________



The message was checked by ESET NOD32 Antivirus.



http://www.eset.com



_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
 
Old 02-07-2011, 03:30 PM
Andreas Dilger
 
Default Compute the real total size of a partition formated in EXT3

On 2011-02-07, at 06:45, Stephane Cerveau wrote:
> In order to have a real percentage of freespace for a user interface, I’m trying to compute the size available on a 4GB USB key formatted in Ext3. Indeed after format, when I ask df to give a summary of size, it tells that there is 75MB already used.
> I would like to know the meaning of this 75MB ( is it the journal??) and especially how I can compute this when I want, whithout parsing the partition and the size of the file(s).
> /dev/sda1 3.7G 71.5MB 3.4G 2% /mnt/internal

There are several different things that add up to this overhead. The journal is a significant factor for smaller filesystems, but there are also inode tables, allocation bitmaps, reserved space, and a few other things.

If you are using a very small embedded filesystem that doesn't need a lot
of performance, you can reduce the size of the journal at format time with
options like "-J size=4", and disable resizing with "-O ^resize_inode",
which also removes some overhead. The amount of reserved space can be reduced
with "-m <percentage>" (default 5%), though this can lead to significant file
fragmentation and permanent performance impact. Finally, depending on your
workload/usage pattern, the number of the inodes in the filesystem can be
reduced using "-i <ratio>".

As for computing the available size, you can't really do better than what statfs() returns.


Cheers, Andreas






_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
 
Old 02-07-2011, 04:17 PM
Stephane Cerveau
 
Default Compute the real total size of a partition formated in EXT3

Thank you for your answer.
And how can I calculate all this things (inode tables, allocation bitmaps, reserved space, and a few other things).
There is no way to know this system used space independently from the files stored on the FS ?
Because I'm doing a user interface where the user could be disturb to see that after even a format the size available is not equal to the total size
Best regards.

Stephane.

-----Original Message-----
From: Andreas Dilger [mailto:adilger@dilger.ca]
Sent: lundi 7 fvrier 2011 17:31
To: Stephane Cerveau
Cc: ext3-users@redhat.com
Subject: Re: Compute the real total size of a partition formated in EXT3

On 2011-02-07, at 06:45, Stephane Cerveau wrote:
> In order to have a real percentage of freespace for a user interface, I'm trying to compute the size available on a 4GB USB key formatted in Ext3. Indeed after format, when I ask df to give a summary of size, it tells that there is 75MB already used.
> I would like to know the meaning of this 75MB ( is it the journal??) and especially how I can compute this when I want, whithout parsing the partition and the size of the file(s).
> /dev/sda1 3.7G 71.5MB 3.4G 2% /mnt/internal

There are several different things that add up to this overhead. The journal is a significant factor for smaller filesystems, but there are also inode tables, allocation bitmaps, reserved space, and a few other things.

If you are using a very small embedded filesystem that doesn't need a lot
of performance, you can reduce the size of the journal at format time with
options like "-J size=4", and disable resizing with "-O ^resize_inode",
which also removes some overhead. The amount of reserved space can be reduced
with "-m <percentage>" (default 5%), though this can lead to significant file
fragmentation and permanent performance impact. Finally, depending on your
workload/usage pattern, the number of the inodes in the filesystem can be
reduced using "-i <ratio>".

As for computing the available size, you can't really do better than what statfs() returns.


Cheers, Andreas







__________ Information from ESET NOD32 Antivirus, version of virus signature database 5853 (20110207) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5853 (20110207) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
 
Old 02-08-2011, 01:16 PM
Stephane Cerveau
 
Default Compute the real total size of a partition formated in EXT3

Dear all,

I understood better now how to compute a real available size and the total size on an Ext3 Fs
Indeed in statfs or df, you have three field:
f_blocks
f_bfree
f_bavail

The difference between f_blocks and f_bfree is approximatively the size of the journal with some more information.
The difference between f_bavail and f_bfree is the reserved space used to maintain the filesystem ( -m options approx 5%by default).

So if you want to be safe and know the size available, use f_bavail and if you want to know the max size, add a "du -sh folder" result.

Best regards.

Stephane

-----Original Message-----
From: Andreas Dilger [mailto:adilger@dilger.ca]
Sent: lundi 7 fvrier 2011 17:31
To: Stephane Cerveau
Cc: ext3-users@redhat.com
Subject: Re: Compute the real total size of a partition formated in EXT3

On 2011-02-07, at 06:45, Stephane Cerveau wrote:
> In order to have a real percentage of freespace for a user interface, I'm trying to compute the size available on a 4GB USB key formatted in Ext3. Indeed after format, when I ask df to give a summary of size, it tells that there is 75MB already used.
> I would like to know the meaning of this 75MB ( is it the journal??) and especially how I can compute this when I want, whithout parsing the partition and the size of the file(s).
> /dev/sda1 3.7G 71.5MB 3.4G 2% /mnt/internal

There are several different things that add up to this overhead. The journal is a significant factor for smaller filesystems, but there are also inode tables, allocation bitmaps, reserved space, and a few other things.

If you are using a very small embedded filesystem that doesn't need a lot
of performance, you can reduce the size of the journal at format time with
options like "-J size=4", and disable resizing with "-O ^resize_inode",
which also removes some overhead. The amount of reserved space can be reduced
with "-m <percentage>" (default 5%), though this can lead to significant file
fragmentation and permanent performance impact. Finally, depending on your
workload/usage pattern, the number of the inodes in the filesystem can be
reduced using "-i <ratio>".

As for computing the available size, you can't really do better than what statfs() returns.


Cheers, Andreas







__________ Information from ESET NOD32 Antivirus, version of virus signature database 5853 (20110207) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5855 (20110208) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
 

Thread Tools




All times are GMT. The time now is 07:15 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org