Friday, August 14, 2009

Making a linux mount persistent

I've been playing around with my Centos5.3 VirtualBox Guest (on a Windows Host).

I develop my php applications on Windows, and test them on a VirtualBox shared folder, so that they would run on the apache running on the Centos virtual machine.
A problem I'm facing is that I have to run a mount command every time I boot Linux, so that the VM would see the shared folder.
I Googled around for a solution to make the mount persistent, and I found that an entry in the /etc/fstab file would do the trick.
Each line is a set of space/tab delimited fields as follows:
share /var/share vboxsf rw 0 0
A much easier way is to do a regular mount, and move the relevant line from /etc/mtab to /etc/fstab, and reboot.
For more information, type "man fstab".