How to check what are using the mounted disk when I want to eject itHow do you forcibly unmount a disk when you press the eject button on an optical drive?What are the pros and cons of each USB disk format?Mounted filesystems - what are these?How do I check where devices are mounted?How to check which disk is mounted where? How to mount all spare disks?Mounted disk confusion and how to restore orderRead/Write permission of 2nd hard drive

What does it mean when we say 'The difference between two quantities is of first order'?

What can I do at Hong Kong Airport for 13 hours?

What is the point of teaching Coding and robotics to kids as young as 6 years old?

Do the holes in Jacquard loom punched cards represent input data or program code?

Magento 2 - Get product image url in API

Do field enchantments stack?

Sending non-work emails to colleagues. Is it rude?

Quick test of quality of an econometrics textbook

Sold item on eBay, buyer wants it to be delivered to another country, and pay by bank transfer

default permissible datatype conversion matrix

GIMP using command line

Writing style in academic English

Is it possible to trap yourself in the Nether?

Cannot delete lines in QGIS

Anacruses, Bar Lines, and Line Breaks

Chess PhD topic in machine learning?

Color coding Alerts

Is it normal to not be able to work 8 hours a day?

How to elongate the content of table to be justified in the whole page in LaTeX?

Finding a solution to a linear program with a small number of zeros

Could a chess engine do retro analysis?

Remove lines with repeated first field/column from a large file: answers from previous posts don't work

What is the difference between "more" and "less" commands?

What is this book about Satan having to run the world



How to check what are using the mounted disk when I want to eject it


How do you forcibly unmount a disk when you press the eject button on an optical drive?What are the pros and cons of each USB disk format?Mounted filesystems - what are these?How do I check where devices are mounted?How to check which disk is mounted where? How to mount all spare disks?Mounted disk confusion and how to restore orderRead/Write permission of 2nd hard drive






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









5


















The disk is mounted by sudo mount /dev/sdd5 /media/SDD/Docs and sudo mount /dev/sdd6 /media/SDD/Images and so on, thus there are some directories corresponding to the volumes of the mounted disk.



And when I wanted to eject the disk, i.e. using sudo umount /media/SDD/* to unmount the disk, there is an alert message saying




Failed to eject medium; one or more volumes on the medium are busy.




I've tried the command sudo lsof | grep "/media/SDD" to check the status of the mounted disk, but no information is shown.



Are there any commands to show what application are using the mounted disk? I want to check this to protect the files from disasters. Thank you!



UPDATE:



$ fuser -mv /media/SDD/
USER PID ACCESS COMMAND
/media/SDD: root kernel mount /
ubuntu 2831 Frce. Xvnc4
ubuntu 2839 Frce. vncconfig
ubuntu 2841 Frce. gnome-session
ubuntu 2844 .rce. dbus-launch
ubuntu 2849 .rce. dbus-launch
ubuntu 2850 .rce. dbus-daemon
ubuntu 2851 .rce. dbus-daemon
ubuntu 2858 .rce. gconfd-2
ubuntu 2872 Frce. gnome-settings-
ubuntu 2900 .rce. gvfsd
ubuntu 2907 Frce. gsd-printer
ubuntu 2911 Frce. metacity
ubuntu 2987 .rce. gconfd-2
ubuntu 2988 Frce. gnome-panel
ubuntu 2992 .rce. dconf-service
ubuntu 2997 Frce. gnome-fallback-
ubuntu 2998 Frce. notification-da
ubuntu 3003 Frce. bluetooth-apple
ubuntu 3004 Frce. nautilus
ubuntu 3014 .rce. gvfs-gdu-volume
ubuntu 3025 .rce. gvfs-gphoto2-vo
ubuntu 3027 .rce. gvfs-afc-volume
ubuntu 3035 frce. gvfsd-trash
ubuntu 3037 .rce. gvfsd-burn
ubuntu 3041 Frce. indicator-apple
ubuntu 3043 .rce. trashapplet
ubuntu 3053 Frce. gvfsd-metadata
ubuntu 3058 .rce. indicator-sessi
ubuntu 3060 .rce. indicator-appli
ubuntu 3062 .rce. indicator-messa
ubuntu 3064 .rce. indicator-sound
ubuntu 3099 Frce. pulseaudio
ubuntu 3251 .rce. gconf-helper
ubuntu 3262 Frce. gnome-screensav
ubuntu 3263 Frce. zeitgeist-datah
ubuntu 3271 Frce. zeitgeist-daemo
ubuntu 3277 Frce. zeitgeist-fts
ubuntu 3285 Frce. cat
ubuntu 3527 Frce. deja-dup-monito
ubuntu 5516 .rce. bash
ubuntu 6170 .r.e. bash
ubuntu 6488 .r.e. bash
ubuntu 8940 Frce. gnome-terminal
ubuntu 13309 Fr.e. MATLAB
ubuntu 13468 .r.e. matlab_helper
ubuntu 17913 .rce. ssh
ubuntu 19035 .r.e. bash
ubuntu 19615 fr.e. MATLAB
ubuntu 19621 fr.e. MATLAB
ubuntu 19623 fr.e. MATLAB
ubuntu 19625 fr.e. MATLAB
ubuntu 19627 fr.e. MATLAB
ubuntu 19629 fr.e. MATLAB
ubuntu 19632 fr.e. MATLAB
ubuntu 19634 fr.e. MATLAB
ubuntu 19813 .r.e. matlab_helper
ubuntu 19814 .r.e. matlab_helper
ubuntu 19819 .r.e. matlab_helper
ubuntu 19822 .r.e. matlab_helper
ubuntu 19824 .r.e. matlab_helper
ubuntu 19826 .r.e. matlab_helper
ubuntu 19827 .r.e. matlab_helper
ubuntu 19834 .r.e. matlab_helper
ubuntu 20716 .r.e. git
ubuntu 20717 .r.e. pager
ubuntu 20725 .rce. bash

$ fuser -mv /media/SDD/*
USER PID ACCESS COMMAND
/media/SDD/Data2010: root kernel mount /media/SDD/Data2010
/media/SDD/Data2012: root kernel mount /media/SDD/Data2012
/media/SDD/Docs: root kernel mount /media/SDD/Docs
/media/SDD/Doctor: root kernel mount /media/SDD/Doctor
/media/SDD/Files1: root kernel mount /media/SDD/Files1
/media/SDD/Files2: root kernel mount /media/SDD/Files2
/media/SDD/Papers: root kernel mount /media/SDD/Papers
/media/SDD/Temp: root kernel mount /media/SDD/Temp
/media/SDD/Videos: root kernel mount /media/SDD/Videos
/media/SDD/Work: root kernel mount /media/SDD/Work









share|improve this question

































    5


















    The disk is mounted by sudo mount /dev/sdd5 /media/SDD/Docs and sudo mount /dev/sdd6 /media/SDD/Images and so on, thus there are some directories corresponding to the volumes of the mounted disk.



    And when I wanted to eject the disk, i.e. using sudo umount /media/SDD/* to unmount the disk, there is an alert message saying




    Failed to eject medium; one or more volumes on the medium are busy.




    I've tried the command sudo lsof | grep "/media/SDD" to check the status of the mounted disk, but no information is shown.



    Are there any commands to show what application are using the mounted disk? I want to check this to protect the files from disasters. Thank you!



    UPDATE:



    $ fuser -mv /media/SDD/
    USER PID ACCESS COMMAND
    /media/SDD: root kernel mount /
    ubuntu 2831 Frce. Xvnc4
    ubuntu 2839 Frce. vncconfig
    ubuntu 2841 Frce. gnome-session
    ubuntu 2844 .rce. dbus-launch
    ubuntu 2849 .rce. dbus-launch
    ubuntu 2850 .rce. dbus-daemon
    ubuntu 2851 .rce. dbus-daemon
    ubuntu 2858 .rce. gconfd-2
    ubuntu 2872 Frce. gnome-settings-
    ubuntu 2900 .rce. gvfsd
    ubuntu 2907 Frce. gsd-printer
    ubuntu 2911 Frce. metacity
    ubuntu 2987 .rce. gconfd-2
    ubuntu 2988 Frce. gnome-panel
    ubuntu 2992 .rce. dconf-service
    ubuntu 2997 Frce. gnome-fallback-
    ubuntu 2998 Frce. notification-da
    ubuntu 3003 Frce. bluetooth-apple
    ubuntu 3004 Frce. nautilus
    ubuntu 3014 .rce. gvfs-gdu-volume
    ubuntu 3025 .rce. gvfs-gphoto2-vo
    ubuntu 3027 .rce. gvfs-afc-volume
    ubuntu 3035 frce. gvfsd-trash
    ubuntu 3037 .rce. gvfsd-burn
    ubuntu 3041 Frce. indicator-apple
    ubuntu 3043 .rce. trashapplet
    ubuntu 3053 Frce. gvfsd-metadata
    ubuntu 3058 .rce. indicator-sessi
    ubuntu 3060 .rce. indicator-appli
    ubuntu 3062 .rce. indicator-messa
    ubuntu 3064 .rce. indicator-sound
    ubuntu 3099 Frce. pulseaudio
    ubuntu 3251 .rce. gconf-helper
    ubuntu 3262 Frce. gnome-screensav
    ubuntu 3263 Frce. zeitgeist-datah
    ubuntu 3271 Frce. zeitgeist-daemo
    ubuntu 3277 Frce. zeitgeist-fts
    ubuntu 3285 Frce. cat
    ubuntu 3527 Frce. deja-dup-monito
    ubuntu 5516 .rce. bash
    ubuntu 6170 .r.e. bash
    ubuntu 6488 .r.e. bash
    ubuntu 8940 Frce. gnome-terminal
    ubuntu 13309 Fr.e. MATLAB
    ubuntu 13468 .r.e. matlab_helper
    ubuntu 17913 .rce. ssh
    ubuntu 19035 .r.e. bash
    ubuntu 19615 fr.e. MATLAB
    ubuntu 19621 fr.e. MATLAB
    ubuntu 19623 fr.e. MATLAB
    ubuntu 19625 fr.e. MATLAB
    ubuntu 19627 fr.e. MATLAB
    ubuntu 19629 fr.e. MATLAB
    ubuntu 19632 fr.e. MATLAB
    ubuntu 19634 fr.e. MATLAB
    ubuntu 19813 .r.e. matlab_helper
    ubuntu 19814 .r.e. matlab_helper
    ubuntu 19819 .r.e. matlab_helper
    ubuntu 19822 .r.e. matlab_helper
    ubuntu 19824 .r.e. matlab_helper
    ubuntu 19826 .r.e. matlab_helper
    ubuntu 19827 .r.e. matlab_helper
    ubuntu 19834 .r.e. matlab_helper
    ubuntu 20716 .r.e. git
    ubuntu 20717 .r.e. pager
    ubuntu 20725 .rce. bash

    $ fuser -mv /media/SDD/*
    USER PID ACCESS COMMAND
    /media/SDD/Data2010: root kernel mount /media/SDD/Data2010
    /media/SDD/Data2012: root kernel mount /media/SDD/Data2012
    /media/SDD/Docs: root kernel mount /media/SDD/Docs
    /media/SDD/Doctor: root kernel mount /media/SDD/Doctor
    /media/SDD/Files1: root kernel mount /media/SDD/Files1
    /media/SDD/Files2: root kernel mount /media/SDD/Files2
    /media/SDD/Papers: root kernel mount /media/SDD/Papers
    /media/SDD/Temp: root kernel mount /media/SDD/Temp
    /media/SDD/Videos: root kernel mount /media/SDD/Videos
    /media/SDD/Work: root kernel mount /media/SDD/Work









    share|improve this question





























      5













      5









      5


      1






      The disk is mounted by sudo mount /dev/sdd5 /media/SDD/Docs and sudo mount /dev/sdd6 /media/SDD/Images and so on, thus there are some directories corresponding to the volumes of the mounted disk.



      And when I wanted to eject the disk, i.e. using sudo umount /media/SDD/* to unmount the disk, there is an alert message saying




      Failed to eject medium; one or more volumes on the medium are busy.




      I've tried the command sudo lsof | grep "/media/SDD" to check the status of the mounted disk, but no information is shown.



      Are there any commands to show what application are using the mounted disk? I want to check this to protect the files from disasters. Thank you!



      UPDATE:



      $ fuser -mv /media/SDD/
      USER PID ACCESS COMMAND
      /media/SDD: root kernel mount /
      ubuntu 2831 Frce. Xvnc4
      ubuntu 2839 Frce. vncconfig
      ubuntu 2841 Frce. gnome-session
      ubuntu 2844 .rce. dbus-launch
      ubuntu 2849 .rce. dbus-launch
      ubuntu 2850 .rce. dbus-daemon
      ubuntu 2851 .rce. dbus-daemon
      ubuntu 2858 .rce. gconfd-2
      ubuntu 2872 Frce. gnome-settings-
      ubuntu 2900 .rce. gvfsd
      ubuntu 2907 Frce. gsd-printer
      ubuntu 2911 Frce. metacity
      ubuntu 2987 .rce. gconfd-2
      ubuntu 2988 Frce. gnome-panel
      ubuntu 2992 .rce. dconf-service
      ubuntu 2997 Frce. gnome-fallback-
      ubuntu 2998 Frce. notification-da
      ubuntu 3003 Frce. bluetooth-apple
      ubuntu 3004 Frce. nautilus
      ubuntu 3014 .rce. gvfs-gdu-volume
      ubuntu 3025 .rce. gvfs-gphoto2-vo
      ubuntu 3027 .rce. gvfs-afc-volume
      ubuntu 3035 frce. gvfsd-trash
      ubuntu 3037 .rce. gvfsd-burn
      ubuntu 3041 Frce. indicator-apple
      ubuntu 3043 .rce. trashapplet
      ubuntu 3053 Frce. gvfsd-metadata
      ubuntu 3058 .rce. indicator-sessi
      ubuntu 3060 .rce. indicator-appli
      ubuntu 3062 .rce. indicator-messa
      ubuntu 3064 .rce. indicator-sound
      ubuntu 3099 Frce. pulseaudio
      ubuntu 3251 .rce. gconf-helper
      ubuntu 3262 Frce. gnome-screensav
      ubuntu 3263 Frce. zeitgeist-datah
      ubuntu 3271 Frce. zeitgeist-daemo
      ubuntu 3277 Frce. zeitgeist-fts
      ubuntu 3285 Frce. cat
      ubuntu 3527 Frce. deja-dup-monito
      ubuntu 5516 .rce. bash
      ubuntu 6170 .r.e. bash
      ubuntu 6488 .r.e. bash
      ubuntu 8940 Frce. gnome-terminal
      ubuntu 13309 Fr.e. MATLAB
      ubuntu 13468 .r.e. matlab_helper
      ubuntu 17913 .rce. ssh
      ubuntu 19035 .r.e. bash
      ubuntu 19615 fr.e. MATLAB
      ubuntu 19621 fr.e. MATLAB
      ubuntu 19623 fr.e. MATLAB
      ubuntu 19625 fr.e. MATLAB
      ubuntu 19627 fr.e. MATLAB
      ubuntu 19629 fr.e. MATLAB
      ubuntu 19632 fr.e. MATLAB
      ubuntu 19634 fr.e. MATLAB
      ubuntu 19813 .r.e. matlab_helper
      ubuntu 19814 .r.e. matlab_helper
      ubuntu 19819 .r.e. matlab_helper
      ubuntu 19822 .r.e. matlab_helper
      ubuntu 19824 .r.e. matlab_helper
      ubuntu 19826 .r.e. matlab_helper
      ubuntu 19827 .r.e. matlab_helper
      ubuntu 19834 .r.e. matlab_helper
      ubuntu 20716 .r.e. git
      ubuntu 20717 .r.e. pager
      ubuntu 20725 .rce. bash

      $ fuser -mv /media/SDD/*
      USER PID ACCESS COMMAND
      /media/SDD/Data2010: root kernel mount /media/SDD/Data2010
      /media/SDD/Data2012: root kernel mount /media/SDD/Data2012
      /media/SDD/Docs: root kernel mount /media/SDD/Docs
      /media/SDD/Doctor: root kernel mount /media/SDD/Doctor
      /media/SDD/Files1: root kernel mount /media/SDD/Files1
      /media/SDD/Files2: root kernel mount /media/SDD/Files2
      /media/SDD/Papers: root kernel mount /media/SDD/Papers
      /media/SDD/Temp: root kernel mount /media/SDD/Temp
      /media/SDD/Videos: root kernel mount /media/SDD/Videos
      /media/SDD/Work: root kernel mount /media/SDD/Work









      share|improve this question
















      The disk is mounted by sudo mount /dev/sdd5 /media/SDD/Docs and sudo mount /dev/sdd6 /media/SDD/Images and so on, thus there are some directories corresponding to the volumes of the mounted disk.



      And when I wanted to eject the disk, i.e. using sudo umount /media/SDD/* to unmount the disk, there is an alert message saying




      Failed to eject medium; one or more volumes on the medium are busy.




      I've tried the command sudo lsof | grep "/media/SDD" to check the status of the mounted disk, but no information is shown.



      Are there any commands to show what application are using the mounted disk? I want to check this to protect the files from disasters. Thank you!



      UPDATE:



      $ fuser -mv /media/SDD/
      USER PID ACCESS COMMAND
      /media/SDD: root kernel mount /
      ubuntu 2831 Frce. Xvnc4
      ubuntu 2839 Frce. vncconfig
      ubuntu 2841 Frce. gnome-session
      ubuntu 2844 .rce. dbus-launch
      ubuntu 2849 .rce. dbus-launch
      ubuntu 2850 .rce. dbus-daemon
      ubuntu 2851 .rce. dbus-daemon
      ubuntu 2858 .rce. gconfd-2
      ubuntu 2872 Frce. gnome-settings-
      ubuntu 2900 .rce. gvfsd
      ubuntu 2907 Frce. gsd-printer
      ubuntu 2911 Frce. metacity
      ubuntu 2987 .rce. gconfd-2
      ubuntu 2988 Frce. gnome-panel
      ubuntu 2992 .rce. dconf-service
      ubuntu 2997 Frce. gnome-fallback-
      ubuntu 2998 Frce. notification-da
      ubuntu 3003 Frce. bluetooth-apple
      ubuntu 3004 Frce. nautilus
      ubuntu 3014 .rce. gvfs-gdu-volume
      ubuntu 3025 .rce. gvfs-gphoto2-vo
      ubuntu 3027 .rce. gvfs-afc-volume
      ubuntu 3035 frce. gvfsd-trash
      ubuntu 3037 .rce. gvfsd-burn
      ubuntu 3041 Frce. indicator-apple
      ubuntu 3043 .rce. trashapplet
      ubuntu 3053 Frce. gvfsd-metadata
      ubuntu 3058 .rce. indicator-sessi
      ubuntu 3060 .rce. indicator-appli
      ubuntu 3062 .rce. indicator-messa
      ubuntu 3064 .rce. indicator-sound
      ubuntu 3099 Frce. pulseaudio
      ubuntu 3251 .rce. gconf-helper
      ubuntu 3262 Frce. gnome-screensav
      ubuntu 3263 Frce. zeitgeist-datah
      ubuntu 3271 Frce. zeitgeist-daemo
      ubuntu 3277 Frce. zeitgeist-fts
      ubuntu 3285 Frce. cat
      ubuntu 3527 Frce. deja-dup-monito
      ubuntu 5516 .rce. bash
      ubuntu 6170 .r.e. bash
      ubuntu 6488 .r.e. bash
      ubuntu 8940 Frce. gnome-terminal
      ubuntu 13309 Fr.e. MATLAB
      ubuntu 13468 .r.e. matlab_helper
      ubuntu 17913 .rce. ssh
      ubuntu 19035 .r.e. bash
      ubuntu 19615 fr.e. MATLAB
      ubuntu 19621 fr.e. MATLAB
      ubuntu 19623 fr.e. MATLAB
      ubuntu 19625 fr.e. MATLAB
      ubuntu 19627 fr.e. MATLAB
      ubuntu 19629 fr.e. MATLAB
      ubuntu 19632 fr.e. MATLAB
      ubuntu 19634 fr.e. MATLAB
      ubuntu 19813 .r.e. matlab_helper
      ubuntu 19814 .r.e. matlab_helper
      ubuntu 19819 .r.e. matlab_helper
      ubuntu 19822 .r.e. matlab_helper
      ubuntu 19824 .r.e. matlab_helper
      ubuntu 19826 .r.e. matlab_helper
      ubuntu 19827 .r.e. matlab_helper
      ubuntu 19834 .r.e. matlab_helper
      ubuntu 20716 .r.e. git
      ubuntu 20717 .r.e. pager
      ubuntu 20725 .rce. bash

      $ fuser -mv /media/SDD/*
      USER PID ACCESS COMMAND
      /media/SDD/Data2010: root kernel mount /media/SDD/Data2010
      /media/SDD/Data2012: root kernel mount /media/SDD/Data2012
      /media/SDD/Docs: root kernel mount /media/SDD/Docs
      /media/SDD/Doctor: root kernel mount /media/SDD/Doctor
      /media/SDD/Files1: root kernel mount /media/SDD/Files1
      /media/SDD/Files2: root kernel mount /media/SDD/Files2
      /media/SDD/Papers: root kernel mount /media/SDD/Papers
      /media/SDD/Temp: root kernel mount /media/SDD/Temp
      /media/SDD/Videos: root kernel mount /media/SDD/Videos
      /media/SDD/Work: root kernel mount /media/SDD/Work






      mount hard-drive disk-usage disk-utility umount






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 20 at 12:07









      Byte Commander

      80.3k31 gold badges200 silver badges342 bronze badges




      80.3k31 gold badges200 silver badges342 bronze badges










      asked Jan 28 '15 at 1:39









      miningmining

      2071 gold badge3 silver badges9 bronze badges




      2071 gold badge3 silver badges9 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          10



















          The command you are looking for is fuser.



          It displays all processes accessing /media/SDD by typing sudo fuser -mv /media/SDD, where the m tells it to look on the given location, the v switches the output to a human readable list instead of just a bunch of PIDs.



          To automatically kill all processes (!! Use with care !!) accessing the directory, run sudo fuser -mvki /media/SDD. k means "kill" and i gives you a 2nd chance and lets you confirm each kill (which means you also can leave it and just type ...-mvk... to kill them without asking again).



          To do further research on the fuser command, please read its manual by typing man fuser or online at manpages.ubuntu.com.



          If I could help you and this answer is exactly what you were looking for, please don't be shy and click on the "accept" button next to the post. Otherwise feel free to ask me again. Thank you!






          share|improve this answer



























          • Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

            – mining
            Jan 28 '15 at 2:04











          • First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

            – Byte Commander
            Jan 28 '15 at 2:14











          • OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

            – mining
            Jan 28 '15 at 2:21











          • I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

            – Byte Commander
            Jan 28 '15 at 11:41











          • OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

            – mining
            Jan 28 '15 at 12:42












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f578628%2fhow-to-check-what-are-using-the-mounted-disk-when-i-want-to-eject-it%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          10



















          The command you are looking for is fuser.



          It displays all processes accessing /media/SDD by typing sudo fuser -mv /media/SDD, where the m tells it to look on the given location, the v switches the output to a human readable list instead of just a bunch of PIDs.



          To automatically kill all processes (!! Use with care !!) accessing the directory, run sudo fuser -mvki /media/SDD. k means "kill" and i gives you a 2nd chance and lets you confirm each kill (which means you also can leave it and just type ...-mvk... to kill them without asking again).



          To do further research on the fuser command, please read its manual by typing man fuser or online at manpages.ubuntu.com.



          If I could help you and this answer is exactly what you were looking for, please don't be shy and click on the "accept" button next to the post. Otherwise feel free to ask me again. Thank you!






          share|improve this answer



























          • Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

            – mining
            Jan 28 '15 at 2:04











          • First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

            – Byte Commander
            Jan 28 '15 at 2:14











          • OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

            – mining
            Jan 28 '15 at 2:21











          • I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

            – Byte Commander
            Jan 28 '15 at 11:41











          • OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

            – mining
            Jan 28 '15 at 12:42















          10



















          The command you are looking for is fuser.



          It displays all processes accessing /media/SDD by typing sudo fuser -mv /media/SDD, where the m tells it to look on the given location, the v switches the output to a human readable list instead of just a bunch of PIDs.



          To automatically kill all processes (!! Use with care !!) accessing the directory, run sudo fuser -mvki /media/SDD. k means "kill" and i gives you a 2nd chance and lets you confirm each kill (which means you also can leave it and just type ...-mvk... to kill them without asking again).



          To do further research on the fuser command, please read its manual by typing man fuser or online at manpages.ubuntu.com.



          If I could help you and this answer is exactly what you were looking for, please don't be shy and click on the "accept" button next to the post. Otherwise feel free to ask me again. Thank you!






          share|improve this answer



























          • Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

            – mining
            Jan 28 '15 at 2:04











          • First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

            – Byte Commander
            Jan 28 '15 at 2:14











          • OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

            – mining
            Jan 28 '15 at 2:21











          • I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

            – Byte Commander
            Jan 28 '15 at 11:41











          • OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

            – mining
            Jan 28 '15 at 12:42













          10















          10











          10









          The command you are looking for is fuser.



          It displays all processes accessing /media/SDD by typing sudo fuser -mv /media/SDD, where the m tells it to look on the given location, the v switches the output to a human readable list instead of just a bunch of PIDs.



          To automatically kill all processes (!! Use with care !!) accessing the directory, run sudo fuser -mvki /media/SDD. k means "kill" and i gives you a 2nd chance and lets you confirm each kill (which means you also can leave it and just type ...-mvk... to kill them without asking again).



          To do further research on the fuser command, please read its manual by typing man fuser or online at manpages.ubuntu.com.



          If I could help you and this answer is exactly what you were looking for, please don't be shy and click on the "accept" button next to the post. Otherwise feel free to ask me again. Thank you!






          share|improve this answer
















          The command you are looking for is fuser.



          It displays all processes accessing /media/SDD by typing sudo fuser -mv /media/SDD, where the m tells it to look on the given location, the v switches the output to a human readable list instead of just a bunch of PIDs.



          To automatically kill all processes (!! Use with care !!) accessing the directory, run sudo fuser -mvki /media/SDD. k means "kill" and i gives you a 2nd chance and lets you confirm each kill (which means you also can leave it and just type ...-mvk... to kill them without asking again).



          To do further research on the fuser command, please read its manual by typing man fuser or online at manpages.ubuntu.com.



          If I could help you and this answer is exactly what you were looking for, please don't be shy and click on the "accept" button next to the post. Otherwise feel free to ask me again. Thank you!







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited Jan 28 '15 at 2:18

























          answered Jan 28 '15 at 1:53









          Byte CommanderByte Commander

          80.3k31 gold badges200 silver badges342 bronze badges




          80.3k31 gold badges200 silver badges342 bronze badges















          • Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

            – mining
            Jan 28 '15 at 2:04











          • First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

            – Byte Commander
            Jan 28 '15 at 2:14











          • OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

            – mining
            Jan 28 '15 at 2:21











          • I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

            – Byte Commander
            Jan 28 '15 at 11:41











          • OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

            – mining
            Jan 28 '15 at 12:42

















          • Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

            – mining
            Jan 28 '15 at 2:04











          • First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

            – Byte Commander
            Jan 28 '15 at 2:14











          • OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

            – mining
            Jan 28 '15 at 2:21











          • I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

            – Byte Commander
            Jan 28 '15 at 11:41











          • OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

            – mining
            Jan 28 '15 at 12:42
















          Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

          – mining
          Jan 28 '15 at 2:04





          Thank you, sir! I've tried your answer with two commands fuser -mv /media/SDD and fuser -mv /media/SDD/*, but it seems to have different outputs. I've posted the outputs in the question above, but it seems to have no information about which process is using the disk. Please help check it.

          – mining
          Jan 28 '15 at 2:04













          First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

          – Byte Commander
          Jan 28 '15 at 2:14





          First, please don't call me sir. Second, the command without a start lists processes accessing all files inside the directory, the command with a star lists those accessing the subdirectories. Third, in the ACCESS column, the f or F means that the listed file is opened (F to write), e means it is a running executable, the rest should be less important. But you might have to use sudo to run it properly. I'll edit my answer.

          – Byte Commander
          Jan 28 '15 at 2:14













          OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

          – mining
          Jan 28 '15 at 2:21





          OK, thank you! In fact, I've tested with sudo, but it returns the same information. I checked the status of f or F or e, I don't find which process is visiting the files in the disk. But in fact I didn't open a file in the disk, why are there some processes want to visit the files? Is this a disallowed operation?

          – mining
          Jan 28 '15 at 2:21













          I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

          – Byte Commander
          Jan 28 '15 at 11:41





          I agree with you that some processes (e.g. matlab) should not necessarily have to access the directory, but it is normal. I don't know why each process opens some files, sorry.

          – Byte Commander
          Jan 28 '15 at 11:41













          OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

          – mining
          Jan 28 '15 at 12:42





          OK, thank you! Is it safe? The processes shouldn't visit those files. I didn't give the privileges to them, but I don't know how to control them when they were running in background.

          – mining
          Jan 28 '15 at 12:42


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f578628%2fhow-to-check-what-are-using-the-mounted-disk-when-i-want-to-eject-it%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

          How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

          Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü