As the man page saied, we can use the -m option of fuser with a block device which has been mounted at some point. And fuser should report processes which visiting that filesystem. But now it feature looks like broken:
$ ./src/fuser -m /boot
<nothing>
$ ./src/fuser -m /dev/sda2
/dev/sda2: 1026 1038 3118 3132 3133 3156 3159 3167 3259 3264 3266 3286 3292m 3299 3309 3318 3354 3522 3534 3923 3926 3944 4739 6242 8853 11539 17165 17275 18572 18851 18873 20623 22671 23751 25485 28575 28602 32041 32711
$ df /dev/sda2
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 253431 151993 88638 64% /boot</nothing>
And the outputs of 'fuser -m /dev/sda2' is same to 'fuser -m /dev'.
Anonymous
Maybe this patch can fix this problem, I think.
diff --git a/src/fuser.c b/src/fuser.c
index e29a345..653d00e 100644
--- a/src/fuser.c
+++ b/src/fuser.c
@@ -449,14 +449,6 @@ int parse_file(struct names this_name, struct inode_list *ino_list, const char
free(this_name->filename);
this_name->filename = strdup(new);
}
-#ifdef _LISTS_H
- if (opts & OPT_MOUNTS) {
- this_name->st.st_dev = device(this_name->filename);
- this_name->st.st_ino = 0;
- add_inode(ino_list, this_name, this_name->st.st_dev, this_name->st.st_ino);
- return 0;
- }
-#endif
--
Just to be clear, I think your /boot output is correct and your /dev/sda2 output is incorrect. I get the same thing here and I'm pretty sure thers not 20 processes looking at files in /boot
Thanks for the info hanpt, I first looked at it and thought you cut out too much but I cannot find and test samples that break with that change, so it is in.
I get also this problem. When using -m option on a block device, fuser reports the processes that use /dev mount point instead of the processes that use the block device, as it worked in 21.5 release. Will it be fixed soon ?
Regards
Sorry about the previous comment, this is fixed in the 22.20 release.
This is broken again in 22.21 in opensuse 13.2 (released Nov 2014).
Can this bug be re-opened? Or do I need to file a new one?
Thanks, I can see boo#908068 ...
On Wed, Dec 03, 2014 at 08:43:10AM +0000, Dr. Werner Fink wrote:
I'm not seeing this in either Debian or the plain upstream versions
of fuser. Werner, would commit 3638cc5 be the reason why this is not
appearing anymore?
- Craig
Craig Small (@smallsees) http://enc.com.au/ csmall at : enc.com.au
Debian GNU/Linux http://www.debian.org/ csmall at : debian.org
GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5
On Wed, Dec 03, 2014 at 11:54:21AM +0000, Craig Small wrote:
Hmmm ... this one I'd already added. The only patch which I do not have
submitted is the attached one.
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr