Hot answers tagged

26

Usually the location of the USB port (Bus/Device) determines the order it's detected on. However, don't rely on this. Each file system has a UUID which stands for universally unique identifier (FAT and NTFS use a slightly different scheme, but they also have an identifier that can be used as a UUID). You can rely on the (Linux) UUID to be unique. For more ...


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 ...


13

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: ...


13

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" ...


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 ...


10

If your fstab references partitions as /dev/sdx, then adding a new drive can certainly confuse the system. The recent practice, however, is to use Partition UUIDs to identify the partitions. If your system has udev installed (must be the case for 2.6+ Linux kernels), you can use persistent naming in fstab. By default, partitions are identified via UUIDs: ...


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

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" ...


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


8

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", ...


8

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 ...


8

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 ...


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

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

Add it to /etc/fstab with the appropriate options: /dev/md0 /mnt/raiddrives ext4 defaults 0 2 The third value is the filesystem type (I've specified ext4 here but you need to use the correct one for your situation), the fourth is the options, the fifth is the dump level (leave it at 0) and the sixth is the filesystem check pass (0 to disable fsck, 1 for ...


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

You can do this by the simplest way. Go to: Menu -> Disks (app) Select the volume you want to mount, and click on its options Select "Edit Mount Options" -> And make sure you select "Mount at Startup" in the drive.


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 ...


5

SysV Init The /etc/init.d/mountall.sh init script mounts local filesystems only: mount -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2,ceph -O no_netdev Other filesystems are mounted by separate init scripts, like for example /etc/init.d/mountnfs.sh, which declare (via LSB headers) their dependency on $network. Thus these get scheduled later, ...


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

Let's take it from the beginning. First of all, you mount partitions, not disks. So, mount /dev/sdb won't work, mount /dev/sdb1 will (assuming you want to mount the 1st partition of sdb). To be able to access the drive with cd /name you need to either mount it at /name or make /name a symlink to /mnt/name. To actually mount it at /name do the following: ...


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.



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