# how to stop polling of drives?

## FizzyWidget

I have noticed that the HDD light blinks every few seconds, even when not doing anything, after googling about it seems it might be the fact that ext4 likes to write to the drive every 5 seconds, even though I have noatime as a mount option, where as others are saying it is udisks

I have added commit=600 to the mount options for the ext4 partitions and rebooted and it seems like the  lights have stopped blinking, although i did also do udisks --inhibit-all-polling before reboot.

Is the commit option the best approach or is there a better option, other than changing filesystem, which in this case would be hard as root is ext4, and xfs partition seems to fill up rapidly if you use it for torrents

----------

## mp342

the udisks polling doesn't happen very often, udisk only read smart data of the disk to check there health. You can disable them but you will not be alerted when one of your disk start to complain, you only know when the disk stop working.

For ext4 commits, if you set too big commits intervals, using a journaled fs become useless. The data are committed to the disk more often than the journal.

----------

## FizzyWidget

600sec = 10 mins so i think that is good enough, if something happens i loose 10 mins worth of stuff, on a storage pc the data and journal will be written in that time, i just think every 5 secs is overkill, since adding the commit option the light on the HDD doesn't blink as much  :Smile: 

suppose i best start polling again then  :Smile: 

----------

## mp342

What I mean is you can remove the journal with a commit interval of 600 secs because the fs write the data asynchronously but it never wait 600 secs to write them on the disk (I hope so !).

The journal brings you something only if it is saved on disk sooner than the effective write operation. Thats way, if you have a sudden halt, the journal can recover some of the operation witch are not done. If the journal is slower than the normal write operation of the fs, it is useless.

----------

## FizzyWidget

after reading a bit more about ext4 mount options, which atm i am using 

```
/dev/sda4    /home    /ext4    defaults,noatime, commit =600 0 1
```

i have looked at dmesg and i see

```
EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: commit=600
```

so defaults must use

```
data=ordered
```

data=ordered	(*)	All data are forced directly out to the main file

				system prior to its metadata being committed to the

				journal.

should i change it to 

```
data=journal
```

data=journal		All data are committed into the journal prior to being

			        written into the main file system.

and remove the commit part? I just dont want it attempting to write to the drive(s) every 5 seconds, what is the optimal fstab options for ext4 ?

----------

## Hypnos

FYI, you can tune how long the data is cached before being written to disk with 

/proc/sys/vm/dirty_writeback_centisecs

Then increasing the ext4 journal commit time is still sensible.

----------

## mp342

 *Hypnos wrote:*   

> FYI, you can tune how long the data is cached before being written to disk with 
> 
> /proc/sys/vm/dirty_writeback_centisecs
> 
> Then increasing the ext4 journal commit time is still sensible.

 

I didn't knew this option. It could save some power when using my laptop without sensible data, thanks.

@Dark Foo :

If what you want is to remove intermittent access to the disk but still want the data are written to the disk normally, remove the journal.

If you want access to the disk happen only one time every xx seconds, configure the commit to this duration and the setting provided by Hypnos to a larger interval.

----------

## FizzyWidget

so edit file here /proc/sys/vm/dirty_writeback_centisecs and remove commit option from fstab or have both? My main goal is to have the journal for obvious reasons but I don't want it being written every 5 seconds

Also what would be a good value to put there? The value that is already there is that seconds?

edit: seems its hundredths of a second, and the general opinion seems to be to change it to 1500

----------

## mp342

 *Dark Foo wrote:*   

> so edit file here /proc/sys/vm/dirty_writeback_centisecs and remove commit option from fstab or have both? My main goal is to have the journal for obvious reasons but I don't want it being written every 5 seconds
> 
> Also what would be a good value to put there? The value that is already there is that seconds?
> 
> edit: seems its hundredths of a second, and the general opinion seems to be to change it to 1500

 

then, set commit interval. For /proc/sys values, you must set them in /etc/sysctl.conf to make them persistent.

----------

## FizzyWidget

will do once both pcs have finished compiling updates  :Smile: 

Another thing, have you ever heard of laptop mode?

----------

## mp342

Nope. I never used a dedicated tool to configure the mode of my laptop.

----------

## FizzyWidget

What would i have to put in /etc/sysctl.conf ? after looking at the way some of the other options are written I am a little stuck

----------

## mp342

You just have to replace '/' of the path with '.' without '/proc/sys' prefix and put the value you want after ( = xx).

----------

## FizzyWidget

so .dirty_writeback_centisecs 1500 ?

----------

## mp342

 *Dark Foo wrote:*   

> so .dirty_writeback_centisecs 1500 ?

 

vm.dirty_writeback_centisecs = 1500

----------

## FizzyWidget

Aww i was close  :Smile:  - Thanks for the help

----------

