# Cannot mount USB drive as 'backup' user



## Borophyll (Nov 23, 2010)

Hi,

I have a backup server which has USB caddies attached to it, each holding a hard disk.  I have recently rebuilt the server with 8.1, and have now found that it is not possible to mount these drives as user 'backup', whereas previously I have been able to.  The command:


```
# mount -t ufs /dev/ufs/backup0 /mnt
```

will work when I am root, but not when I am user 'backup'.  I get:


```
mount: /dev/ufs/backup0 : Operation not permitted
```

Here is additional info:

```
# ls -al /mnt
total 4
drwxrwxr-x   2 root  operator  512 Nov 23 04:48 .
drwxr-xr-x  20 root  wheel     512 Nov 23 11:28 ..
# ls -al /dev/ufs
total 1
dr-xr-xr-x  2 root  wheel          512 Nov 23 11:29 .
dr-xr-xr-x  8 root  wheel          512 Nov 23 11:29 ..
crw-rw----  1 root  operator    0, 176 Nov 23 12:10 20101108140058OS
crw-rw----  1 root  operator    0, 150 Nov 23 11:30 20101122091721OS
crw-rw----  1 root  operator    0, 122 Nov 23 11:29 BackupUSBamd64
crw-rw----  1 root  operator    0, 178 Nov 23 12:10 backup0
# groups backup
operator
# sysctl vfs.usermount
vfs.usermount: 1
```

Am I missing anything?  Thanks in advance.


----------



## Borophyll (Nov 23, 2010)

If no-one knows what the problem is, can anybody give me an indication of what steps I can take to troubleshoot this?  Should I report it as a bug with the mount utility or OS?


----------



## SirDice (Nov 23, 2010)

It's not a bug, it's working as it should. This is similar to a 'regular' user trying to mount a filesystem. Same solution too.

http://www.freebsd.org/doc/en/books/faq/disks.html#USER-FLOPPYMOUNT


----------



## Borophyll (Nov 24, 2010)

I have already read this document and as far as I can tell I have done everything in it.

No matter, for some reason everything is working this morning.  I should be happy I guess, but it's not satisfying when problems just resolve themselves mysteriously, and you don't know what was going on...


----------



## wblock@ (Nov 24, 2010)

Modifications to /etc/devfs.conf and /etc/devfs.rules only take effect at startup or if you run `# /etc/rc.d/devfs restart`.


----------



## Borophyll (Nov 25, 2010)

Aha!  I worked it out.  The reason it didn't work is indeed hidden in a sentence in the link posted by SirDice.  

"All users can now mount the floppy /dev/fd0 onto a directory that they *own*"

I assumed that if the directory has rwx permissions for owner or group, you can mount on it, but you must be the owner.

This is the reason why it worked the next morning.  The backup script creates a subdir under /mnt and mounts to it.  Because the subdir is owned by backup, it works!


----------



## SirDice (Nov 25, 2010)

Borophyll said:
			
		

> Aha!  I worked it out.  The reason it didn't work is indeed hidden in a sentence in the link posted by SirDice.


Sometimes three small letters can ruin your day 

Good to hear it's working :beer


----------

