lsof or fuser to determine *write* processes? - Setup

This is a discussion on lsof or fuser to determine *write* processes? - Setup ; Dear experts---silly question. I want to remount my root partition as read-only. (I know the pitfalls.) Alas, on occasion, some process prevents me from doing this. I want to learn which one. I know that lsof and fuser can be ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: lsof or fuser to determine *write* processes?

  1. lsof or fuser to determine *write* processes?


    Dear experts---silly question. I want to remount my root partition as
    read-only. (I know the pitfalls.) Alas, on occasion, some process
    prevents me from doing this. I want to learn which one. I know that
    lsof and fuser can be used to determine processes that have open files
    on a partition---but I need only processes that have opened a file on
    my partition in write or modify mode. I can ignore read mode open
    files.

    could someone please tell me the magic flag combination?

    sincerely,

    /iaw

  2. Re: lsof or fuser to determine *write* processes?

    On Jun 15, 3:40*am, ivowel wrote:
    > Dear experts---silly question. *I want to remount my root partition as
    > read-only. *(I know the pitfalls.) *Alas, on occasion, some process
    > prevents me from doing this. *I want to learn which one. *I know that
    > lsof and fuser can be used to determine processes that have open files
    > on a partition---but I need only processes that have opened a file on
    > my partition in write or modify mode. *I can ignore read mode open
    > files.
    >
    > could someone please tell me the magic flag combination?
    >
    > sincerely,
    >
    > /iaw


    Why can't you use 'mount -o remount,ro /' ? What is the error message
    you are seeing?

    Also, I don't think you can ignore read-mode files quite that easily:
    a process can easily switch from read-mode to write-mode. although it
    does normally take a 'fopen' to do that (if you write in C, like me).

+ Reply to Thread