LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Fstab not taking a mount of a sub directory? (https://www.linuxquestions.org/questions/linux-networking-3/fstab-not-taking-a-mount-of-a-sub-directory-415342/)

Rufus330Ci 02-14-2006 11:03 AM

Fstab not taking a mount of a sub directory?
 
Hello again guys,

I seem to be hitting a brick wall on this one. I normally issue 2 mount --bind commands everytime I reboot my box and I thought I'd put it in /etc/fstab instead of 'manual labor'. Anyways the mount of a drive to 2 locations works just fine. I thought I would have been able to well actually you know what let me print some actual code out here because explaining it in words is confusing.

[root@rufusland etc]# cat fstab
/dev/hda1 / ext3 defaults 1 1
/dev/hda6 /home ext3 defaults 1 2
//comp2400/G\040DVD\040DRIVE /mnt/COMP2400\040DVD\040drive smbfs credentials=/etc/samba/auth.comp2400.administrator 0 0
//comp2400/E\040MP3\040Archive /mnt/COMP2400\040MP3\040Archive smbfs credentials=/etc/samba/auth.comp2400.administrator 0 0
//comp2400/STORAGE\040(D) /mnt/COMP2400\040Storage smbfs credentials=/etc/samba/auth.comp2400.administrator 0 0
//comp2400/E\040MP3\040Archive /var/www/html/wimpy/mp3 smbfs credentials=/etc/samba/auth.comp2400.administrator 0 0
//comp2400/STORAGE\040(D)/Pictures /var/www/html/e107_plugins/autogallery/Gallery smbfs credentials=/etc/samba/auth.comp2400.administrator 0 0
/dev/hdc /mnt/cdrom auto user,iocharset=iso8859-1,codepage=850,noauto,ro,exec,users 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,sync,codepage=850,noauto,exec,users 0 0
none /proc proc defaults 0 0
/dev/hda5 swap swap defaults 0 0

ok as you can see I'm mounting DVD drive, MP3 folder, and a Storage (D) folder remotely. Now I had a bind mount of the MP3 to my wimpy folder but that didn't work so I made it like above as a normal mount and that works, but MTAB and of course /autogallery/Gallery is empty it didn't mount... is that because I'm trying to reference a "subdirectory" Pictures of a filesystem that is getting mounted in this fstab? Do I have to put them in a certain order? I was trying to make this automated. I know the mount point and remote point exist because I type:

mount --bind /mnt/COMP2400\ Storage/Pictures /var/www/html/e107_plugins/autogallery/Gallery and it mounts...

If you guys have any idea how to do this or maybe I need to run a script on bootup, but I'm sure there is a reason this isn't working.

Thanks in advance, and if anything doesn't make sense or need more explaination please let me know.

--- Justin

bulliver 02-15-2006 04:23 AM

Quote:

Do I have to put them in a certain order?
Yes. You need to mount a directory before you mount a subdirectory...

I don't use samba, so I am unsure of this notation:
Code:

/mnt/COMP2400\040DVD\040drive
but I can tell you if this is your linux mountpoint it is invalid. The '\' character cannot be used as a path separator in UNIX, as it is a special delimiter. You must change the '\' to '/', and you must also manually create the /mnt/COMP2400/040DVD/040drive directories before you can mount anything to them...

Rufus330Ci 02-15-2006 08:45 AM

Quote:

Originally Posted by bulliver
Yes. You need to mount a directory before you mount a subdirectory...

The order I used seems to be correct if it starts from top to bottom. The only reused subdirectory is Storage and I mount the subdirectory Pictures 2 mounts below the main directory.


Quote:

Originally Posted by bulliver
I don't use samba, so I am unsure of this notation:
Code:

/mnt/COMP2400\040DVD\040drive
but I can tell you if this is your linux mountpoint it is invalid. The '\' character cannot be used as a path separator in UNIX, as it is a special delimiter. You must change the '\' to '/', and you must also manually create the /mnt/COMP2400/040DVD/040drive directories before you can mount anything to them...

The COMP2400 is a remote PC sorry if i forgot to mention that. Also the \040 is designated as a space when mounting. I'm was going to change them to Storage_(D) and DVD_Drive but the mounting seems to work using this notation in fstab. I haven't tried "mnt/COMP2400\ DVD\ drive" in fstab but from testing it does work at a prompt suprisingly. You did give a good point though stating the directories must be created first... I might try creating the subdirectory /Pictures inside of my COMP2400 Storage directory on the linux box and then let the subdirectory tree on the windows box put its Picture files into that directory in turn being created before the mount of the root directory was mounted in stab. I wonder if it will flag off to test it. If you think of anything else let me know.

Rufus330Ci 02-15-2006 01:20 PM

Actually I just figured something out here... I can't display these pictures on my site without setting them 777 and I don't really wanna give that kind of access to my personal files. So what I did was copy the 5618 pictures over to my /home/lid1111/Pictures folder and set chmod'd them 777 and then added this line to fstab: /home/lid1111/Pictures /var/www/html/e107_plugins/autogallery/Gallery none rw bind 0 0

Worked like a champ plus my files are nice and safe if someone wipes my files or changes them I got the original on the windows box.

I never did try the creation of the subdirectory a good lesson if anyone wants to see if that was the problem. Thanks again for your help bulliver.


All times are GMT -5. The time now is 02:33 PM.