WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What process makes /dev/sda1 busy?  (Read 16149 times)

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
What process makes /dev/sda1 busy?
« on: September 23, 2012, 12:25:15 PM »
Hello:
I am just wondering, how to unmount /dev/sda1; the partition with the "tce/" folder.
How to find out, what process makes /dev/sda1 busy?
Thank you.
This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: What process makes /dev/sda1 busy?
« Reply #1 on: September 23, 2012, 01:11:21 PM »
Not a process likely, but mounted extensions. If you need to umount that partition, you can load all extensions to ram with the copy2fs options.
The only barriers that can stop you are the ones you create yourself.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: What process makes /dev/sda1 busy?
« Reply #2 on: September 23, 2012, 01:32:30 PM »
Or you are making it busy yourself, e.g. your are using in the shell, etc.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: What process makes /dev/sda1 busy?
« Reply #3 on: September 23, 2012, 01:40:30 PM »
Hi rms46
While your problem is probably, as curaga pointed out, mounted extensions, you will get that message anytime
you try to unmount a drive that is in use. Things that constitute in use include:
1. Editing a file on that drive.
2. Looking at a directory on that drive with a file manager.
3. Open a terminal and  cd  to a directory on that drive.
4. Another machine connected to a shared directory on that drive might also cause that message.

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Re: What process makes /dev/sda1 busy?
« Reply #4 on: September 24, 2012, 11:47:34 PM »
Thank you very much for the clues!
I forgot that all those loop devices are accessing the mounted /dev/sda1 partition!
Again, thanks to all of you!
 
This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: What process makes /dev/sda1 busy?
« Reply #5 on: September 25, 2012, 02:31:44 AM »
"losetup" will show such ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Akane

  • Jr. Member
  • **
  • Posts: 71
    • My home server by RaspberryPi
Re: What process makes /dev/sda1 busy?
« Reply #6 on: October 07, 2012, 10:26:25 PM »
Try
Code: [Select]
# fuser -m /mnt/sda1
to display the processes that using the resources.
Sorry for my terrible English.
Country: Japan
Interested in: HPC, low-level programming, embedded system and so on

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Re: What process makes /dev/sda1 busy?
« Reply #7 on: October 10, 2012, 11:18:35 AM »
Try
Code: [Select]
# fuser -m /mnt/sda1to display the processes that using the resources.

Unfortunately, it does not work :(
Code: [Select]
tc@box:~$ fuser -m /mnt/sda1
tc@box:~$ sudo umount /dev/sda1
umount: can't umount /mnt/sda1: Device or resource busy
tc@box:~$
This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: What process makes /dev/sda1 busy?
« Reply #8 on: October 10, 2012, 01:44:38 PM »
Unfortunately for this case, the fuser applet of busybox is a bit limited in fuctionality.
Using the "-v" option of fuser from PSmisc might often instantly diagnose such issues.

Rather surprisingly, while there are a lot of busybox replacements I couldn't imagine of being very useful in repo, PSmisc does not appear to be there...
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Akane

  • Jr. Member
  • **
  • Posts: 71
    • My home server by RaspberryPi
Re: What process makes /dev/sda1 busy?
« Reply #9 on: October 11, 2012, 03:49:48 AM »
Hello, rms46.

Please run the comand as root.
(I wrote "#" as the prompt, not "$" :) )

Akane
Sorry for my terrible English.
Country: Japan
Interested in: HPC, low-level programming, embedded system and so on

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Re: What process makes /dev/sda1 busy?
« Reply #10 on: October 11, 2012, 04:10:44 AM »
OK:
Code: [Select]
$ ssh -X -p 2222 tc@localhost
tc@localhost's password:
Last login: Thu Oct 11 14:57:34 2012 from 10.0.2.2
--------------------------------------------------------
PROXY OFF 11-Oct-2012
tc@box:~$ sudo su
root@box:~# fuser -m /mnt/sda1
root@box:~# umount /dev/sda1
umount: can't umount /mnt/sda1: Device or resource busy
root@box:~#
This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline Akane

  • Jr. Member
  • **
  • Posts: 71
    • My home server by RaspberryPi
Re: What process makes /dev/sda1 busy?
« Reply #11 on: October 11, 2012, 04:23:20 AM »
OK. I see. Thank you for running.

Well, run this(as root):
Code: [Select]
# fuser -mk /mnt/sda1

If you run above step and can't umount,
please try:
Code: [Select]
# fuser -mk /mnt/sda1 -KILL

Thank you.
Sorry for my terrible English.
Country: Japan
Interested in: HPC, low-level programming, embedded system and so on

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: What process makes /dev/sda1 busy?
« Reply #12 on: October 11, 2012, 11:50:49 AM »
"-KILL" is implied already by default.

Does
"losetup |grep sda1"
produce any output?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)