`

device is busy时怎么办?

 
阅读更多
执行mount -o loop ramdisk.image mnt_ramdisk/,将当前目录下的ramdisk映像挂载到mnt_ramdisk目录下,使用完后退出此目录,执行umount mnt_ramdisk/,可总是说device is busy,可我又不知道什么程序在使用,用google搜了一下,找到了网上高人解决此问题的方法.以下转载于品可的blog:

================

linux下的磁盘分区通过挂载(mount)的方式连到一个目录下,打开此目录就可以看到磁盘分区中的内容了。与挂载相反的操作是umount,他将磁盘分区与目录的关联关系解除。

但有时候umount时会报错误,例如
Code:

# umount /usr/local/
umount: /usr/local: device is busy

这说明还有某个程序正在是用此目录,为了保证程序的运行,默认情况下umount不能卸载。但是umount又没有说究竟哪个程序在使用,觉得这也算是设计的一个缺陷。

幸好有个程序叫fuser,man fuser的介绍是:
Code:

fuser - identify processes using files or sockets

fuser后加需要查的资源就可以知道有哪些进程正在使用了,例如:
Code:

#fuser -m /
/:                    8892r  8916r  8932r  8959r  8992rc  8996rc  8997rc  8999rc  9006rc
   9007rc  9010rc  9013r  9015rc  9025r  9029r  9033rc  9035r  9039rc  9058rc  9107rc 
   9109rc  9126rc  9130r  9366r  9375r  9439r

接下来需要做的就是将相关进程停掉,再umount即可。

PS: 多谢pnt的提醒,原来umount 还有一个-l选项,作用是当需卸载文件系统的引用不繁忙时直接卸载:
Code:

umount -l    Lazy unmount. Detach the filesystem from the filesystem  hierar-
chy now, and cleanup all references to the filesystem as soon as
it is not busy anymore.  (Requires kernel 2.4.11 or later.)
分享到:
评论

相关推荐

    由串口助手引起的ESP8266出现busy s…问题解决

    因为直接使用的串口助手,8266也设置的回传模式,所以这里可以看到相应的返回,出现了busy s... 那么这个busy对我们的实际操作有没有影响呢,结合我们浏览器显示的内容: 和实际发送的报文: HTTP/1.1 200 OK ...

    drvice_busy错误处理

    当Linux系统报告“Device is busy”错误时,意味着当前有某个进程正在使用该设备,或者设备上的文件被打开着。这种情况可能导致无法安全地卸载设备,从而引发数据丢失的风险。因此,正确识别并处理这些占用设备的...

    esp32c3-20220618-v1.19.1.bin

    esp32c3-固件,micropython系统,不带USB的版本

    ESP32烧写固件软件_esp32烧写_esp32能刷哪些_esp32cam烧写_esp32固件地址_Esp32下载固件_

    在烧写固件时,需要注意以下几点: - 确保ESP32开发板已进入Bootloader模式,通常是通过短接特定引脚或按住Boot按钮进行。 - 固件烧写过程中不要断开USB连接,以免数据传输中断导致烧写失败。 - 烧写前备份当前固件...

    Xcode13.0真机调试包

    Xcode 12.3真机调试包,操作如下: 前往--应用程序/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport文件夹,拖到文件目录下之后重启 Xcode 即可

    The.Busy.Coders.Guide.to.Android.Development.Version.8.3.epub

    Android, the next-generation open mobile platform from Google and the Open Handset Alliance, is poised to become a significant player in the mobile device market. The Android platform gives developers...

    CommonsWare.The.Busy.Coders.Guide.to.Android.Development.Version.8.2.2017

    Android, the next-generation open mobile platform from Google and the Open Handset Alliance, is poised to become a significant player in the mobile device market. The Android platform gives developers...

    Linux使用fuser命令找出访问文件系统的进程

     umount: /mnt: device is busy  umount: /mnt: device is busy  2).找出依然在访问该文件系统的进程号:  [root@vserver01 ~]# fuser -c /mnt  /mnt: 2563c  [root@vserver01 ~]# ps -ef | grep

    ESP32-MicroPython固件

    《如何解决Tonny软件“Device is busy or does not respond ”报错和MicroPython设备文件为空的问题(图文教程)》操作文档中所需的文件。

    BUS Hound

    The first detected device on the system is Device ID 0, the second is Device ID 1, and so on. This field is useful in the event multiple devices are being captured in parallel. <br>For USB devices...

    The Busy Coder's Guide to Android Development 8.10

    For those of you who have read previous editions of this book, here are some of the highlights of what is new in the prose in Version 8.10. This update: • Adds a new chapter on authenticating the ...

    Linux下挂载U盘命令.pdf

    Linux 下挂载 U 盘命令详解 Linux 作为一个开源的操作系统,在日常使用中,我们经常需要挂载 U 盘来存储...同时,我们也需要注意卸载 U 盘时可能出现的 "device is busy" 错误,可以使用强制卸载命令来解决这个问题。

    c语言 modbus库文件

    这在实现如PLC(可编程逻辑控制器)或SCADA(监控与数据采集系统)等设备时特别有用。客户端例程则用于设备作为Modbus客户端,发起对服务器的读写请求,获取或设置远程设备的状态。 在实际应用中,开发者可以利用...

    无法卸载模块的解决办法.pdf

    用rmmod卸载模块的时候会弹出错误,如下 – rmmod: can't change directory to '/lib/modules': No such file or directory

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    The RS232 can operate at 9600 or 19,200 baud, while the USB appears as a virtual COMx device. While it appears to be present at either 9600 baud or 115.2 kbaud , the actual data transmission occurs ...

    linux下挂载windows分区.pdf

    有时候卸载分区时提示分区繁忙(device is busy),可以先用以下命令看看哪个进程在使用此分区: `fuser -cu /dev/hda1` 然后可以用以下命令结束此进程: `kill -9 8463` 自动挂载 Windows 分区可以把上述命令...

    Moving to Responsive Web Design(Apress,2016)

    Moving to Responsive Web Design is for busy designers, and developers who want to convert an existing site to responsive design and don’t have all the time in the world. It’s for teams who know that...

    Linux虚拟机中挂载U盘的操作流程.docx

    * 如果显示 device is busy,可以使用命令 `fuser -km /mnt/udisk` 卸载 U 盘。 五、其他相关知识点 * 使用命令 `ls -l /mnt/udisk` 查看 U 盘中的文件信息。 * 使用命令 `rpm -qa|grep kernel` 查询 Linux 系统的...

    linux挂载与卸载基本操作[定义].pdf

    例如,在尝试卸载/sd03时,如果出现"device is busy"的错误,表示有程序正在使用这个挂载点。 在这种情况下,可以使用`fuser`命令找出占用该挂载点的进程。`fuser -m 目录`会列出所有使用该目录的进程ID,随后可以...

Global site tag (gtag.js) - Google Analytics