Can't unmount drive without killing bash [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1
















This question already has an answer here:



  • Busy Device on Umount

    6 answers



  • umount /home does not work

    7 answers



  • Mounting and unmounting in same shell script results in error

    2 answers



I don't know whether its normal or not but when I mount a filesystem(ext4 partition, USB, SD card etc) via command line, I can't unmount it because it says
target is busy



It is the bash process which is using/accessing it.
So I have to kill it first and then only can unmount the drive. As you have guessed, when I kill the bash process the terminal shuts down.and I have to reopen the terminal and unmount the drive.
Is it normal ? I don't remember it happening the last time I unmounted something.










share|improve this question













marked as duplicate by Kusalananda bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Feb 16 at 17:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:24











  • I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

    – Just Khaithang
    Feb 16 at 17:27












  • Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:31











  • thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

    – Just Khaithang
    Feb 16 at 17:36







  • 1





    Alright, I'll make it a proper answer then

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:38















1
















This question already has an answer here:



  • Busy Device on Umount

    6 answers



  • umount /home does not work

    7 answers



  • Mounting and unmounting in same shell script results in error

    2 answers



I don't know whether its normal or not but when I mount a filesystem(ext4 partition, USB, SD card etc) via command line, I can't unmount it because it says
target is busy



It is the bash process which is using/accessing it.
So I have to kill it first and then only can unmount the drive. As you have guessed, when I kill the bash process the terminal shuts down.and I have to reopen the terminal and unmount the drive.
Is it normal ? I don't remember it happening the last time I unmounted something.










share|improve this question













marked as duplicate by Kusalananda bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Feb 16 at 17:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:24











  • I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

    – Just Khaithang
    Feb 16 at 17:27












  • Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:31











  • thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

    – Just Khaithang
    Feb 16 at 17:36







  • 1





    Alright, I'll make it a proper answer then

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:38













1












1








1









This question already has an answer here:



  • Busy Device on Umount

    6 answers



  • umount /home does not work

    7 answers



  • Mounting and unmounting in same shell script results in error

    2 answers



I don't know whether its normal or not but when I mount a filesystem(ext4 partition, USB, SD card etc) via command line, I can't unmount it because it says
target is busy



It is the bash process which is using/accessing it.
So I have to kill it first and then only can unmount the drive. As you have guessed, when I kill the bash process the terminal shuts down.and I have to reopen the terminal and unmount the drive.
Is it normal ? I don't remember it happening the last time I unmounted something.










share|improve this question















This question already has an answer here:



  • Busy Device on Umount

    6 answers



  • umount /home does not work

    7 answers



  • Mounting and unmounting in same shell script results in error

    2 answers



I don't know whether its normal or not but when I mount a filesystem(ext4 partition, USB, SD card etc) via command line, I can't unmount it because it says
target is busy



It is the bash process which is using/accessing it.
So I have to kill it first and then only can unmount the drive. As you have guessed, when I kill the bash process the terminal shuts down.and I have to reopen the terminal and unmount the drive.
Is it normal ? I don't remember it happening the last time I unmounted something.





This question already has an answer here:



  • Busy Device on Umount

    6 answers



  • umount /home does not work

    7 answers



  • Mounting and unmounting in same shell script results in error

    2 answers







bash usb-drive unmounting






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 16 at 17:20









Just KhaithangJust Khaithang

62




62




marked as duplicate by Kusalananda bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Feb 16 at 17:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Kusalananda bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Feb 16 at 17:42


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1





    If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:24











  • I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

    – Just Khaithang
    Feb 16 at 17:27












  • Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:31











  • thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

    – Just Khaithang
    Feb 16 at 17:36







  • 1





    Alright, I'll make it a proper answer then

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:38












  • 1





    If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:24











  • I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

    – Just Khaithang
    Feb 16 at 17:27












  • Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:31











  • thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

    – Just Khaithang
    Feb 16 at 17:36







  • 1





    Alright, I'll make it a proper answer then

    – Sergiy Kolodyazhnyy
    Feb 16 at 17:38







1




1





If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

– Sergiy Kolodyazhnyy
Feb 16 at 17:24





If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount, or use sudo fuser /mount/point to figure out what else is using the process

– Sergiy Kolodyazhnyy
Feb 16 at 17:24













I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

– Just Khaithang
Feb 16 at 17:27






I am using fuser to detect the PID and than look it up in TOP (let me know if there's is any short cut rather than running top to identify the process). Let me just try mount and unmount in quick succession without touching anything else. BRB

– Just Khaithang
Feb 16 at 17:27














Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

– Sergiy Kolodyazhnyy
Feb 16 at 17:31





Well, not sure if it's shortcuts but I'd use ps -p 1234 -o args where 1234 is pid, or just examine /proc/1234/cmdline

– Sergiy Kolodyazhnyy
Feb 16 at 17:31













thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

– Just Khaithang
Feb 16 at 17:36






thanks for the short cut and yap you are right, it most probably was me cding into the mounted drive and could recollect a thing what I was doing. whew that's was quick.

– Just Khaithang
Feb 16 at 17:36





1




1





Alright, I'll make it a proper answer then

– Sergiy Kolodyazhnyy
Feb 16 at 17:38





Alright, I'll make it a proper answer then

– Sergiy Kolodyazhnyy
Feb 16 at 17:38










1 Answer
1






active

oldest

votes


















1














If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount. Otherwise use sudo fuser /mount/point to figure out what else is using the mountpoint or files within it.



source: doing exactly the same mistake and learning from it






share|improve this answer































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount. Otherwise use sudo fuser /mount/point to figure out what else is using the mountpoint or files within it.



    source: doing exactly the same mistake and learning from it






    share|improve this answer





























      1














      If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount. Otherwise use sudo fuser /mount/point to figure out what else is using the mountpoint or files within it.



      source: doing exactly the same mistake and learning from it






      share|improve this answer



























        1












        1








        1







        If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount. Otherwise use sudo fuser /mount/point to figure out what else is using the mountpoint or files within it.



        source: doing exactly the same mistake and learning from it






        share|improve this answer















        If you cd into the mountpoint, it will be openend by bash so of course it will be busy. cd $HOME and then try to unmount. Otherwise use sudo fuser /mount/point to figure out what else is using the mountpoint or files within it.



        source: doing exactly the same mistake and learning from it







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 16 at 17:43









        Jesse_b

        13.3k23370




        13.3k23370










        answered Feb 16 at 17:40









        Sergiy KolodyazhnyySergiy Kolodyazhnyy

        10.5k42663




        10.5k42663












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?