0

I've a problem to add sticky bit to a synced folder into Vagrant.

I need to move, into guest, from /tmp to another /mytmp (more bigger), for MySQL tmp data file, because :

ERROR 3 (HY000): Error writing file '/tmp/MYQ4Gqvz' (Errcode: 28 - No space left on device)

So I've add into Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.provision "shell",
    inline: "echo 'Change permission';chmod +t /mytmp;touch /mytmp/test"
  ......
  config.vm.synced_folder "mytmp2/", "/mytmp",
    owner: "root", group: "root", mount_options: ["dmode=777,fmode=777"]
  ......

But, when I try to pass statements to MySQL I've this message:

ERROR 6 (HY000): Error on delete of '/mytmp/MYwO1OzK' (Errcode: 26 - Text file busy)

I think that with Sticky bit on /mytmp I can solve this problem (it's the only difference from /tmp and /mytmp folder) but in provisioning the command:

chmod +t /mytmp

doesn't add sticky bit to folder.

Could you give me some information about, for example if I can add a command to Vagrant mount_options?

I've tried also :

mount_options: ["dmode=1777,fmode=1777"]

nothing change..

Thanks a lot. Massimo

Massimo
  • 21
  • 2
  • Just to know if you run `chmod +t /mytmp` after the machine is booted, is MySQL running file ? – Frederic Henri Sep 22 '15 at 13:07
  • Hi Frederic, I can't add sticky bit on /mytmp from VM because "Vagrant" doesn't permit change of permission into its path synced_folder. – Massimo Sep 22 '15 at 13:32
  • you're using VirtualBox provider, correct ? on vbox I cannot change the sticky bit neither, but I am able to change it with vmware provider – Frederic Henri Sep 22 '15 at 14:44
  • Yes, I use VirtualBox, and I cannot change it for wmware...terrible – Massimo Sep 22 '15 at 16:03
  • 1
    you would need to extend the hard drive space on the VM ... – Frederic Henri Sep 22 '15 at 16:48
  • Yes I know that I could extend my VM but I've a vmkd disk, so I'd convert to VDI and this operation is not so simple in VirtualBox. – Massimo Sep 23 '15 at 07:30
  • 1
    `VBoxManage clonehd box-disk1.vmdk box-disk1.vdi --format vdi` - the whole process is a bit tedious right and can be a bit long if you already have a large HD but you do it only once – Frederic Henri Sep 23 '15 at 07:33
  • Hi Frederic! I've solved with your suggest and with this guide https://gist.github.com/christopher-hopper/9755310 Thanks a lot! – Massimo Sep 23 '15 at 09:58

0 Answers0