OpenVZ Forum


Home » General » Support » raw disk access from container
raw disk access from container [message #51100] Tue, 04 February 2014 12:20 Go to next message
smal2014 is currently offline  smal2014
Messages: 2
Registered: February 2014
Junior Member
From: 68.0.14*
I've been trying to evaluate if OpenVZ would work to give physical access to a raw device from the container. So far I have been unsuccessful (partly). This is on Centos 6.5 host and container.

Basically, here's what I've done :
[host]
# lvcreate -L 500m /dev/virtual-machines
# raw /dev/raw/raw1 /dev/virtual-machines/lvol0
# raw -qa
/dev/raw/raw1: bound to major 253, minor 9
# vzctl set 1 --devnodes "raw/raw1:rwq raw/rawctl:rwq" --save

# vzctl enter 1

[container]
# [root@ /]# raw -qa
/dev/raw/raw1: bound to major 253, minor

# [root@ /]# udevadm test /dev/raw/raw1
run_command: calling: test
...
unable to open device '/sys/dev/raw/raw1'

I've got to the point where I can see /dev/raw/rawctl be able to query it. Although it is not putting the raw device in the /sys/dev/block

I've put the following in /etc/udev/rules.d/60-raw.rules (although didn't really understand) :
SUBSYSTEM=="block", ENV{MAJOR}=="253", ENV{MINOR}=="9", GROUP:="ats", OWNER="nobody"

I'm sure I'm missing important pieces. Basically I can't open the raw device I created.

Thanks!
Re: raw disk access from container [message #51103 is a reply to message #51100] Wed, 05 February 2014 03:51 Go to previous message
smal2014 is currently offline  smal2014
Messages: 2
Registered: February 2014
Junior Member
From: *hsd1.ga.comcast.net
I might have fixed my own problem temporarily. The device /dev/dm-8 from the logical volume creation showed up. I could open that device without any problems.

I used --devices "b:253:9:rwq" or --devnodes <vg>/<lv>:rwq and then /dev/dm-8 popped up.
Previous Topic: /proc/partitions is empty
Next Topic: Need help in container creation
Goto Forum:
  


Current Time: Sat Nov 17 21:07:55 GMT 2018