mount

Allow Apache/PHP a read/write access to a mounted directory

不羁岁月 提交于 2019-11-30 23:29:29
We have websites running on a linux server with apache httpd and php. On that server a certain directory from a windows server is mounted as let's say /mnt/some_directory/ . I can browse this directory with both WinSCP or SSH, using my own user account. I can also perform the following in SSH: php -r "print_r(file_get_contents('/mnt/some_directory/file_name.txt'));" and see contents of that file. We need to read a file and parse from that directory in order to import it in the database that is used by the website. But when an fopen or a file_get_contents on the website we get a permission

解决arch下挂载ntfs格式硬盘

为君一笑 提交于 2019-11-30 20:20:00
arch下挂载ntfs格式的硬盘有两个问题,一个是必须以root权限挂载,另一个问题是,挂载后,即使以root身份,也只能读不能写。 解决方法是安装两个东西: sudo pacman -S pmount ntfs-3g pmount使我们能用普通用户身份挂载硬盘分区,ntfs-3g的作用是提供arch对ntfs文件系统的读写支持。 安装完之后,只需如下命令即可挂载ntfs格式的硬盘分区 pmount /dev/<your-NTFS-partition> /media/<folder> 如果你喜欢自动挂载,请参考 wiki 来源: oschina 链接: https://my.oschina.net/u/145966/blog/70478

ubuntu下访问windows共享文件夹

梦想的初衷 提交于 2019-11-30 20:13:59
ubuntu下访问windows共享文件夹 今天碰到一个问题,需要将windows下的共享文件夹挂载到Linux下来,于是就用到mount命令。 可是按照以前的方法mount本机的硬盘行,mount局域网内的就不行了,只好去搜了一下,原来这么简单,如下: www.5dlinux.com 写道 假定您的网络连接已经正确设定好。 网络主机的 IP: 192.168.0.1 网络主机的使用者名称: myusername 网络主机的登录密码: mypassword 分享中的目录名称: linux 主机上要挂载的目录: /media/sharename 要挂载网络共享目录时 sudo mkdir /media/sharename sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777 要卸载网络共享目录时 sudo umount /media/sharename/ 注:如果需要向共享文件夹里面写入文件,需要在windows下给予myusername用户相应的权限。 以上转载自 http://www.5dlinux.com/article/1/2007/linux_8819.html 附加另一个方法(2009.7.8):

Shell script to know whether a filesystem is already mounted

自作多情 提交于 2019-11-30 17:18:51
I have a tmpfs file system mounted on a particular directory. I want to write a shell script to check whether the tmpfs filesystem is already mounted on the directory. You can check the type of the filesystem. $ stat -f -c '%T' / xfs $ stat -f -c '%T' /dev/shm tmpfs You could also check whether a directory is a mountpoint by comparing its device with its parent's. $ stat -c '%D' / 901 $ stat -c '%D' /home fe01 $ stat -c '%D' /home/$USER fe01 There's a tool specifically for this: mountpoint(1) if mountpoint -q "$directory" ; then echo it is a mounted mountpoint else echo it is not a mounted

How do I map volume outside C:\Users to container on Windows?

最后都变了- 提交于 2019-11-30 14:16:07
问题 I'm doing server side development and my workspace is located in D: because I'm not a fan of storing data on C: but just can't find a way to map d:\Workspace to /home/workspace I've tried creating a symblink from C:\Users\username to D:\Workspace by: map C:\Users\username\Workspace to /home/workspace Stop container rename C:\Users\username\Workspace Create symlink named Workspace to D:\Workspace Start container At first Docker worked fine during that session until I restart Boot2Docker, then

Mount “named volume” as non-root in Docker

浪尽此生 提交于 2019-11-30 13:03:25
Is there any way to mount a named volume as a non-root user? I am trying to avoid having to run a chown in each Dockerfile but I need the mount to be writable by a non-root user to be able to write the artifacts created by a build in the image This is what I'm trying docker run --rm -it -v /home/bob/dev/:/src/dev -v builds:/mnt/build --name build hilikus/build /bin/bash but for the second mount I get [user@42f237282128 ~]$ ll /mnt total 4 drwxr-xr-x 2 root root 4096 Sep 18 19:29 build My other mount ( /src/dev/ ) is owned by user , not by root so it gives what I need; however, I haven't been

Linux挂接命令(mount)的使用方法

隐身守侯 提交于 2019-11-30 11:49:54
首先,介绍一下挂接 (mount) 命令的使用方法。 mount 命令参数非常多,这里主要常用的参数。m ount命令的一般格式如下: mount [-t vfstype] [-o options] device dir 其中: 1)-t vfstype, 指定文件系统的类型,通常不必指定。 mount 会自动选择正确的类型。常用类型有: iso9660 光盘或光盘镜像 msdos DOS fat16文件系统 vfat Windows 9x fat32文件系统 ntfs Windows NT ntfs文件系统 smbfs Mount Windows文件网络共享 nfs UNIX(LINUX) 文件网络共享 2) -o options, 主要用来描述设备或档案的挂接方式。常用的参数有: loop 用来把一个文件当成硬盘分区挂接上系统 ro 采用只读方式挂接设备 rw 采用读写方式挂接设备 iocharset 指定访问文件系统所用字符集 3) device, 要挂接 (mount) 的设备。 4) dir, 设备在系统上的挂接点 (mount point) 让Linux启动时自动挂载设备 编辑/etc/fstab文件 # # /etc/fstab # Created by anaconda on Mon Jun 27 20:19:15 2011 # # Accessible

Named routes in mounted rails engine

寵の児 提交于 2019-11-30 11:18:20
问题 I'm making a small rails engine which I mount like this: mount BasicApp::Engine => "/app" Using this answer I have verified that all the routes in the engine are as the should be: However - when I (inside the engine) link to a named route (defined inside the engine) I get this error undefined local variable or method `new_post_path' for #<#<Class:0x000000065e0c08>:0x000000065d71d0> Running "rake route" clearly verifies that "new_post" should be a named path, so I have no idea why Rails (3.1.0

How do I map volume outside C:\\Users to container on Windows?

廉价感情. 提交于 2019-11-30 09:57:52
I'm doing server side development and my workspace is located in D: because I'm not a fan of storing data on C: but just can't find a way to map d:\Workspace to /home/workspace I've tried creating a symblink from C:\Users\username to D:\Workspace by: map C:\Users\username\Workspace to /home/workspace Stop container rename C:\Users\username\Workspace Create symlink named Workspace to D:\Workspace Start container At first Docker worked fine during that session until I restart Boot2Docker, then start the container I'd get "C:\Users\username\Workspace file exists". I think this is one Docker's

Monitoring mount point changes via /proc/mounts

爷,独闯天下 提交于 2019-11-30 08:59:08
According proc manual, one can monitor for mount point changes in linux system by opening "/proc/mounts", and adding the file descriptor to read fd_set in select() call. Following piece of code works on Ubuntu 9.04, and not in Ubuntu 10.04 (with 2.6.32 linux kernel): int mfd = open("/proc/mounts", O_RDONLY, 0); fd_set rfds; struct timeval tv; int rv; FD_ZERO(&rfds); FD_SET(mfd, &rfds); tv.tv_sec = 5; tv.tv_usec = 0; int changes = 0; while ((rv = select(mfd+1, &rfds, NULL, NULL, &tv)) >= 0) { if (FD_ISSET(mfd, &rfds)) { fprintf(stdout, "Mount points changed. %d.\n", changes++); } FD_ZERO(&rfds)