Accessing Devices from Inside VPS i need help!

Discussion in 'Installation/Configuration' started by swap-as, May 7, 2009.

  1. swap-as

    swap-as New Member

    DEBIAN-5 HN:

    SERVER:~# ls -l /dev/sdb{,1,2,3,4}
    brw-rw---- 1 root disk 8, 16 2009-05-07 16:18 /dev/sdb
    brw-rw---- 1 root disk 8, 17 2009-05-07 16:18 /dev/sdb1
    brw-rw---- 1 root disk 8, 18 2009-05-07 16:18 /dev/sdb2
    brw-rw---- 1 root disk 8, 19 2009-05-07 16:18 /dev/sdb3
    brw-rw---- 1 root disk 8, 20 2009-05-07 16:18 /dev/sdb4
    SERVER:~#
    SERVER:~# vzctl set 204 --devices b:8:16:rw --devices b:8:20:rw --save
    SERVER:~# vzctl restart 204

    then in VPS i can't see sdb4 devices:

    root@vps4:/# ls -l /dev/
    total 0
    crw-rw---- 1 root video 10, 175 Dec 24 17:07 agpgart
    crw-rw---- 1 root audio 14, 4 Dec 24 17:07 audio
    crw-rw---- 1 root audio 14, 20 Dec 24 17:07 audio1
    crw-rw---- 1 root audio 14, 36 Dec 24 17:07 audio2
    crw-rw---- 1 root audio 14, 52 Dec 24 17:07 audio3
    crw-rw---- 1 root audio 14, 7 Dec 24 17:07 audioctl
    crw------- 1 root tty 5, 1 Dec 24 17:07 console
    lrwxrwxrwx 1 root root 11 May 7 09:24 core -> /proc/kcore
    crw-rw---- 1 root audio 14, 3 Dec 24 17:07 dsp
    crw-rw---- 1 root audio 14, 19 Dec 24 17:07 dsp1
    crw-rw---- 1 root audio 14, 35 Dec 24 17:07 dsp2
    crw-rw---- 1 root audio 14, 51 Dec 24 17:07 dsp3
    lrwxrwxrwx 1 root root 13 May 7 09:24 fd -> /proc/self/fd
    crw-rw-rw- 1 root root 1, 7 Dec 24 17:07 full
    prw------- 1 root root 0 May 7 13:17 initctl
    crw-r----- 1 root kmem 1, 2 Dec 24 17:07 kmem
    srw-rw-rw- 1 root root 0 May 7 13:18 log
    brw-rw---- 1 root disk 7, 0 Dec 24 17:07 loop0
    brw-rw---- 1 root disk 7, 1 Dec 24 17:07 loop1
    brw-rw---- 1 root disk 7, 2 Dec 24 17:07 loop2
    brw-rw---- 1 root disk 7, 3 Dec 24 17:07 loop3
    brw-rw---- 1 root disk 7, 4 Dec 24 17:07 loop4
    brw-rw---- 1 root disk 7, 5 Dec 24 17:07 loop5
    brw-rw---- 1 root disk 7, 6 Dec 24 17:07 loop6
    brw-rw---- 1 root disk 7, 7 Dec 24 17:07 loop7
    crw-r----- 1 root kmem 1, 1 Dec 24 17:07 mem
    crw-rw---- 1 root audio 35, 0 Dec 24 17:07 midi0
    crw-rw---- 1 root audio 14, 2 Dec 24 17:07 midi00
    crw-rw---- 1 root audio 14, 18 Dec 24 17:07 midi01
    crw-rw---- 1 root audio 14, 34 Dec 24 17:07 midi02
    crw-rw---- 1 root audio 14, 50 Dec 24 17:07 midi03
    crw-rw---- 1 root audio 35, 1 Dec 24 17:07 midi1
    crw-rw---- 1 root audio 35, 2 Dec 24 17:07 midi2
    crw-rw---- 1 root audio 35, 3 Dec 24 17:07 midi3
    crw-rw---- 1 root audio 14, 0 Dec 24 17:07 mixer
    crw-rw---- 1 root audio 14, 16 Dec 24 17:07 mixer1
    crw-rw---- 1 root audio 14, 32 Dec 24 17:07 mixer2
    crw-rw---- 1 root audio 14, 48 Dec 24 17:07 mixer3
    crw-rw---- 1 root audio 31, 0 Dec 24 17:07 mpu401data
    crw-rw---- 1 root audio 31, 1 Dec 24 17:07 mpu401stat
    crw-rw-rw- 1 root root 1, 3 Dec 24 17:07 null
    crw-r----- 1 root kmem 1, 4 Dec 24 17:07 port
    crw-rw-rw- 1 root tty 5, 2 May 7 13:59 ptmx
    drwxr-xr-x 2 root root 0 May 7 13:18 pts
    lrwxrwxrwx 1 root root 4 May 7 09:24 ram -> ram1
    brw-rw---- 1 root disk 1, 0 Dec 24 17:07 ram0
    brw-rw---- 1 root disk 1, 1 Dec 24 17:07 ram1
    brw-rw---- 1 root disk 1, 10 Dec 24 17:07 ram10
    brw-rw---- 1 root disk 1, 11 Dec 24 17:07 ram11
    brw-rw---- 1 root disk 1, 12 Dec 24 17:07 ram12
    brw-rw---- 1 root disk 1, 13 Dec 24 17:07 ram13
    brw-rw---- 1 root disk 1, 14 Dec 24 17:07 ram14
    brw-rw---- 1 root disk 1, 15 Dec 24 17:07 ram15
    brw-rw---- 1 root disk 1, 16 Dec 24 17:07 ram16
    brw-rw---- 1 root disk 1, 2 Dec 24 17:07 ram2
    brw-rw---- 1 root disk 1, 3 Dec 24 17:07 ram3
    brw-rw---- 1 root disk 1, 4 Dec 24 17:07 ram4
    brw-rw---- 1 root disk 1, 5 Dec 24 17:07 ram5
    brw-rw---- 1 root disk 1, 6 Dec 24 17:07 ram6
    brw-rw---- 1 root disk 1, 7 Dec 24 17:07 ram7
    brw-rw---- 1 root disk 1, 8 Dec 24 17:07 ram8
    brw-rw---- 1 root disk 1, 9 Dec 24 17:07 ram9
    crw-rw-rw- 1 root root 1, 8 Dec 24 17:07 random
    crw-rw---- 1 root audio 35, 64 Dec 24 17:07 rmidi0
    crw-rw---- 1 root audio 35, 65 Dec 24 17:07 rmidi1
    crw-rw---- 1 root audio 35, 66 Dec 24 17:07 rmidi2
    crw-rw---- 1 root audio 35, 67 Dec 24 17:07 rmidi3
    crw-rw---- 1 root audio 14, 1 Dec 24 17:07 sequencer
    drwxrwxrwt 2 root root 40 May 7 13:18 shm
    crw-rw---- 1 root audio 35, 128 Dec 24 17:07 smpte0
    crw-rw---- 1 root audio 35, 129 Dec 24 17:07 smpte1
    crw-rw---- 1 root audio 35, 130 Dec 24 17:07 smpte2
    crw-rw---- 1 root audio 35, 131 Dec 24 17:07 smpte3
    crw-rw---- 1 root audio 14, 6 Dec 24 17:07 sndstat
    lrwxrwxrwx 1 root root 4 May 7 09:24 stderr -> fd/2
    lrwxrwxrwx 1 root root 4 May 7 09:24 stdin -> fd/0
    lrwxrwxrwx 1 root root 4 May 7 09:24 stdout -> fd/1
    crw-rw-rw- 1 root tty 5, 0 Dec 24 17:07 tty
    crw------- 1 root tty 4, 0 Dec 24 17:07 tty0
    crw------- 1 root tty 4, 1 Dec 24 17:07 tty1
    crw------- 1 root tty 4, 2 Dec 24 17:07 tty2
    crw------- 1 root tty 4, 3 Dec 24 17:07 tty3
    crw------- 1 root tty 4, 4 Dec 24 17:07 tty4
    crw------- 1 root tty 4, 5 Dec 24 17:07 tty5
    crw------- 1 root tty 4, 6 Dec 24 17:07 tty6
    crw------- 1 root tty 4, 7 Dec 24 17:07 tty7
    crw------- 1 root tty 4, 8 Dec 24 17:07 tty8
    crw------- 1 root tty 4, 9 Dec 24 17:07 tty9
    crw-rw-rw- 1 root root 1, 9 Dec 24 17:07 urandom
    prw-r----- 1 root adm 0 May 7 13:36 xconsole
    crw-rw-rw- 1 root root 1, 5 Dec 24 17:07 zero

    Help Help Help
     
  2. falko

    falko Super Moderator

    You cannot access the hardware from inside the virtual machine.
     
  3. swap-as

    swap-as New Member

    Thank you for your answer.
    I found the way to solve this problem. I forgot to write those commands:


    SERVER:~#vzctl set 204 --devnodes sda4:rw --save
    SERVER:~#vzctl set 204 --devnodes sdb4:rw --save
    SERVER:~#vzctl restart 204



    Then I started VPS and wrote this command:

    root@vps4:~# ls -l /dev/sda4
    brw-r----- 1 root root 8, 4 May 8 09:14 /dev/sda4
    root@vps4:~# ls -l /dev/sdb4
    brw-r----- 1 root root 8, 20 May 8 00:46 /dev/sdb4

    root@vps4:~# mount /dev/sda4 /home
    root@vps4:~# mount /dev/sdb4 /backup
    root@vps4:~#nano /etc/fstab

    # UNCONFIGURED FSTAB FOR BASE SYSTEM
    /dev/sda4 /home ext3 defaults 0 2
    /dev/sdb4 /backup ext3 defaults 0 2

    after VPS restarting

    SERVER:~#vzctl restart 204

    It works OK.

    Thank you for your answer to my message anyway.
     

Share This Page