📄 noflushd.8
字号:
.\" -*- nroff -*-.TH noflushd 8 "Version 2.7.4 - Aug 2004".SH NAMEnoflushd \- userland daemon to spin down idle disks..SH SYNOPSIS.B noflushd -[dhirtvV] [<optargs>] [<disk>] [ -t <optargs> ] [ <disks> ... ].SH DESCRIPTION.B noflushdmonitors disk activity and spins down <disk>s that have been idle for a certainamount of time. The <disk> argument has to be a device node to araw disk like, e. g. /dev/hda. It must not be a device node to a partitioninside the disk, e. g. /dev/hda1. Unless at least one <disk> argument isgiven, noflushd tries to monitor all disks on the system as listed in/proc/partitions using the default timeout list. Some of the optionstake additional arguments <optargs>. See below for a complete list..PP.B noflushdactually used to live in some versions of bdflush, but since kernel version2.2.11, bdflush had been completely replaced by the kernel-level kupdatedaemon, which was renamed into kupdated, and finally replaced again by thepdflush daemon in the Linux 2.5 kernel series..PP.SH "COMMAND\-LINE OPTIONS".TP 0.5i.B "-h "Print the usage message (help)..TP 0.5i.B "-v "Print information on monitored disks upon startup.Log information about events such as disk spinup to syslog.Combined with -d option, produce extra verbose debugging messages..TP 0.5i.B "-d "Don't detach daemon. Print additional debugging information..TP 0.5i.B "-V "Display version information..TP 0.5i.B "-r <disk>"Mark <disk> as read-only, meaning that noflushd will make no attempt tosync <disk> even if it's still spinning. Usually you'll need this option forCD-ROMs or other read-only media that are reported in /proc/partitions.(noflushd detects IDE CD-ROMs itself. SCSI CD-ROMs aren't listed in/proc/partitions so just assume you don't need this option for a start.).TP 0.5i.B "-n <timeout-list>"Set default timeouts. Can be overridden for a single disk using the.B "-t "option. See below for how to specify the timeout values..TP 0.5i.B "-t <timeout-list>"Send disk to sleep after timeout minutes have passedwithout read activity. Unlike.BR "-n" ,this option only applies to the next <disk> argument following on thecommand-line. See below for how to specify the timeout values..TP 0.5i.B "<timeout-list>"A <timeout-list> comprises of one or more comma-separated integer valuesindicating a timeout value in minutes. Usually you'll only supply a singlevalue and ignore the rest of this section. Read on however if you want to pass several configurations to noflushd. Upon startup, noflushd uses thefirst timeout value of each list. When a.I SIGHUPsignal is sent to noflushd, it switches to the next set of timeout values inthe list, or jumps back to the first, if the end of the list was reached.This is different from restarting the daemon with a new set of parametersbecause the idle times for each disk are preserved. You can make use of twospecial timeout values with the.B "-t "option. -1 or the keyword "default" uses the current default timeout. 0 orthe keyword "skip" advises noflushd to skip monitoring the particular diskin this set of parameters. Different timeout-lists may have different numbersof entries, but this is probably not very useful at all. Nevertheless it isconsidered a feature, not a bug. It is considered a bug however that thisdescription is far too confusing..TP 0.5i.B "-i <irq list>"Monitor interrupts for interactivity. If one or more interrupts are raisedwithin the .I defaulttimeout, disks won't get spun down. Interrupts are givenas a comma-separated list of either numbers or names as in.IR /proc/interrupts.You can use this option to prevent spindown when the machine is in interactiveuse. Keyboard, and mouse interrupts are good candidates to monitor in thiscase..TP 0.5i.B "-yes-scsi-idle-patch-is-in-kernel"Enable support for SCSI disks. The name of this option is gross for a reason:Unless your running kernel has the scsi-idle patch applied, once spun down,SCSI disks will not spin up again, no matter if noflushd is running or not.(You might still be able to trigger a manual spinup, but by Murphy's Law theprogram to do so resides on the spun-down disk.) Furthermore, the scsi-idlepatch is rumored to be buggy on multi-processor systems. Some people haveeven blamed scsi-idle as the cause of occasional data loss on their disks.In other words, by enabling this option, you assert that you know what you'redoing, and that you won't get at me if it turns out that in fact you didn't.More information on SCSI support and the scsi-idle patch is provided in thenoflushd README, and in the contrib directory of the noflushd sourcedistribution..SH EXAMPLES.TP 0.5i.B 'noflushd -n 60 /dev/hda'This is the recommended commandline for the most common laptop setup: one IDEhard disk, optionally one IDE CD-ROM. The CD-ROM is auto-detected as aread-only drive. Usually CD-ROM drives spin down themselves, so they shouldnot be given on the commandline for noflushd to monitor..TP 0.5i.B 'noflushd -r /dev/sdb -n 60,5 /dev/hda -t 15,default /dev/hdc'Here noflushd is told about a read-only device at /dev/sdb (e.g. amagneto-optical drive mounted read-only). noflushd needs this information todecide what disks to sync and when to start/stop kupdated/pdflush. Next, twosets of timeout values are defined: First a 1 hour timeout for the first harddisk, and a 15 minute timeout for the second hard disk. Then a 5 minutetimeout for both the first and the second hard disk. Sending SIGHUP tonoflushd will toggle between both parameter sets..TP 0.5i.B 'noflushd -i keyboard,"PS/2 Mouse" -n 5 -t 60 /dev/hda'Spin down the first IDE disk after one hour, but only if the machine hasn'tbeen used interactively in the past five minutes..SH LIMITATIONSWhen running a devfs-enabled kernel, noflushd won't work unless devfs ismounted. Devfs need not be used, or mounted on /dev, but it needs to bemounted somewhere. That's because the kernel exposes different device names in/proc/partitions, depending whether devfs is compiled in or not..PPKernels prior to version 2.3.99pre8 will only provide disk statistics for thefirst and second IDE controller. Thus noflushd can't support any more.Improvements in later kernels curiously enough led to also the second IDEcontroller not being supported anymore by default. It's a kernel limitation,not a noflushd bug. If noflushd refuses to work with your UDMA-100 IDE disks,this is most likely the cause. Check noflushd's README in the doc section forinformation on how to change this..PPAs if this hadn't been enough, 2.4.0-test9 changed the /proc/stat layout onceagain. Current versions of noflushd only support the new format, meaningthat noflushd won't run on kernels 2.3.99pre8 to 2.4.0-test8. Please considerupgrading..SH BUGSHeavy swap activity and spun down disks upon APM suspend sometimes leavesyslogd stuck in 'D' state after resuming. This is probably not a noflushd bugbut a kernel bug that can be triggered with the help of noflushd. The bestknown workaround is to put a line.I "sync && sync && sync "in apmd's suspend script..PPRemounting a partition from read-only to read-write while noflushd's internalsyncer is active will go unnoticed, i.e. no sync will occur. (This should beextremely rare - it requires that not only were e.g. /dev/hda{1,2...} allread-only before, but also the full disk device /dev/hda. A filesystem onan unpartitioned disk is probably the only real-world case where this bugmight trigger.).PPJournaling filesystems like ext3, or reiserfs bypass the kernel's delayedwrite mechanisms and write straight to disk. Therefore noflushd is unable topostpone writing of journaling data. As a result, expect lousy spindownbehaviour when working off ext3/reiserfs/... partitions..PPHandling of hotplugged drives is well below the optimum, especially whenremovable drives like card readers are plugged in. Until noflushd becomesmore clever about them, it is recommended to intelligently restart itfrom the hotplug daemon (e.g. hotplug or usbmgr) as soon as a new driveis added or removed. Option -r might come in handy for the hotpluggeddisk..PPSome of the early 2.4 kernels apparently do not properly reap noflushd'sstarting process after it has forked off the daemon: The entries in/proc/<pid>/ are still around, but the pid doesn't show up anymore in thedirectory contents of /proc/. Which means chkrootkit reports noflushd as ahidden process. This bug is just so weird. To daemonize itself, noflushduses a standard libc call, and there are no tricks in the source that shouldbe able to confuse the kernel. Current kernels for all I know don't exhibitthis behaviour anymore. Still why exactly noflushd triggered this bug remainsa mystery..PP.SH AUTHOR.B noflushdwas written by Daniel Kobras <kobras@linux.de>, based onbdflush's sleep support..B bdflushwas written as a quick hack by Eric Youngdale <ericy@gnu.ai.mit.edu> withvarious other hacks by Phil Bostley <bostley@cs.colorado.edu> andDaniel Quinlan <quinlan@yggdrasil.com>. Sleep support was added to bdflushby Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -