Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr in NFS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
cvelasquez
n00b
n00b


Joined: 03 Feb 2007
Posts: 9

PostPosted: Sat Jul 21, 2007 10:29 pm    Post subject: /usr in NFS Reply with quote

Hi!, I want to make an installation using only strictly needed disk space. Thus, I want to have one /usr directory in a server and then mount it in the clients (instead of only /usr/portage, for example). That'd really save me a lot of disk space, but it's not that easy, is it? If I do that then I'd have to mount almost everything in NFS (/etc, /opt, etc), and that'd be a diskless installation (a solution which doesn't fit my network installation). Am I only imagining that is more complicated that mounting /usr? If it isn't the case, can someone help me designing and ejecuting? Please tell me if it's possible without falling back to rootless installations (pls note that what I want to do is to share files, not processing power with a XDMCP server, for example).
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Sat Jul 21, 2007 11:32 pm    Post subject: Re: /usr in NFS Reply with quote

cvelasquez wrote:
but it's not that easy, is it? If I do that then I'd have to mount almost everything in NFS (/etc, /opt, etc), and that'd be a diskless installation


Why do you think that?

I'm pretty sure all you will have to do is add an entry to fstab.
Back to top
View user's profile Send private message
cvelasquez
n00b
n00b


Joined: 03 Feb 2007
Posts: 9

PostPosted: Sat Jul 21, 2007 11:54 pm    Post subject: Re: /usr in NFS Reply with quote

no_hope wrote:
cvelasquez wrote:
but it's not that easy, is it? If I do that then I'd have to mount almost everything in NFS (/etc, /opt, etc), and that'd be a diskless installation


Why do you think that?

I'm pretty sure all you will have to do is add an entry to fstab.


Well I'm pretty sure it's not all I have to do. I'm thinking about portage managing files somewhere else than in /usr (like /etc, /var/lib, /opt, etc). I could easily work out the /opt directory problem by moving (with portage) everything to /usr, and I could make a script to sync /etc, for example. But I need to be sure that it's possible and that it's not too complicated, because if it requires 24 hours a day during a week to do everything... maybe I should give away 2GB.
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Sun Jul 22, 2007 12:46 am    Post subject: Reply with quote

If you just want to save some space, I don't see why just adding an fstab entry is insufficient. Though you might want to be careful with AUTOCLEAN.

If you want all the involved machines to mirror each other configuration-wise (e.g. you want packages emerged on one machine to automatically become available on the rest), then yes, you have to mount pretty much everything or set up a bunch of scripts to sync files. The complexity of the script solution depends on details of what you want to do.

In any of these cases, diskless installation is not necessary.

I get a feeling I'm not helping. Do you have a specific concern you worry about? With an example preferab
Back to top
View user's profile Send private message
cvelasquez
n00b
n00b


Joined: 03 Feb 2007
Posts: 9

PostPosted: Sun Jul 22, 2007 2:05 am    Post subject: Reply with quote

no_hope wrote:
If you just want to save some space, I don't see why just adding an fstab entry is insufficient. Though you might want to be careful with AUTOCLEAN.

If you want all the involved machines to mirror each other configuration-wise (e.g. you want packages emerged on one machine to automatically become available on the rest), then yes, you have to mount pretty much everything or set up a bunch of scripts to sync files. The complexity of the script solution depends on details of what you want to do.

In any of these cases, diskless installation is not necessary.

I get a feeling I'm not helping. Do you have a specific concern you worry about? With an example preferab


One by one: if I just mount /usr in several computers, the installation won't be clean. Surely I'll be able to execute programs in /usr/bin, but I don't want something messed up like that, because portage manages files beyond /usr. What I want is to have one server with every program any client would ever use. I want to install the programs there and mount with NFS the needed directories in the clients, so I install once and execute everywhere. What I want to know, is if this is possible without diskless installations (you answered no, thx), and how should I do it (which directories to mount, etc).

I could, for example, have the server's /usr directory shared with NFS and manage only minimum software in the clients, then mount server's /usr in some /usr/domain directory (or anything like that) and then modify PATH... but what about shared libraries? It should work ok, but I'm not sure and I wonder if someone can tell me.
Back to top
View user's profile Send private message
embobo
Guru
Guru


Joined: 19 May 2003
Posts: 311

PostPosted: Sun Jul 22, 2007 3:53 am    Post subject: Won't work Reply with quote

Mounting /usr won't work unless you guarantee all systems have the same packages and the same use flags. That would be hard to do because you couldn't emerge the packages on the clients.

Disk is cheap. Buy some more.
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Sun Jul 22, 2007 1:32 pm    Post subject: Reply with quote

let me try to give one more shot

I think what you really want to do is just image your nodes, as portage isn't meant for distributed package management. Taking and deploying an image can be done in under 20 minutes, but that means you would need to have a master node.

If you want all nodes to be equal and mirror each other (i.e. emerge on any machine effectively installs a package on all machines), I would recommend going diskless. Though you don't have to, I think that would make things easier, as I don't think you will gain much from nodes being able to boot on their own.

If you want to do the latter and mount as few directories as possible without going diskless.

bin -- nfs mount
boot -- local
dev -- local
etc -- nfs mount, note that by definition etc contains host-specific config files. you may have to play tricks if you want that dir shared. Whether you will run into difficulties depends on your setup. If all machines have identical hardware you should be fine.
home -- depends, probably nfs mount
lib -- local (*)
media -- local
mnt -- local
opt -- local
proc -- local
root -- local
sbin -- local (*)
sys -- local
tmp -- local
usr -- nfs mount
var -- local, assuming you only emerge packages on one master machine. Otherwise, nfs mount /var/db /var/lib/portage. Depending on your setup you might want to nfs mount more directories in /var/lib/. You could mount /var/lib but then you will run into problems because init scripts will see state from other machines.

* - depending on your setup you might have mount these or make links to files inside on the nfs server.
Back to top
View user's profile Send private message
cvelasquez
n00b
n00b


Joined: 03 Feb 2007
Posts: 9

PostPosted: Mon Jul 23, 2007 2:25 pm    Post subject: Reply with quote

thx for the answers

embobo, I also want to decrease mantaining time, not only disk space.

nohope, I want the latter, but I think it's too "dirty", I want it to be consistent.

Can't I instead mount the master / directory and then modify the PATH? Or It'd need a chroot?
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Mon Jul 23, 2007 4:22 pm    Post subject: Reply with quote

cvelasquez wrote:
Can't I instead mount the master / directory and then modify the PATH? Or It'd need a chroot?


PATH isn't the only environmental variable you will have to modify. Pretty much everything in /etc/env.d will have to be modified. Probably other stuff too. And then you will have to deal with all the apps out there that have paths hard-coded.

chrooting will work better but you may still end up with inconsistent state unless you are careful. For example, you may run into trouble controlling daemons started outside the chroot from chroot because their saved state may be inaccessible. I am thinking about init.d scripts that save their stuff in /var.

If you are OK with only using portage for package management you could just setup a cron job and a small script to synchronize world files and leave the rest to emerge. Or, write a wrapper around emerge to make that happen automatically. If you do that, adding an entry in fstab really is all you have to do (I think :))

I still think imaging is a better solution though. Are you the only person who has root in your setup?
Back to top
View user's profile Send private message
cvelasquez
n00b
n00b


Joined: 03 Feb 2007
Posts: 9

PostPosted: Mon Jul 23, 2007 5:59 pm    Post subject: Reply with quote

thx nohop, but what is imaging, and how can I use it?
Back to top
View user's profile Send private message
no_hope
Guru
Guru


Joined: 23 Jun 2003
Posts: 482

PostPosted: Thu Jul 26, 2007 9:18 pm    Post subject: Reply with quote

cvelasquez wrote:
thx nohop, but what is imaging, and how can I use it?


Basically you take an image (e.g. by making an archive of the file system) of one computer and deploy (e.g. unpack the archive) on another machine. The idea being that you make a group of computers mirror images of another machine. This has the potential to dramatically simplify system administration, but offers no disk space savings.

For example, suppose you just upgraded KDE to 3.5.7 on one machine. You could then take the image of that machine and deploy it to all others, making them exactly like the machine with the new KDE. Or, you could have a (cron) script that could do that automatically. The amount of time imaging process can vary dramatically and usually requires a reboot, so you probably would want to do it every night.

In Windows environment I've used imaging system by Altiris. For Linux there is http://www.partimage.org/ but I've never used it. I usually only use a bunch of ad-hoc scripts to do the job.
Back to top
View user's profile Send private message
augury
l33t
l33t


Joined: 22 May 2004
Posts: 722
Location: philadelphia

PostPosted: Sun Jul 29, 2007 1:25 am    Post subject: Reply with quote

rsync is also used to sync systems. Search rsync.

The unix/linux directories were created with the system's perspective.

System independent:

bin/
sbin/
lib/
usr/
opt/

System dependent:

root/
home
sys/
proc/
var/
tmp/
etc/

sbin and bin are required to init and sh the system to a console.
But portage only really installs into etc (protected) and var. AFAIK there are no ports that care if anything is in there or not, at least not etc. Parts of var could be copied into a ramfs /var at boot. I can't imagine it is anywhere as intensive or confusing as running portage all on a third party NFS. If you can't reduce the system down to eliminate the HDD it is really better to use the HDD. Not having the NFS available knocks down everything. Portage can grind on this type of system pretty hard.

But for thin-clients that run maybe a 1gig of flash and a hardened system on NFS that doesn't run portage except for managed installations -- I think this is very doable. Still there is the question "why bother?", especially considering the price of gigabit routers which are required to beat a $60 ide HDD. Many networks run select software from NFS. Usually because of licensing.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum