Search code examples
linuxcentosfilesystemsvirtualboxmount

Mount point does not exist, even though folder exists. Able to mount manually


I am running CentOS Guest on a Windows Host in VirtualBox. I have created an additional hard-drive /dev/sdb and it has 1 partition /dev/sdb1 with my mysql data.

I want to mount it to /mysql at runtime and create a symlink from /var/lib/mysql to /mysql

But when I try to mount I get this error:

[root@localhost mysql]# mount -a

mount: mount point /myqsl does not exist

But of course the file does exist!

[root@localhost mysql]# cd /mysql/

[root@localhost mysql]# cd ..

[root@localhost /]# ls -l | grep mysql

drwxr-xr-x 2 root root 4096 Nov 19 04:55 mysql

Oh and did I mention I am able to mount like this:

[root@localhost /]# mount /dev/sdb1 /mysql/

[root@localhost /]# cd /mysql

This is the line in my /etc/fstab file:

/dev/sdb1 /myqsl ext3 bind 0 0

I am basically very confused. Someone please clarify!


Solution

  • The bind option with mount is used to mount an already mounted directory to a new directory as well and after which the contents of the device can be accessed in both the directories. Here you are trying to mount a block device which is not mounted already. While using the bind option, you can only specify two directories, one of which contains an already mounted file system. Not a device node. You can change the fstab entry to

    /dev/sdb1 /myqsl ext3 defaults 0 0
    

    Other options like nodev can also be added to defaults if needed. Separated by comma.