问题标签 [mount]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
402 浏览

solaris - 在 Solaris 上挂载通知 - 作为普通用户(不是 root)

有没有人知道在 Solaris (10) 中获取文件系统挂载/卸载和/或新/删除设备通知的好(即有效)方法,而不需要 root?

我试图避免简单地轮询 /etc/mnttab 以获取新/删除/更改的条目,因此我的第一个原型涉及使用sysevent_subscribe_event侦听设备事件,然后将设备信息与 /etc/mnttab 结合使用来获取挂载点. 这很好用,但sysevent_subscribe_event需要 root 权限才能运行,而且我无法访问最终用户的盒子,所以我无法真正提升他们的权限。

我想这可能会很棘手,考虑到没有 root 运行的限制,但任何帮助都非常感激!

0 投票
4 回答
20479 浏览

linux - Bash 脚本 - 卸载设备,但如果没有安装就不会失败?

我正在编写一个 bash 脚本并且我已经errexit设置,所以如果任何命令没有返回 0 退出代码,即如果任何命令没有成功完成,脚本就会死掉。这是为了确保我的 bash 脚本是健壮的。

我必须挂载一些文件系统,复制一些文件,然后卸载它。我umount /mnt/temp在开头放了一个,这样它会在做任何事情之前卸载它。但是,如果未安装,则 umount 将失败并停止我的脚本。

有可能做一个umount --dont-fail-if-not-mounted /mnt/temp吗?如果设备未安装,它会返回 0 吗?喜欢rm -f

0 投票
6 回答
46914 浏览

linux - 如何在 Linux 上从包含多个分区的映像文件中挂载一个分区?

映像文件有一个分区表,它包含多个分区。

环回设备可能是一种可能性。

相关话题:

0 投票
1 回答
984 浏览

ruby - Ruby code on NFS mount, using another file on same mount causes problems

I'm working on an embedded system whoose details are explained at the end of this post. Tools are ruby on linux.

I put my ruby code on a remote NAS device on network and mount it to the embedded system I'm working on using NFS v3. My project scenario is like this: there is an all-in-one auto starter which 1.mounts the nfs share, 2. starts the webrick ruby code on mounted dir, 3. starts some other biz-logic related ruby code again on mounted dir, 4. starts a ruby code on local file system which does some basic logging and stuff... I put each step in a loop that will retry when a start operation fails (start operations are made by system 'ruby XXXX' or popen3 calls). Here's what happens when I run this starter: step1 goes ok, step 2 fails, step 3 fails, step 4 goes ok, then step2 and 3 are retried and both starts ok too allways at second trial(I want to add that started codes are independent so; it doesnt matter which one starts first and changing the start order didnt make any difference).

I have inspected this problem and found out it also happens when I start things manually from shell and filtered it down to this: My webrick code loads .rb files that are at the same directory as itself and has some FileHandlers using the subdirs in NFS mount and my biz-logic also loads .rb files from nfs mount. And this, I believe, is the source of my problem (I have tried to load those files using both absolute paths like '/mnt/myMount/myLib.rb' and File.Join which both didnt make any difference).

Also, the webrick filehandlers too act pretty strange in this scenario, they always fail at first request of a file and then succeeds at the second request, no matter the file size.

To sum up, as the title says, when a Ruby code on NFS mount uses another file on same mount, ruby gives an EIO (Input Output Error). I was able to reproduce this problem using simple .rb files (that just print itselves filename) loading each other as explained in the above scenario on my environment (though I havent tried this on a regular PC). How can I solve this, is it about the paths given to load/require methods or what?

My working envrionment: The device I'm working with is an intelligent RFID reader, with an embedded linux arm based computer on-board. The only api/language manufacturer allows and provides (w/o getting out of license terms) is ruby, and they give no-support for installing extra-stuff and they have customized the kernel in device to make installing/compiling anything as hard as possible. I can use extra ruby stuff if they're just .rb lib files that is I can easily just include them in my code, but anything that requires compiling is a no-no. Also, this system does not have gem.

0 投票
5 回答
32214 浏览

linux - 如何使用 mount(8) 和 fstab 注册 FUSE 文件系统类型?

我编写了一个基于 FUSE 的小型文件系统,现在唯一缺少的部分是我想用 fstab(5) 注册它,以便在系统启动时自动挂载它和/或手动挂载它mount /srv/virtual-db。我怎样才能做到这一点?

我知道,我可以/usr/bin/vdbfs.py /srv/virtual-db从一些初始化脚本运行,但这并不完全漂亮。

我很抱歉,因为这可能不完全是一个编程问题,但它是高度相关的,因为打包和部署仍然是程序员的工作。

0 投票
3 回答
11548 浏览

c - statvfs() 和 statfs() 系统调用的区别?

为什么statfs()andstatvfs()调用在它们如此相似时都存在?

在什么情况下我会更喜欢其中一种?

0 投票
6 回答
22144 浏览

android - 有没有办法挂载 Android .img 来访问 AVD(Android 虚拟设备)内容?

我觉得在 Android 模拟器上开发有点盲目,看不到 AVD (.img) 上的文件系统。

有没有办法在 Windows 或 Linux 中安装它,这样我至少可以看到文件列表和内容?

如果它也安装了写权限,则奖励。

谢谢你。

0 投票
2 回答
6734 浏览

macos - 插入 USB 设备时获取挂载点 Mac OS X 和 linux

我正在尝试在 Mac OS 和 Linux 中开发一个程序,该程序列出 USB 驱动器中的文件和文件夹。当 USB 设备连接和移除时,我需要获取一些事件。我知道在 Mac OS XI 中可以使用 IOKit。但是我不知道如何获取挂载设备的挂载点。我可以使用 IOkit 获得它吗?是否有适用于 Linux 和 Mac 的跨平台解决方案?

0 投票
2 回答
1759 浏览

linux - Linux 上的 getfsstat() 等价物是什么?

问题说明了一切。我想要 C 函数调用,它返回已安装文件系统的列表以及文件系统类型等相关信息。

0 投票
4 回答
14551 浏览

cocoa - 如何在 Mac OS cocoa 中获取已安装 USB 设备的设备 ID、供应商 ID 和产品 ID

我正在尝试编写一个 Cocoa 程序来检测连接到 Mac OS 的 iPod。我正在收听 NSWorkspaceDidMountNotification 和 NSWorkspaceDidUnmountNotification 以获取 USB 设备安装和卸载通知。我可以使用 NSString *path = [[notif userInfo] objectForKey:@"NSDevicePath"]; 获取已安装设备的设备路径 但我也不需要知道设备 ID、供应商 ID、产品 ID 等来检查安装的设备是否是 iPod。我认为前进的方向是 IOKit。但我有一种感觉,它适用于低级编程。有没有其他方法可以找到这些?另外,如果是 IO 套件,当我提供安装路径时,是否有任何示例程序会给出 ID?

非常感谢。