# newfs: maxcontig, max-extent-size, maxbpg



## Kdmeizk (Apr 19, 2015)

Hi,

I wonder if set up these options of newfs(8) to the max value (=2 147 483 647) is useful ? FreeBSD can use theses options without be stupid ? (example sets directly to the max value for a file).


----------



## Mjölnir (Apr 22, 2015)

No, it's not useful.  It would only be useful to set these values to the max if the filesystem had _only_ extraordinarily large files _and_ these are read _mostly _sequentially, _only one_ at a time.  If you want a quite life, just go with the default values for newfs.  They are fine for average use cases and UFS can auto-tune itself to some degree.


----------



## Kdmeizk (Apr 23, 2015)

For FreeBSD, these types of settings I don't think touch them.
My partition, which doesn't contain FreeBSD, is dedicated to keep video files which have near to 3,5Go. If these are max values, normally, I can put them without problems, no ?


----------



## kpa (Apr 23, 2015)

Kdmeizk said:


> For FreeBSD, these types of settings I don't think touch them.
> My partition, which doesn't contain FreeBSD, is dedicated to keep video files which have near to 3,5Go. If these are max values, normally, I can put them without problems, no ?



Think it this way. If the defaults were completely unsuitable for a common application like video files that tend to be rather large, you would very quickly find testimonies of such unsuitability on the net by a simple search. Yet, I can't find just about anything other than the standard documentation including this bit in the tuning(7) manual page:


```
Properly partitioning your system also allows you to tune newfs(8), and
tunefs(8) parameters. The only tunefs(8) option worthwhile turning on is
softupdates with ``tunefs -n enable /filesystem''. Softupdates drasti-
cally improves meta-data performance, mainly file creation and deletion.
We recommend enabling softupdates on most file systems; however, there
are two limitations to softupdates that you should be aware of when
determining whether to use it on a file system. First, softupdates guar-
antees file system consistency in the case of a crash but could very eas-
ily be several seconds (even a minute!) behind on pending write to the
physical disk. If you crash you may lose more work than otherwise. Sec-
ondly, softupdates delays the freeing of file system blocks. If you have
a file system (such as the root file system) which is close to full,
doing a major update of it, e.g., ``make installworld'', can run it out
of space and cause the update to fail. For this reason, softupdates will
not be enabled on the root file system during a typical install. There
is no loss of performance since the root file system is rarely written
to.
```

Use the defaults and don't worry too much about them, only if you can pinpoint a specific problem in the performance of UFS then you can start looking at a possible need for tuning.


----------



## Kdmeizk (Apr 23, 2015)

kpa said:


> If the defaults were completely unsuitable for a common application like video files that tend to be rather large, you would very quickly find testimonies of such unsuitability on the net by a simple search.


Yes sure. But don't know almost exactly a software can do and can't do for a physical storage is embarrassing for me. I would like to preserve at maximum as possible any physical storage and would ensure settings are "perfect". So may be yes, settings by defaults can be good, but how are we sure ? Often, especially for tunefs(8), there isn't precision on parameters. The only way, excepts many researches on Internet, is to get the source code ?


----------

