User Tools

Site Tools


spindown

Parsing mount points

When dealing with disk spindown, it can be important to parse the list of mount points, in order to alter mount options such as commit=, etc. For this, it is important to take into accounts the differences between /etc/mtab and /proc/mounts, when the former is not a symlink to the latter.

Here's an example /etc/mtab rootfs entry:

rootfs / rootfs rw,noatime,relatime,errors=continue,barrier=0,commit=7200 0 0

And here's its counterpart in /proc/mounts:

/dev/root / ext3 rw,noatime,errors=continue,commit=7200,barrier=0,data=ordered 0 0

In one case, the device is “rootfs”, in the other, it's “/dev/root”

So we can have a “real” device, or a “fake” device. To apply a remount command, we'll want the real one, so /proc/mounts shall be preferred.

spindown.txt · Last modified: 2011/05/30 14:07 by 84.14.5.202