Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Imaging a bunch of Macs -- any ideas?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
SignOfZeta
n00b
n00b


Joined: 12 Aug 2005
Posts: 63
Location: New England

PostPosted: Mon Jan 16, 2006 10:15 pm    Post subject: Imaging a bunch of Macs -- any ideas? Reply with quote

I'm working on a Gentoo Linux based cluster; as of right now, it's made up entirely of Power Mac G4's and one Cube. To make adding more nodes to the cluster simpler (and easily doable by the average man :-)), I want to create a disk image and store it on the server, and have nodes pull it down when instructed to install/upgrade themselves. That way, adding or updating a node is simple; here's the method that I thought up for imaging Macs:

1. The system will be told to restart and attempt a netboot by setting Open Firmware variables before rebooting, and it will netboot from the server a very minimal Gentoo installation, which will have just enough to let it do the below tasks and reboot (let's call this image protocol://master.cluster/images/netboot-ppc.img).

2. It will then download a disk image from the server, which contains a full, pre-packaged, ready-to-eat (:-)) Gentoo install (let's say, protocol://master.cluster/images/mac/ppc-G4.img.bz2), decompress it, and dd it to its hard drive.

3. As the hard drives in the nodes are all different sizes, resize_reiserfs will run and resize the root partition to stretch to the end of the disk (as root will be the last partition on the disk). This works quickly and easily with no arguments beyond the partition name; I used it on my home computer when migrating to a new drive. It's quick and painless.

4. /etc/conf.d/hostname will need to be updated. The system will be given a name based on its IP, as the server's DHCP server assigns IP's based on MAC's. For example, system 192.168.1.1 will be called Node001, and 192.168.1.129 will be Node129. I imagine awk, grep, sed, echo, and ifconfig can somehow do this.

5. Done! Reboot the system.

So how can I do this?
Back to top
View user's profile Send private message
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Tue Jan 17, 2006 3:16 am    Post subject: Reply with quote

Are you wanting to do this entirely over the network, entirely on cd, or cd/network?
Back to top
View user's profile Send private message
SignOfZeta
n00b
n00b


Joined: 12 Aug 2005
Posts: 63
Location: New England

PostPosted: Tue Jan 17, 2006 3:30 am    Post subject: Reply with quote

I would prefer to do this over just the network.
Back to top
View user's profile Send private message
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Tue Jan 17, 2006 5:25 am    Post subject: Reply with quote

I'm not too certain about the Open Firmware settings for network booting, but as to a general howto for network booting, you might check this out.
After you have the ability to boot the kernel and an initrd image, probably the easiest way to do the automation part is within a script that is executed prior to /sbin/init. For ideas as to what it might look like, you should check out the gentoo installer cd -- the 'linuxrc' file.
As to the hostname, I do believe there is a 'hostname' directive for dhcpd (from the dhcp ebuild). I'm not too sure how to have the system fetch it, but it might be worth looking into.
Back to top
View user's profile Send private message
SignOfZeta
n00b
n00b


Joined: 12 Aug 2005
Posts: 63
Location: New England

PostPosted: Tue Jan 17, 2006 6:25 am    Post subject: Reply with quote

Firstly, this won't work unless Open Firmware settings can be changed from within Gentoo. I know Mac OS X has an "nvram" command that will let root edit OF variables, including boot-path and netboot-specific ones. Without physical consoles hooked up, it may be difficult if not impossible to trigger a netboot and watch the boot process.

Rethinking this, all I really need is for dd and resize_reiserfs to write to a remote hard drive, if I can assign hostnames via DHCP. Something like a working version of this:
Code:
dd if=/images/G4.img of=192.168.1.1:/dev/hda
resize_reiserfs 192.168.1.1:/dev/hda4
reboot 192.168.1.1
Back to top
View user's profile Send private message
SignOfZeta
n00b
n00b


Joined: 12 Aug 2005
Posts: 63
Location: New England

PostPosted: Tue Jan 17, 2006 6:32 am    Post subject: Reply with quote

Second thought: I like the idea of diskless nodes. It makes it easier to apply changes system-wide and keep /tmp, /var/run, /var/lock, and /var/tmp on the local hard drives. I'll see what I can do with netboot.
Back to top
View user's profile Send private message
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Wed Jan 18, 2006 3:58 am    Post subject: Reply with quote

Wouldn't it be even easier to add the /boot partition to the hard disks too? Then you don't have to worry about all of the networking booting problems. As far as the downside I can see to that, if you wish to change the kernel version, you could use dsh, distributed shell ( http://www.netfort.gr.jp/~dancer/software/dsh.html ), and install the new kernel while all the systems are running at the same time.
Just an idea.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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