Access dated folder by VM

Asked

Viewed 155 times

2

My scenario is this::

  • /media/data/svr/mysql
    Where is my dated mysql folder located.

The development environment is running on Vagrant (debian 6), with php 53 and mysql 5.5

I configured the VM to access the date folder via NFS. The df -h command shows this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/debian--607--x64--vbox4210-root
                      9.1G  1.4G  7.3G  16% /
tmpfs                 249M     0  249M   0% /lib/init/rw
udev                  244M  120K  244M   1% /dev
tmpfs                 249M     0  249M   0% /dev/shm
/dev/sda1             228M   16M  201M   8% /boot
192.168.53.1:/media/dados/svr/mysql
                       93G  4.7G   83G   6% /home/vagrant/servidor
/var/www               93G  9.4G   83G  11% /var/www
/vagrant              183G   56G  127G  31% /vagrant
/tmp/vagrant-puppet-1/manifests
                      183G   56G  127G  31% /tmp/vagrant-puppet-1/manifests

The ls -al command executed inside the VM running on Vagrant shows the folder permission like this: drwxrwxr-x 6 115 125 4096 Apr 14 21:39 server/

My question is how to make mysql use folder /home/Vagrant/server?

In my.cnf file I have already informed the path of the dated as datadir = /home/Vagrant/server - but failed.

When I informed you: datair = 192.168.53.1:/media/data/svr/mysql system showed error message -

**/etc/init. d/mysql: ERROR: The Partition with

192.168.53.1:/media/data/svr/mysql is Too full! ... failed!

How to make the virtual machine understand that the dated mysql folder is in the/data/svr/mysql drive mounted via nfs?

  • Can you access the logs ? Maybe indicate something else in the logs to help identify the problem.

1 answer

1


Who is interested, I was able to solve the problem of sharing and access as follows:

In the Vagrantfile file generated by Puphpet, I added the Owner and group when it mounts the folder. Saying that the owner of the folder will be mysql and mysql group.

data['vm']['synced_folder'].each do |i, folder|
    if folder['source'] != '' && folder['target'] != '' && folder['id'] != ''
      nfs = (folder['nfs'] == "true") ? "nfs" : nil
      config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{folder['id']}", **owner: "mysql", group: "mysql",** type: nfs
    end
  end

In the config.yaml file, I created the share as below.

 synced_folder:
            0C0LWqoKUqOI:
                source: /media/dados/svr/mysql
                target: /home/vagrant/servidor
                nfs: 'false'

To finish after stopping mysql on the virtual machine, I changed the path from var/lib/mysql to /home/Vagrant/server

From that I initialized mysql and it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.