 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

27th February 2011, 06:59 PM
|
 |
Banned
|
|
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183

|
|
[solved] Mount Raid-5 as /Multimeida/home for user home - Best Practice?
Hi guys, i've been fighting with this raid issue for a while now, and i think that i have it somewhat straightened out. So i've been googling on the best way to MOVE the /home directory to the Raid-5 as /Multimeida/home. The issue is, there's not many people who've done that, so i can't find good procedural information.
I'm well aware that you would normally edit fstab to say /home is on /dev/md127, but i don't want it to simply be /home, i want it to be /Multimedia/home, as it's going to store a lot more than just websites (they're under the /home directory). Is this possible? As far is i know, it has to be /home, which implies that it is not a subdirectory...
I also wonder if i need to update the per-user settings to point that to their home. I'm sure that there are other things that i still need to consider, which have not come to mind, so i'd appreciate anyone else's 2 cents in this matter. In the meantime, i'm going to keep googling this...
Another question i wonder about is: how does this work when you install a new version of your OS? In the installation you can select a DRIVE for /home, but not a subdirectory on that drive, and, besides, i sure as hell don't want it to overwrite the home directory anyway, so i really wouldn't even want /home to be installed at all...
Thanx
Last edited by Vector; 28th February 2011 at 05:09 AM.
Reason: solved
|

27th February 2011, 08:15 PM
|
 |
Registered User
|
|
Join Date: Jun 2008
Location: Russia
Age: 25
Posts: 515

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
You can change your users home dir with "usermod" (I don't know where to change default home location)
Quote:
|
Another question i wonder about is: how does this work when you install a new version of your OS? In the installation you can select a DRIVE for /home, but not a subdirectory on that drive, and, besides, i sure as hell don't want it to overwrite the home directory anyway, so i really wouldn't even want /home to be installed at all...
|
You can type mount location by hand and it will be created automatically.
Quote:
|
I also wonder if i need to update the per-user settings to point that to their home.
|
Seems to me you will had to do it. (it can be done with simple script)
|

27th February 2011, 08:32 PM
|
 |
Banned
|
|
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
Quote:
Originally Posted by Keldorn
You can change your users home dir with "usermod" (I don't know where to change default home location). Seems to me you will have to do it. (it can be done with simple script)
|
Well i was aware of the usermod command to edit the path to their home folder, but i guess what i meant was "does this also update the relevant environment variables, etc, or will that have to be done separately?".
Quote:
Originally Posted by Keldorn
You can type mount location by hand and it will be created automatically.
|
This is the part that i'm afraid of. I never noticed that you can create one by hand, so that's cool; but when you say "it will be created automagically", does that mean it will overwrite the destination path? If so, that's what i DON'T want.
You see, i want it to KEEP the files and folder's intact --or rather, LEAVE them alone, for the home directory on the next install, so that all of the data is still there. Does that make any sense?
In other words, under /home, i currently have *.com folders AND the "vector" folder (for me). So, on the next install, when i initially create the home mount point, i don't want it to overwrite the existing HOME directory; i want it to just USE it. I'm pretty sure that it won't modify it if you do not check the "format" option, but there may be other things that it may do which would be undesirable, so i wonder if anyone knows of anything else that needs to be considered.
Also, when you create the initial user account (vector), i don't want it to overwrite the existing USER home directory either; i just want it to USE it.
Is that how it already works, or will i have to make special preparations for that?
And besides all of that, what would the procedure be to convert the mount point for the current installation? EG, normally it would be /dev/md127 /home ...; but in this case, would it be something like /dev/md127/Multimedia/home /home ..., because that doesn't seem like it would work.
Or, would it be:
/dev/md127 /Multimedia ...
/Multimedia/home /home ...
which also makes no sense...
Thanx
Last edited by Vector; 27th February 2011 at 09:09 PM.
|

27th February 2011, 09:31 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,149

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
You will have to give the proper SELinux label to the new home filesystem.
|

27th February 2011, 09:53 PM
|
 |
Banned
|
|
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
That's true too. I always do this, since it's a web root:
chcon -Rc -usystem_u -robject_r -thttpd_sys_content_rw_t /home
|

28th February 2011, 03:52 AM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,149

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
Quote:
Originally Posted by Vector
That's true too. I always do this, since it's a web root:
chcon -Rc -usystem_u -robject_r -thttpd_sys_content_rw_t /home
|
Wrong thing to do. That gives apache access to everything any user does. And can create anything as well.
A good home for trojans, as the web server can update the users .profile.
No privacy whatsoever.
No security either.
|

28th February 2011, 04:18 AM
|
 |
Banned
|
|
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183

|
|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
Well, there's no users on this system except for me, and i don't store any files in my user folder (i use the multimedia folder / drive for that). As far as editing the .bash_profile, apache doesn't access my user directory being there's no virtual host that maps to it. I'm the only user folder under /home, the rest are websites.
AFAIK, that's how large hosts have their setup, right? If not, perhaps i can solved this raid mounting another way, eg:
in /etc/fstab:
/dev/md127 /Multimedia ext4 defaults 0 0
then in httpd.conf:
DocumentRoot /Multimedia/http
That would work as well, because then there would be nothing i care to save on the main system drive --if i lose it all, screw it, i'll just reinstall; but i'd like to be setup the way the pro's are; and as far as i've seen, that's how it's done (at least, on the servers i've leased).
=== update ===
I've decided to take my own advice, and use the forementioned layout in this post. It greatly reduces administration and maintenance, AND eliminates the issue of the nature of this thread, altogether.
FWIW to those of you running an email server, i plan to do the same with the email directory, but have in under /Multimedia/mail rather than /Multimedia/http/domain.tld/mail, this way apache:admins can own the entire folder tree for web docs, and vmail:vmail can own the entire folder tree for mail.
So, for clarification:
websites will have this structure:
/Multimedia/http/domain.tld [/main or /subdomain] (i never call a folder "public_html", as, it is, by its very nature, both "public" and "html", so the only issue for naming convention would be "what subdomain are we serving?", and for the main domain, it would simply be "main")
and email will have this structure:
/Multimedia/mail/domain.tld [/username] (i was torn between .../smtp/... and .../imap/...; but because it will serve both, it's more suitable to just call it .../mail/...)
It just makes more sense this way. /home is just simply "/home". If i lose it, oh well; who cares. There's no more issue here.
So, in conclusion, this thread is not solved because the question has been answered, but because it has been eliminated and considered poor planning to begin with. It's better to rethink your server folders layout than to challenge the FHS
Thanx @jpollard and @Keldorn
Last edited by Vector; 28th February 2011 at 05:11 AM.
|

1st March 2011, 02:37 AM
|
 |
Banned
|
|
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183

|
|
Re: Mount Raid-5 as /Multimeida/home for user home - Best Practice?
FWIW, i decided to go with changing my layout to having my servers' / services' data directories (their /var, or /spool, or the equivalent) under /Multimedia/servers, and the rest of my folders under /Multimedia.
I knew it was going to be a pain in the butt getting the new setup to work with the services configs AND with selinux, so i made an article about how i did it, and got it to work with selinux:
http://thesocialexpo.com/?a=WCMS_Art...0693119&page=1
It may not be perfect, but it works for me, and it may help others, especially with the selinux parts... I was going to post it here, in the howtos, but the video alone is over 1 hour long, and the article is 3 pages long, so, eh...
I'm not having any issues with the raid any more, and i'm not having any issues with any of the 8 servers / services. I was nervous about the mysql service, but it all worked out in the end. I'm just ecstatic to have all of my data directories for all of my services on a raid now, let alone my other files and folders. It just FEELS good...
Thanx
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 02:46 (Wednesday, 19-06-2013)
|
|
 |
 |
 |
 |
|
|