# Setting dirty_ratio at boot

## Massimo B.

Hi, I tried to modify the default dirty_ratio to 50 at boot, but curiously it is not applied and always still 40. I only found these 2 places for sysctl.conf and the app-laptop/laptop-mode-tools, where it could get set, but who else could set that option?

```
# grep -i "^[^#].*dirty.*ratio.*" -R /etc 2>/dev/null

/etc/sysctl.d/my_sysctl.conf:vm.dirty_background_ratio = 10

/etc/sysctl.d/my_sysctl.conf:vm.dirty_ratio = 50

/etc/laptop-mode/laptop-mode.conf:LM_DIRTY_RATIO=60

/etc/laptop-mode/laptop-mode.conf:OLM_DIRTY_RATIO=50

/etc/laptop-mode/laptop-mode.conf:LM_DIRTY_BACKGROUND_RATIO=1

/etc/laptop-mode/laptop-mode.conf:NOLM_DIRTY_BACKGROUND_RATIO=10

# sysctl -a | grep dirty.*ratio

vm.dirty_background_ratio = 10

vm.dirty_ratio = 40

# service sysctl status

 * status: started

# service laptop_mode status

 * status: started

# service sysctl restart

 * WARNING: you are stopping a boot service

 * Configuring kernel parameters ...                 [ ok ]

# sysctl -a | grep dirty.*ratio

vm.dirty_background_ratio = 10

vm.dirty_ratio = 50

# service laptop_mode restart

 * WARNING: you are stopping a boot service

 * Stopping laptop_mode ...

Failed to re-set power saving mode for wireless card                                                                                 [ ok ]

 * Starting laptop_mode ...

Failed to re-set power saving mode for wireless card      

# sysctl -a | grep dirty.*ratio

vm.dirty_background_ratio = 10

vm.dirty_ratio = 40
```

----------

## Ant P.

Does running `sysctl --system` manually pick up those settings?

----------

## Massimo B.

Yes, it does. After a fresh system start-up:

```
# sysctl -a | grep dirty.*ratio

vm.dirty_background_ratio = 10

vm.dirty_ratio = 40

# sysctl --system

* Applying /etc/sysctl.d/my_sysctl.conf ...

vm.dirty_background_ratio = 10

vm.dirty_expire_centisecs = 6000

vm.dirty_ratio = 50

vm.dirty_writeback_centisecs = 1000

* Applying /etc/sysctl.conf ...

net.ipv4.ip_forward = 0

# sysctl -a | grep dirty.*ratio

vm.dirty_background_ratio = 10

vm.dirty_ratio = 50
```

----------

