On 07/05/2017 04:53 PM, Patrick Dupre wrote:
> Why do you say that it is not a a multiple of 4k?
> dumpe2fs provides:
> Block size:               4096
> 
> At least 1646960 / 4 = 411740
> 
> du seems providing the size in k
> du /var/log/journal
> 1646956       /var/log/journal/f14e53f3162847d4ae17fd1ca988e33c
> 1646960       /var/log/journal
> ls -i /var/log/journal
> 1117919 f14e53f3162847d4ae17fd1ca988e33c
> 
> Is there something wrong?
Why are you trying to compare "du"'s output (a file's allocated disk
size) and "ls -i" (index of files first inode inode)? They aren't
measuring the same thing.

Unless overridden by an argument, "du" uses 1kibibyte (1024-byte)
blocks. You can set environment variables to change this default. It
checks for environment variables in this order:

        DU_BLOCK_SIZE
        BLOCK_SIZE
        BLOCKSIZE

So set those to whatever you wish. With none of those set, 1K is the
default unless the environment variable POSIXLY_CORRECT is set,
where the default display would be in 512-byte chunks. This is all
in the man page.

The allocation block size is dependent on how the filesystem was set up.
By default, the ext[2|3|4] filesystems use a block size that's
determined heuristically from the underlying device (partition) size and
default inode counts. It will choose 1024-, 2048- or 4096-byte blocks.
For most uses and with modern big-horking disks (yes, a highly technical
term), that usually comes out to 4K. You can change it as you see fit
but generally the default is "good enough".

>> Sent: Wednesday, July 05, 2017 at 10:44 PM
>> From: "Jon LaBadie" <jo...@jgcomp.com>
>> To: users@lists.fedoraproject.org
>> Subject: Re: /var/cache
>>
>> On Wed, Jul 05, 2017 at 10:16:34AM +0200, Patrick Dupre wrote:
>>> Hello,
>>>
>>> I have directory
>>> /var/log/journal which seems large:
>>> 1646960
>>>
>>
>> What type of file system are you using?  ext? or xfs or ??
>> I ask as ext expands its directories in 4K chunks and the
>> sizes you give above and below are not 4K multiples.
>>
>> Are you sure those are not inode numbers (ls -i)?
>>
>> If they are sizes, the total size of those 40+ directories
>> is just 61MB, about 0.5% of a small, 10GB file system.
>> It may not be worth worrying about recovering the space.
>>
>> On some file systems directories, once expanded, never
>> contract.  In that case, the "cure" is to create a new
>> temporary directory (eg. /var.new).  Set the ownership
>> and permissions of /var.new to match /var (don't forget
>> SELinux and extended attribute properties).  Move the
>> data to the new directory (mv /var/* /var.new).  Don't
>> forget any "dot" files/directories. Rename /var to
>> /var.old, rename /var.new to /var.
>>
>> When satisfied, repeat 40 times for the large
>> subdirectories and remove the empty old directories.
>>
>> This is best done from a boot off of external media and
>> mounting the hard disk filesystems under the portable
>> medium.  Often /a is a directory provided for this.
>>
>> Jon
>>
>>> but it is even worst for /var/cache: 14338744
>>> I gives the largest sub directories:
>>>
>>> 100602      /var/cache/PackageKit/hawkey
>>> 104278      /var/cache/PackageKit/25/hawkey
>>> 105988      /var/cache/yum/x86_64/21/fedora/gen
>>> 112622      /var/cache/yum/x86_64/22/fedora/gen
>> ...
>>> 6548048     /var/cache/PackageKit/24/metadata/updates
>>> 7287012     /var/cache/PackageKit/24/metadata
>>> 7424876     /var/cache/PackageKit/24
>>> 10930952    /var/cache/PackageKit
>>>
>>>
>>> How can I clean this?
>>>
>>> Thank.
>>>
>>> ===========================================================================
>>>  Patrick DUPRÉ                                 | | email: pdu...@gmx.com
>>>  Laboratoire de Physico-Chimie de l'Atmosphère | |
>>>  Université du Littoral-Côte d'Opale           | |
>>>  Tel.  (33)-(0)3 28 23 76 12                   | | Fax: 03 28 65 82 44
>>>  189A, avenue Maurice Schumann                 | | 59140 Dunkerque, France
>>> ===========================================================================
>>> _______________________________________________
>>> users mailing list -- users@lists.fedoraproject.org
>>> To unsubscribe send an email to users-le...@lists.fedoraproject.org
>>>>> End of included message <<<
>>
>> -- 
>> Jon H. LaBadie                  jo...@jgcomp.com
>> _______________________________________________
>> users mailing list -- users@lists.fedoraproject.org
>> To unsubscribe send an email to users-le...@lists.fedoraproject.org
>>
> _______________________________________________
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> 


-- 
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ri...@alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
- Politicians are the opposite of pickpockets because you never see  -
-        them take their hand out of your pocket.                    -
-                                             -- Larry Fine          -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to