# where is the last space in this partition.

## pd1986

I deleted one partition in extended partition and made it for Linux(I have windows and Linux), /dev/sda7 formated in ext4. Recently, I found the details of disk space isn't correct. see this:

/dev/sda7        70G   66G  176M 100% /media/sda7

I posted one question about that happening to the root partition. One friend told me it's the reserved space for the system. But this time, the partition is just a mounted partition for stocking files, not for the system. Where is the nearly 3GB space?

Thanks in advance.

----------

## Jaglover

You can tweak it with tune2fs, be aware using all 100% will increase your fragmentation.

----------

## pd1986

 *Jaglover wrote:*   

> You can tweak it with tune2fs, be aware using all 100% will increase your fragmentation.

 

Thanks for you advice. I scarcely make changes in this partition. it still increases the fragmentation?

----------

## pd1986

 *Jaglover wrote:*   

> You can tweak it with tune2fs, be aware using all 100% will increase your fragmentation.

 

Did you mean this is caused by fragmentation? or there is also reserved block for root in this partition because it's formated in ext4?

----------

## Jaglover

Ext4 is good avoiding fragmentation, but it needs free space to do it, to move blocks around. If you take away that free space ...

----------

## NeddySeagoon

pd1986,

df gives different answers to different users.

root can see all the free space, normal users, by default, see 5% less.  All the extX filesystems do this, it stops a normal user filling the partition and crashing your system.

When there is no space for root to write logs and lock files, the only way out is to boot with a CD and delete stuff to free space.  You can change the 5% reserved space.

extX also reserves metadata space at filesystem create time. Thats either 128b or 256b per i-node.  look at df -i to see how many i-nodes you have.

The there is a little more used for copies of the filesystem superblock.

----------

## Jaglover

Right, but in case the volume is for storage only (as in this case) there are no logs nor locks and the system will not crash when filesystem gets filled up.

----------

## NeddySeagoon

Jaglover,

Yes ... so much for the history lesson.

Its quite safe to recover the space reserved for root in this example.

If remaking the filesystem is an option, you may be able to reduce the i-node count, if for example, you will only store large files on this filesystem.

You cannot increase the i-node count later, so better too many than too few.  Each file needs at least one i-node.

----------

## pd1986

 *Jaglover wrote:*   

> Ext4 is good avoiding fragmentation, but it needs free space to do it, to move blocks around. If you take away that free space ...

 

Thank you very much.

----------

## pd1986

 *NeddySeagoon wrote:*   

> Jaglover,
> 
> Yes ... so much for the history lesson.
> 
> Its quite safe to recover the space reserved for root in this example.
> ...

 

Thank you too. I only use this partition for stockage. So I release 3% of the space.

I know the i-node too. But I don't really understand how to determine the i-node count. As in this volume the sizes of files are various, so I keep using the default data block size. Does it mean that if I increase the data block size when I format the volume, the inode count will be reduced?

----------

## NeddySeagoon

pd1986,

You can see the i-node count with 

```
df -i
```

At filesystem make time, you can set the the ratio between i-nodes and storage space.  Your file system will still use 4k blocks by default, unless it is very small.  You can force the block size too. e.g. I use 1k blocks and one i-node per block on the filesystem I keep my portage tree on because most files there are smaller than 1kb.

My media server uses far fewer i-nodes as most of the files are ripped DVDs.  I think I made one i-node for every 2Gb there. 

See 

```
man mke2fs
```

to see how to choose the i-node count.

Do check with df -i, that you have it right before you use the filesystem, since you have to destroy the filesysten to fix it.

----------

## pd1986

 *NeddySeagoon wrote:*   

> pd1986,
> 
> You can see the i-node count with 
> 
> ```
> ...

 

Great help. Thank you very much.

----------

