I've set up a udev rule to attach a particular EBS volume as owned by a user, and this works. Here are the permissions on the device node after the volume has been attached:
brw-rw---- 1 myuser myuser 202, 240 Feb 4 20:21 /dev/xvdp
But when I try to run
mkfs -t xfs /dev/xvdp I get the error:
mkfs.xfs: error - cannot set blocksize 512 on block device /dev/xvdp: Permission denied
If I run the command as root it succeeds OK, and if I change the filesystem type to ext4 the operation also succeeds.
What extra permission to I need to give the device so my user can format it without
sudoing? Or is this likely a Xen or xfs bug?
I'm running amazon linux:
Linux version 3.2.36-1.46.amzn1.x86_64 (mockbuild@gobi-build-31003) (gcc version 4.6.2 20111027 (Red Hat 4.6.2-2) (GCC) ) #1 SMP Mon Jan 14 04:42:23 UTC 2013