# udev rule to change permissions on /dev/sda

## jcolby

Forum members - 

I am trying to use raw disk mappings with virtual box, and in order to do so I need to change the permissions on /dev/sda*.  If I use chmod to do it the permissions get changed back to what they were on boot.  Can someone point me in the right directions as to what I need for a udev rule so the I can set the permission on boot for /dev/sda?

Thanks, and happy holidays.

James

----------

## r3tep

Why dont you set permissions in /etc/fstab?

----------

## jcolby

 *r3tep wrote:*   

> Why dont you set permissions in /etc/fstab?

 

How do I do that?  Can use fstab to set permissions on /dev/sda?

Thanks,

James

----------

## r3tep

I have these examples:

```
/dev/scd1               /media/cdrom   auto     defaults,user,noauto    0 0
```

Any User can mount scd1 (group dependent). Only the user, that mounted scd1 can umount it.

```
/dev/scd0               /media/cdrecorder auto defaults,users,noauto     0 0
```

Any User can mount scd0 (group dependend). Look at users. Any user can umount it. (As I understood. Not tested)

You'll find more information here: http://linux.die.net/man/8/mount.

I have never tested virtualbox before, but if there is a special user, this would solve your Problem. (set user=virtualbox)

However, if you run virtualbox as a user (not root), it'll look at /etc/fstab and mount the device, if permitted.

----------

