Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Diskless Gentoo: Obseleting Redhat?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Davin
n00b
n00b


Joined: 13 May 2003
Posts: 45
Location: United States

PostPosted: Tue May 13, 2003 1:58 am    Post subject: Diskless Gentoo: Obseleting Redhat? Reply with quote

Personally, I stepped into my system administration job at the beginning of the year and only used Redhat on the company servers...but you'd better believe that the personal server I parked behind the dual-T1 was a Gentoo machine. However, as time passed by, my annoyance with the Redhat machines continued to grow daily; a simple DNS lookup takes about ten times as long on those boxes as it does on any of my Gentoo machines. I decided to get evil.

One of the important topics mentioned in the "rsync etiquette" thread was exporting your portage directory over NFS so that all of the machines on your local network share the same portage tree; obviously a great idea if you're managing a large volume of machines running Gentoo. That's one of the first things I decided on when I wanted to "obselete" the portability of Redhat in my office. The step I took further than that was making the use and generation of tbz2 packages the default behavior on all of these machines, since my network is almost entirely made up of PIII Poweredge servers. All of them share the same architecture, so not only am I lessening the load on the rsync servers with my NFS export, I'm also making it so that I can immediately install any package I've compiled on another machine...and ideally, I'm steering towards the point where I can instantly deploy Gentoo to any future server installations with a network-enabled GRUB floppy.

This sort of setup makes the use of Gentoo in an office environment much more preferable to Redhat in my opinion. Everything is already optimized the way you like it, and you can deploy your packages/installations just about as quickly as you could with RPM. Nevermind the fact that I never have to hunt for an install CD or look up the link for a RPM I'm missing. Heck, I don't even have to keep tabs on Redhat's errata pages anymore; rsync keeps most of my system cleanly updated, while the GWN keeps me posted on any critical security vulnerabilities.

Just thought I'd share some of my ideas with the rest of you. Comments? I'm considering making a document covering the process I'm currently using, but I've run into a few snags. I've included the list in case anyone's feeling particularly generous. I think I'm on to something here, but I need some people to fill in the pieces for me. Thanks for a great OS!

----

This is meant to give the curious a general idea of what I'm doing; step-by-step instructions will be provided in a document I'll write up later if I ever get this working to my liking. Feel free to contribute though.

My current plans for immediate Gentoo deployment involve the use of a DHCP server, a TFTP server, and an exported NFS share of a "master" portage tree. All three of these run on the same server for convenience. You'll also need to download and locally compile a copy of GRUB to have network support, since to my knowledge the current GRUB ebuild doesn't support this type of compile. (if it does somehow, please enlighten me!)

The general idea is this; you set up a TFTP daemon to serve the files you need for a network boot, typically a compressed kernel image and an initial ramdisk. The DHCP server is mainly for convenience, so that you can have your machines automaticly grab IP addresses when they boot. (if you were installing on multiple machines at once using the same IP would get quite messy) Your GRUB disk grabs its kernel and initrd over TFTP, and from there the fun begins.

In theory.

This is where things get a little tricky; we need a base filesystem to begin building our Gentoo system on, and there's no way we're cramming all of that into a tiny initrd; it simply isn't practical. Instead of reinventing the wheel, we'll extract the contents of the latest Gentoo LiveCD and make that accessible over NFS. Sounds good in theory, right? Next problem.

The "guts" of the LiveCD are contained in a compressed loop filesystem by the fitting name of livecd.cloop. My efforts to extract the files locally were mildly painful, and in the end I simply booted up another machine on the network with the LiveCD, set up a rsync server, and yanked the files over to my master machine. If someone could write up a relatively painless way of doing this locally, I'd be rather thankful.

Next problem: once we've got these files extracted and exported over NFS, we need to be able to mount this as our NFS root. Unfortunately, under menuconfig the option to compile root NFS support into the kernel is strangely missing, and if I manually edit it into my .config file my kernel won't compile. In short, as far as I can tell this feature is broken. Help?

Failing in that, we have one last shot; we use an initrd with network tools preloaded to bring up the network interface, and remount the exported LiveCD to root. I found myself lacking the time to make my own initrd from scratch so, again, I borrowed from the latest Gentoo LiveCD. You need loopback support compiled into your kernel or as a module, and for the one or two forgetful people out there ext2 is also a must; copy the initrd to your local filesystem and rename it to initrd.gz. gunzip initrd.gz, and type the following:

mkdir /mnt/image
mount -o loop -t ext2 initrd /mnt/image

Now you can poke around in the contents of the initrd. However, you'll immediately notice the lack of networking programs. You can tweak /linuxrc of the ramdisk as much as you want (this is the script that's run by default in an initrd), but even if you were to copy the network modules over from the LiveCD and toss in ifconfig, you'd run into another problem of mine; I've never run across anything like this before, but any binaries that I copy to this initrd refuse to execute if I boot off of it. I threw a few 'ls' checks into the linuxrc to make sure the files were there at boot time. They were there, but for some reason they simply wouldn't run at all. Without some way of being able to up the network from here, we won't be able to mount the NFS "LiveCD" on the master server from an initrd boot.

In short, I'm stuck. Any help finishing what I've started would be greatly appreciated. Here's the rest of what needs to be done from where I left off: make $PKGDIR point to the package directory on your exported portage tree. Throw together a script to automaticly install your portage system, making sure to run emerge with the -bk options. This creates tbz2 installation packages from your compiles if they don't already exist, and if they do exist already, those packages are used without a compile job. Your first install would need to be compiled from the stage tarball of your choice, but all machines after that would theoreticly install at warp speed. I suggest setting up an alias on all of your machines to run with the -bk options by default, so that any "new" packages on the network generate a tbz2 which gets stored on the network.

I know I didn't cover every little detail, but this provides a place for you to get started in making a tbz2 repository for your network. However, remember one important thing! This method is only practical if you're running many machines of the same architecture, and attempting to deploy this method to a machine running a different architecture could be met with disasterous results; not only would your pre-built packages probably not run on this machine, any packages THAT machine builds would introduce packages of a foreign architecture to the same repository that your umpteen-hundred working computers use. I provide this method as a convenience to people who wish to make Gentoo more attractive in a business environment; use this at your own risk!
Back to top
View user's profile Send private message
Sniet Pot
n00b
n00b


Joined: 25 Feb 2003
Posts: 19
Location: Haarlem

PostPosted: Tue May 13, 2003 2:46 pm    Post subject: Reply with quote

Gentoo works great for diskless clients.

I am setting up a box at home as a media player. And it works great. In this thread I have put down some quick instructions on how I have put it up:

https://forums.gentoo.org/viewtopic.php?t=46268

Only problem is when shutting down the machine. The netmount script want's to unmount all the NFS partitions. This won't work for the root partition, and then the scripts barfs.. I still have to fix that.
Back to top
View user's profile Send private message
Davin
n00b
n00b


Joined: 13 May 2003
Posts: 45
Location: United States

PostPosted: Tue May 13, 2003 5:57 pm    Post subject: Reply with quote

Sniet Pot wrote:
Gentoo works great for diskless clients.

I am setting up a box at home as a media player. And it works great. In this thread I have put down some quick instructions on how I have put it up:

https://forums.gentoo.org/viewtopic.php?t=46268

Only problem is when shutting down the machine. The netmount script want's to unmount all the NFS partitions. This won't work for the root partition, and then the scripts barfs.. I still have to fix that.


Have you or someone else bugged that yet? Sounds like a simple check for root NFS partitions should be added to netmount. Thanks for the link, but what kernel version did you use? As stated, my gentoo-sources package didn't include the ability to support root NFS in menuconfig. Which sources did you use?
Back to top
View user's profile Send private message
jlg
Guru
Guru


Joined: 31 May 2002
Posts: 360
Location: Montreal, CANADA

PostPosted: Tue May 13, 2003 6:01 pm    Post subject: Reply with quote

this is how I would do it.

all systems with pxe enabled network cards!
use pxelinux with dhcp and tftp to share an initial OS to the servers to install.

prepare your kernel with the network drivers and nfs support compiled in. Then make a minimal linux that fits into an initrd.

The initrd os load into ram.
Then formats the local partitions on the system to install.
Then mounts the nfs drive on the server.
From there untar an initial gentoo image to the local drive.
execute lilo.
reboot with a fresh gentoo install. (wich mounts through nfs /usr/portage).

easy ;) and I have done that before ;)
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20053

PostPosted: Tue May 13, 2003 7:50 pm    Post subject: Reply with quote

Moved from Installing Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
mepython
n00b
n00b


Joined: 24 Jan 2003
Posts: 24

PostPosted: Wed Jun 04, 2003 1:48 pm    Post subject: I have exctly same problem Reply with quote

Davin,
I came across to exctly same problem. Do you find any solution to your problem. I cannot mount nfs no matter how much I try and ifconfig and dhcpcd are not recognize executable even though I can see them, view them.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat 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