Tag Info

Hot answers tagged

17

autofs can do this for you. You can configure any number of mountpoints with various options, and the corresponding filesystems are mounted whenever the mountpoint is accessed. After a given amount of inactivity the filesystems are unmounted again. There are no doubt various ways of using autofs, but here's one way of doing what you're trying to do, based ...


12

Mounting a filesystem does not require superuser privileges under certain conditions, typically that the entry for the filesystem in /etc/fstab contains a flag that permits unprivileged users to mount it, typically user. To allow unprivileged users to mount a CIFS share (but not automount it), you would add something like the following to /etc/fstab: ...


12

The mount(8) man page has a section dedicated to this; in short, it comes down to adding the user or users option for that mount in /etc/fstab: The non-superuser mounts. Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, anybody can mount the corresponding system. Thus, given a line ...


9

Figured there should be a much easier way to address such a common problem, and there is. Here's what I tried on my wheezy/sid server: sudo apt-get install usbmount Plug in usb stick, done! My stick is now accessible through /media/usb. Btw, usbmount doesn't have a man page, please read /usr/share/doc/usbmount/README.gz instead. It seems usbmount ...


9

Mount the NFS-share on the clients using the mount-options "bg,intr,hard". Most important in your case is "bg" for background - which tells the system not to block when the server is not available. "intr" for interrruptable - so you can kill hanging mounts on the client with the kill command. "hard" is the opposite of "soft". The difference is that "hard" ...


9

You can do this with systemd, so you don't have to install extra software and just have a small amount of extra configuration. Simply add noauto,x-systemd.automount to the options in fstab. noauto to not mount automatically on boot and x-systemd.automount to let systemd mount it on access. Source: ArchWiki - fstab


7

What you're looking for is AutoFS. Install the RPM, then make sure that it's running at start(RH/etc: chkconfig autofs on). Edit the file /etc/auto.master and add the following line: /media/ /etc/auto.media. If I were you, I would change "media" in both places to be the name of your root-level directory. Then edit the file /etc/auto.media and add ...


7

It looks like the man page snippets you quoted refer to the basic level of security that standard file ownership and permissions provide. The configuration file /etc/fstab is readable by any user on the system. A safer place to store sensitive information would be a file with permissions allowing to be read only by the owner. I understand that in your case, ...


7

Figured it out (thanks to everybody who helped jog the brain a little bit). Because usbmount is doing the automounting, this is where the problem lay. And, conveniently enough, usbmount provides a configuration file for managing how a drive gets mounted. In order to manage this, open /etc/usbmount/usbmount.conf. There is a line in the file that looks like ...


7

I think you're looking for pmount. If you want automatic mounting upon insertion, see Automounting USB sticks on Debian. If your system uses udisks2, that's the preferred way of reacting to the insertion of a removable storage device. See the Arch Wiki for configuration tips for Udisks. Otherwise, the program that reacts when a new device appears is udev, ...


7

When a new device appears, udev is notified. It normally creates a device file under /dev based on built-in rulesĀ¹. You can override these rules to change the device file location or run an arbitrary program. Here is a sample such udev rule: KERNEL=="sd*", ATTRS{vendor}=="Yoyodine", ATTRS{serial}=="123456789", NAME="keepass/s%n", ...


7

You can do this through the file /etc/fstab. Take a look at this link. This tutorial also has good details. Example steps First you need to find out the UUID of the hard drives. You can use the command blkid for this. For example: % sudo blkid /dev/sda1: TYPE="ntfs" UUID="A0F0582EF0580CC2" /dev/sda2: UUID="8c2da865-13f4-47a2-9c92-2f31738469e8" ...


7

It depends on your windowing environment (GNOME/KDE/etc.) but in GNOME, for example, you'll see daemons running called, gvfs-*-volume-monitor. These daemons are responsible for mounting devices when running the desktop environment, they have nothing to do with /etc/fstab, and operate completely independently. As far as a config file, there are some files ...


7

Ok, the summary is that Nautilus uses GVFS and you need to tell udev to use GVFS too when reading the fstab entries, you can do this using: /dev/block-device /mount/point auto x-gvfs-show,ro 0 0 x-gvfs-show will tell udev and anyone interested to use the GVFS helper to mount the filesystem, so gvfs has all the control mounting, umounting, moving mount ...


6

One possibility is to add your own udev rule for this partition, that overrides the default ones. On Ubuntu 10.04 /lib/udev/rules.d/80-udisks.rules has some default rules that make udisks ignore some partitions (e.g. partitions that are known to be rescue partitions etc.) which might be an inspiration... On Ubuntu 10.04 your own rules should go into ...


6

bind mirrors a filesystem (among other situatons, it's useful when setting a chroot inside which you need to have a "complete" system (like when unpacking/installing Gentoo). Just simply like that, it mirrors a tree from A into B. I don't know for sure if it has any option, but I doubt it, it does not do more than, well, mirroring. Unlike a symlink, which ...


6

udev outputs logging information to /var/log/messages, but by default it only logs errors, and it happens you've constructed a command that doesn't do what you want, but also doesn't error out. The >> redirection is handled by your shell, and udev doesn't run the command through a shell, so it's literally running the binary /bin/echo and passing it the ...


6

The simple answer is they cheat. They don't use the fstab. They typically use a udev hook to catch insertion events, mount the disk manually as root, which may be passed to dbus to notify your file manager that you have a new disk or they might use suid utilities instead of dbus for unmounting. Unfortunately there are no standard configuration options for ...


4

Have a look at gnome-disk-utility. I provides a tool named palimpsest which allows you to see all storage devices. Here's what mine looks like:


4

mount (1) requires a mount point to exist in order to mount something. So, if /mnt/subdir1 doesn't exist an attempt to mount something there will fail. I was not aware that you could mount over a mount point that is mounted from NFS, although you can do it with other file systems (e.g. you can mount /usr under / and /usr/local under /usr, so I guess that ...


4

You can use \x20 for space. That is hex value for ASCII (and utf-8 encoded) space. Or you can use the octal variant \040. So that would be (in fstab): UUID=01CD72098BB21B70 /media/tusharmakkar08/Local\x20Disk1 # or UUID=01CD72098BB21B70 /media/tusharmakkar08/Local\040Disk1 If you are not to familiar with ASCII fun install ascii and: ascii # ...


4

As others have commented I don't believe this is possible in runlevel3. The application in question under GNOME 2.x is called gnome-volume-manager. You can reconfigure it a bit using gnome-volume-properties. screenshot              Given you're in runlevel 3 I don't believe this is an option. You ...


4

You could write a udev rule to disable automounting. Create the file /etc/udev/rules.d/85-no-automount.rules Copy this line into it SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0" Reboot the system This should prevent any USB device from being mounted by the udisksd daemon.


4

PolicyKit (or Polkit) is an application-level toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes. It is a framework for centralizing the decision making process with respect to granting access to privileged operations (like calling the Mount() method) for unprivileged (desktop) applications. An ...


4

This is my understanding of the situation, but I'm not an expert so it is less technical than the other answers. This is what I understand after using these systems for many years, I have not studied them in any detail. There are three main players here and between them they manage the mounts: FUSE: This is at the center of everything, as described in its ...


4

I use the usbmount package to automount USB drives on my Ubuntu server install. I have confirmed that the package exists for Wheezy too. sudo apt-get install usbmount usbmount will automount hfsplus, vfat, and ext (2, 3, and 4) file systems. You can configure it to mount more/different file systems in /etc/usbmount/usbmount.conf. By default it ...


4

No. /etc/fstab is consulted when mount is called. It's just a text file. It's also used implicitly by the init system at boot time, most likely via mount -a: -a, --all Mount all filesystems (of the given types) mentioned in fstab (except for those whose line contains the noauto keyword). From man 8 mount. Note that if you have some kind of ...


3

This is all feasible with udev. Have a look at UAM, which seems to address most of the issues you've mentioned, but actually does mount automatically. If you like, you could make use of the great capabilities it provides, but modify it so that the media are not mounted automatically. You could also contact the author and suggest your non-automatic mounting ...


3

There are many ways to check if a particular directory is a mount point, for example (under Linux) checking in the mount point list if ! </proc/mounts awk '$2 == "/mount/point" {exit(0)} END {exit(1)}'; then mount /mount/point fi or (portably) checking whether the path's filesystem's mount point is itself if ! df -P /mount/point | grep -q ...


3

You can do it with udev rules. I don't have ubuntu, but you can try this. Create a file called /etc/udev/rules.d/99-hide.rules with the following in it: SUBSYSTEM=="usb_device", ATTR{idVentor}=="<VENDID>", ATTR{idProduct}=="<DRIVECODE>",ENV{UDISKS_PRESENTATION_HIDE}:="1" Where you have to substitute your usb storage device's vendor and ...



Only top voted, non community-wiki answers of a minimum length are eligible