LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Automounting directory in fstab troubles (https://www.linuxquestions.org/questions/linux-newbie-8/automounting-directory-in-fstab-troubles-515770/)

cjtemple 01-02-2007 10:11 PM

Automounting directory in fstab troubles
 
I have three directories I would like to mount when the system boots up. I tried to add them in the fstab but I am having alot of trouble. The system keeps telling me that it is write-protected mounting read-only.

My fstab:
...
/var/www/html /home/username/WebServer none bind 0 0
/fileserver/ftp /home/username/FTPServer none bind 0 0
/fileserver/Projects /home/username/Projects none bind 0 0

Out of desperation I set each of the original directories to root:root and 777. But that didn't help.

When I wait and do this from a terminal as root I have no problem.

One other unrelated curiosity that started well before all of this.
When booting I see
FATAL : ERROR acpi-cpufreq (lib/moduless/2.6.28-1.2798.fc6/kernel/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.ho) no such device.

Any hints on these?

*************************
System Config:
AMD 2400+
120 GB HDD 1
250 GB HDD 2
1 GB RAM

somnium desolo 01-03-2007 02:17 AM

Cpufreq controls throttling the processor, so it's primarily for laptops. That message should just mean cpufreq couldn't find a cpu that it can work with.
The other problem I'm afraid I don't know about. I've seen it before, on a PCLinuxOS .92 load, but I never fixed it before I changed distros.

mickyg 01-03-2007 07:26 AM

What are /var/www/html, /fileserver/ftp and /fileserver/Projects?

Are they just directories that you want a link, or shortcut if you will, to in home directory?? If so I don't think you can do that. Reading the fstab man page here it appears the first parameter in fstab needs to either be a block device, i.e. /dev/hda2 or an NFS filesystem sitting on a server.

Are you sure the /fileserver lines shouldn't be something like "fileserver:/ftp" instead of "/fileserver/ftp"??

If you just want a link to /var/www/html/ in your home directory use 'ln -s <src> <dest>', i.e. 'ln -s /var/www/html ~/WebServer'

cjtemple 01-03-2007 06:04 PM

Thanks Somnium, I go the acpi_cpufreq resolved I found a thread on another board talking about something similar that cleared up when he updated his kernel. I did that this evening and I am flying high with out the error.

Micky, I am still working on the mounting issue. I originally tried the softlink but I have chroot enabled on my ftpserver and I wanted to be able to access those locations from ftp. In that scenario the only thing I have found thus far is a bind.
You asked what are /var/....

from mount:
/dev/hdb1 on /fileserver ext3
/dev/hda2 on /var ext3

/var/www/html ofcourse is my Web directory
/fileserver/ftp is the root directory for the FTP Server
/fileserver/Projects is a directory I setup to store all of the software or graphics projects I work on.
And once I figure out how to do this properly I was going to setup a directory off of /fileserver for documents.

Thanks for help me with this one.

cjtemple 01-04-2007 07:17 PM

Well it took a little bit of time but I found it. To bind from one dir to another from fstab
Quote:

/original_location /new_location bind bind 0 0
Notice the bind in the spot for type. I found this in someones Jan 2003 change log. Google is a good thing! You just may have to dig for a little while.

fotoguy 01-04-2007 07:21 PM

First you need to get the mount points right before you worry about linking them to another directory:

/etc/fstab

Code:

/dev/hdb1    /fileserver    ext3    defaults    1  2
/dev/hda2    /var            ext3    defaults    1  2

Here'a a copy of my fstab to help you get an idea of how the fstab works:

Code:

/dev/hda3        swap            swap        defaults        0  0
/dev/hda5        /                reiserfs    defaults        1  1
/dev/hda6        /tmp            reiserfs    defaults        1  2
/dev/hda7        /home            reiserfs    defaults        1  2
/dev/hda1        /media/windozeC  auto        defaults        1  0
/dev/hda2        /media/windozeD  auto        defaults        1  0
/dev/cdrom      /media/hdb      auto        noauto,users,ro  0  0
/dev/fd0        /media/floppy    auto        noauto,users,rw  0  0
usbfs            /proc/bus/usb    usbfs      devgid=14,devmode=0660 0 0
proc            /proc            proc        defaults        0    0
sysfs            /sys            sysfs      defaults        0    0
devpts          /dev/pts        devpts      gid=4,mode=620  0    0
tmpfs            /dev/shm        tmpfs      defaults        0    0


cjtemple 01-04-2007 09:56 PM

Hey fotoguy,
I almost understand about the mounting points being correct. But is there something wrong with the way that I did the bind for those directories? If there is I have no qualms with changing it. I am no guru, I just know enough to be dangerous.

My current fstab:
Code:

LABEL=/                /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
LABEL=/fileserver      /fileserver            ext3    defaults        1 2
proc                    /proc                  proc    defaults        0 0
sysfs                  /sys                    sysfs  defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr/local        /usr/local              ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/var/www/html          /home/john/WebServer    bind    defaults,bind  0 0
/fileserver/ftp        /home/john/FTPServer    bind    defaults,bind  0 0
/fileserver/Projects    /home/john/Projects    bind    defaults,bind  0 0
/fileserver/Documents  /home/john/Documents    bind    defaults,bind  0 0


fotoguy 01-05-2007 08:23 PM

Quote:

Originally Posted by cjtemple
Hey fotoguy,
I almost understand about the mounting points being correct. But is there something wrong with the way that I did the bind for those directories? If there is I have no qualms with changing it. I am no guru, I just know enough to be dangerous.

My current fstab:
Code:

LABEL=/                /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
LABEL=/fileserver      /fileserver            ext3    defaults        1 2
proc                    /proc                  proc    defaults        0 0
sysfs                  /sys                    sysfs  defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr/local        /usr/local              ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/var/www/html          /home/john/WebServer    bind    defaults,bind  0 0
/fileserver/ftp        /home/john/FTPServer    bind    defaults,bind  0 0
/fileserver/Projects    /home/john/Projects    bind    defaults,bind  0 0
/fileserver/Documents  /home/john/Documents    bind    defaults,bind  0 0



OK I can see now what you are doing by your fstab, mounting a directory to another directory. Unfortunately I have never used bind in the fstab before, so I cannot say where this is the right or wrong way to go about it, nor have I mount two directories together.

But since your having read/write errors, when you mount to directories you now have permissions on both directories to contend with, plus mounting options that can also effect read/write on files and directories.

Since only root can create directories on the root filessystem /fileserver will have root as owner and group, and user john will be owner and what ever the group is that he is part of.

While root has complete control of the system, even the normal user
permissions can effect root. Since devices are usually owned by root, and the mount points are owned by root there is normally no problems with mounting. But now your trying to mount to a normal users home directory, the permissions difference maybe causing mount to mount only as read-only.

cjtemple 01-05-2007 10:34 PM

Actually everything is working since I added the bind type.
I had root add a subdirectory under "/fileserver" and then did a chown to the user on that subdirectory. So everything is golden now. Thanks for your help.

fotoguy 01-07-2007 03:21 AM

Good to hear it's all sorted out


All times are GMT -5. The time now is 03:08 PM.