LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to undo fstab edit (https://www.linuxquestions.org/questions/linux-newbie-8/want-to-undo-fstab-edit-715447/)

apatonz 03-30-2009 05:21 AM

want to undo fstab edit
 
Hi everyone,

I recently migrated to a new server with linux fedora 9 Everything was going swimmingly during set-up when I had an error message that Virtualmin could not start because it was not configured to work with SuExec. I googled the web and found a solution which was to edit the fstab file adding: /var/www /home none bind 0 0. On reboot Virtualmin worked and all seemed well until I tried to sftp or sh as a user not having the right permissions. I put SELinux in 'permissive' mode for awhile to see if that helped but when it made no difference I put it back to 'enforcing' and now all the sites have gone down and I am getting root errors in the log files. Now SELinux is back to being in permissive mode so my clients can get their websites and email.

I feel all these problems are from me editing the fstab file, so I removed the line I put in, rebooted but all the sites went down again, including losing all the files in the home directory. I had to put the line back in the fstab file to get httpd back up and working.

I am so frustrated that I feel I should reinstall and start again, this time not touching the fstab file. Before I go to that monumental task, does anyone know if I can umount the fstab file without losing all the files in the home directory?

Thank you so much in advance.

pixellany 03-30-2009 05:35 AM

Welcome to LQ!!

I'm not sure what you mean by "unmount the fstab file". fstab is required to tell the system what partitions (filesystems) to mount at boot time.

i92guboj 03-30-2009 05:41 AM

And in any case, even if I can't understand your post completely, by the sound of it you have just messed up the permissions in one or another way. Whatever you added in fstab shouldn't be your problem, since it was just a line that you just added and removed.

I have no idea what to suggest because I have no idea of the initial setup, and I have no idea either of what did you exactly do with it to change it's permissions.

malekmustaq 03-30-2009 05:56 AM

apatonz:

1)
your question:
"Before I go to that monumental task, does anyone know if I can umount the fstab file without losing all the files in the home directory?"

BTW, 'umount' is a command to unmount "file systems" and fstab is a plain configuration file not mountable either as byte or block. If you want to 'disable' fstab you may just rename it, but then your important filesystems like /, proc, swap shall not be mounted automatically. You'll have more problems then than what you face currently.

2)
you did:
"I feel all these problems are from me editing the fstab file, so I removed the line I put in, rebooted but all the sites went down again, including losing all the files in the home directory. I had to put the line back in the fstab file to get httpd back up and working."

So, when you did it were the files in /home directory restored or recovered after that? Please tell us more.

Sometimes you don't need remove a line from fstab, simply commenting it will do the exclusion (it will not be read).

BTW, httpdaemon is launch through the init.d scripts (or rc.d) it runs behind the scene with or without fstab editing.

If you apply the trick in fstab, mounting /var/www /home none bind 0 0 you may add users options into the line so that it will be accessible to your username and your clients'. Remember that in modern linux kernels where d-bus runs automatically we sometimes face problems on "permissions" either from the messagebus itself or from the mounted points. Dbus respects fstab, so you may specify the user privileges including rw into the fstab line. Try check your permissions from both.

Also, check that the network users are "members" of certain "group" that has access to both messagebus and shared files.

Goodluck.

Hope this helps.

apatonz 03-30-2009 06:13 AM

Hello

I now clearly understand that I didn't kill the server with my fstab line; I just need to add users to that line. I will read about fstab to see how I accomplish that.

For some reason all the home files are now chmod 755 ... something I didn't do and so it might be a separate issue. When I reverted them back to chmod 644 the sites went down again!! Also I am not happy that I can't use SELinux, which I used without a hiccup on my last server for a couple of years.

Thanks so much to all that replied, especially Malekmustaq for your indepth reply.

apatonz 03-30-2009 06:14 AM

btw ... Yes all the files in the /home directory came back when I reinstated the line in fstab

i92guboj 03-30-2009 06:22 AM

Quote:

Originally Posted by apatonz (Post 3492387)
btw ... Yes all the files in the /home directory came back when I reinstated the line in fstab

I don't know what were you exactly trying to fix with that line. What that line does, actually, is to bind a given location A in your fs to another given location B, so B will have inside the same things you can reach in A. When you unmount something nothing is lost, you just unlink something from your fs. Just mount it again to gain access again.

You should really learn the basic of mount/umount, chmod and a few other things if you are going to be administering a server, otherwise I predict a dark future for your server. Randomly throwing lines that you see around in a forum into critical system files without actually understanding what do they do is a bad thing (tm).


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