Page 1 of 1

hostshare double mounted

Posted: 4. Jul 2012, 15:42
by edstevens
VBox 4.1.18
Oracle Linux 5.7 64-bit

After creating the vm and installing Guest additions, I created a hostshare, selecting 'permenant', but NOT selecting automount. I do not select automount primarily because of the limited access permissions it comes with.

Next I add an entry for the host share in /etc/fstab (last line)

Code: Select all

[root@vblnxsrv02 ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   size=2000m     0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
hostshare               /hostshare              vboxsf  defaults  0 0

[root@vblnxsrv02 ~]#

and restart. At this point everything appears to be fine, and works as expected. The host share is mounted to the directory I specified, any user can access it. But then I just happened to notice this:

Code: Select all

[root@vblnxsrv02 ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      19362272   2839036  15523812  16% /
/dev/sda1               101086     23319     72548  25% /boot
tmpfs                  2048000         0   2048000   0% /dev/shm
hostshare            609667412 282286892 327380520  47% /hostshare
hostshare            609667412 282286892 327380520  47% /hostshare

[root@vblnxsrv02 ~]#
two entries for /hostshare?
And watch this:

Code: Select all

[root@vblnxsrv02 ~]# ls /hostshare
1-gatherdata.sql             6-add_redo.sql      envorcl.cmd    plus.log

[root@vblnxsrv02 ~]# umount /hostshare

[root@vblnxsrv02 ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      19362272   2839036  15523812  16% /
/dev/sda1               101086     23319     72548  25% /boot
tmpfs                  2048000         0   2048000   0% /dev/shm
hostshare            609667412 282286900 327380512  47% /hostshare

[root@vblnxsrv02 ~]# ls /hostshare
1-gatherdata.sql             6-add_redo.sql      envorcl.cmd    plus.log

[root@vblnxsrv02 ~]# umount /hostshare

[root@vblnxsrv02 ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      19362272   2839036  15523812  16% /
/dev/sda1               101086     23319     72548  25% /boot
tmpfs                  2048000         0   2048000   0% /dev/shm

[root@vblnxsrv02 ~]# ls /hostshare
[root@vblnxsrv02 ~]#
What's going on here, with /hostshare being ... what would you call it .. "double mounted"?

Re: hostshare double mounted

Posted: 4. Jul 2012, 15:50
by Perryg
Instead of using fstab have you tried rc.local?

Re: hostshare double mounted

Posted: 4. Jul 2012, 16:31
by edstevens
Perryg wrote:Instead of using fstab have you tried rc.local?
Never heard of it, but I googled it, then tried it. That works, so I'll go with it. But it seems a bit of a hack to get around something fishy going on with the "proper' use of fstab. Any explanation for what I was seeing there?

Re: hostshare double mounted

Posted: 4. Jul 2012, 16:45
by Perryg
Actually using fstab for the VBox shared folder caused an issue kind of what you are seeing. fstab loads before the VBox drivers and this caused the guest to try and load a second time after the first failed due to missing drivers. Since rc.local is run at a later time it stopped having the guest repeatedly try to load the share until the drivers were actually loaded.

There are a few Linux operating systems that do not have rc.local and you can either add it or use fstab but as you see it may show irregularities.

Re: hostshare double mounted

Posted: 4. Jul 2012, 16:58
by edstevens
Perryg wrote:Actually using fstab for the VBox shared folder caused an issue kind of what you are seeing. . . . as you see it may show irregularities.
Yet another "irregularity" ... :(
OK, at least I got it working, and understand the issue. Thanks for the help.