Take the 2-minute tour ×

I am familiar with output suppress on Unix machines, ie:

cat /file/that/doesnt/exist > /dev/null 2>&

However I can't seem to suppress the output of mount when an ext3 filesystem is mounted for the nth time, and it recommends an fsck. As it happens, fscks are run regularly by another machine, so these warning messages are needlessly interrupting the flow of output to my pretty bash script. These are the errors:

# mount -t ext3 /dev/sda1 /mnt > /dev/null 2>&
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.

Can anyone shed some light on this? I'm clearly blocking both fd's, but somehow output is still getting through.

This is GNU Bash v2.05a

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I'm pretty sure that those messages are coming from the kernel, not the mount command itself, so redirectinging the outputs aren't going to help. Try tweaking kernel.printk in sysctl until you get a level of verbosity that you're happy with.

When you say fscks are regularly run by another machine, i'm guessing this is on a shared block storage device like DRBD? I'd check that your other machine is actually fscking those volumes as the mount count is stored in the filesystem metadata, not the machine itself.

share|improve this answer
Ah, that explains it. It's just a USB storage device, and I hadn't actually run a fsck on it yet since I was testing the script. Thanks! –  tjbp Jun 8 '10 at 12:40
echo "4 1 1 7" > /proc/sys/kernel/printk should turn it off but remember this is system wide, but be warned there might be other kernel messages that you do want to know about and that is suppressing them. –  davey Jun 8 '10 at 12:42

Your Answer


