pvi
December 26th, 2010, 02:58 PM
Im running Ubuntu server 10.10 as a NAS. To save my harddisk I want it to go to sleep after some period of inactivity (only harddisk, not whole system). To do this I installed laptop-mode tools and enabled the writecache (should wait 6 min before flushing with LM_AC_MAX_LOST_WORK_SECONDS conf parameter). But after the disk goes into sleep mode, it activates within a minute again.
I've tested this several times with the command sudo hdparm -y /dev/sda.
I thought maybe processes writing to disk was the reason for this, so I monitored the disk io for a certain period with iotop -o -b to see which processes did write to disk. This is the output for several minutes:
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
8701 be/4 www-data 0.00 B/s 0.00 B/s 0.00 % 0.00 % sh /usr/share/awstats/tools/update.sh
276 be/3 root 0.00 B/s 106.02 K/s 0.00 % 6.23 % [jbd2/sda1-8]
8699 be/4 syslog 0.00 B/s 15.15 K/s 0.00 % 0.00 % rsyslogd -c4
276 be/3 root 0.00 B/s 34.03 K/s 0.00 % 15.64 % [jbd2/sda1-8]
8699 be/4 syslog 0.00 B/s 22.68 K/s 0.00 % 0.00 % rsyslogd -c4
1243 be/4 postfix 0.00 B/s 0.00 B/s 0.00 % 0.00 % qmgr -l -t fifo -u
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
8817 be/4 root 0.00 B/s 121.07 K/s 0.00 % 0.00 % webmincron.pl
8817 be/4 root 0.00 B/s 3.79 K/s 0.00 % 0.00 % webmincron.pl
8817 be/4 root 0.00 B/s 53.04 K/s 0.00 % 0.00 % [miniserv.pl]
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
Its all in KB, so not much writing. I would expect the write cache big enough to handle this. The thing is, I cant figure out how big the write cache is. I mean the one in Ubuntu (I assume there is one), not of the drive itself.
Can anyone help me with this?
I've tested this several times with the command sudo hdparm -y /dev/sda.
I thought maybe processes writing to disk was the reason for this, so I monitored the disk io for a certain period with iotop -o -b to see which processes did write to disk. This is the output for several minutes:
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
8701 be/4 www-data 0.00 B/s 0.00 B/s 0.00 % 0.00 % sh /usr/share/awstats/tools/update.sh
276 be/3 root 0.00 B/s 106.02 K/s 0.00 % 6.23 % [jbd2/sda1-8]
8699 be/4 syslog 0.00 B/s 15.15 K/s 0.00 % 0.00 % rsyslogd -c4
276 be/3 root 0.00 B/s 34.03 K/s 0.00 % 15.64 % [jbd2/sda1-8]
8699 be/4 syslog 0.00 B/s 22.68 K/s 0.00 % 0.00 % rsyslogd -c4
1243 be/4 postfix 0.00 B/s 0.00 B/s 0.00 % 0.00 % qmgr -l -t fifo -u
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
8817 be/4 root 0.00 B/s 121.07 K/s 0.00 % 0.00 % webmincron.pl
8817 be/4 root 0.00 B/s 3.79 K/s 0.00 % 0.00 % webmincron.pl
8817 be/4 root 0.00 B/s 53.04 K/s 0.00 % 0.00 % [miniserv.pl]
1889 be/4 root 0.00 B/s 3.80 K/s 0.00 % 0.00 % perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
Its all in KB, so not much writing. I would expect the write cache big enough to handle this. The thing is, I cant figure out how big the write cache is. I mean the one in Ubuntu (I assume there is one), not of the drive itself.
Can anyone help me with this?