Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
W00t!!!!!! I converted my Gentoo sparcstation to be DISKLESS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
dogshu
Apprentice
Apprentice


Joined: 22 Jun 2003
Posts: 168
Location: New Haven, CT, USA

PostPosted: Sun Feb 08, 2004 3:23 am    Post subject: W00t!!!!!! I converted my Gentoo sparcstation to be DISKLESS Reply with quote

I have a SparcStation 20 that has been running Gentoo for a few months now. I have been wanting to set it up as my gateway/firewall/dns server/web proxy server, but most have hesitated for two reasons:

  • The hard drives in that machine are around 10 years old and bound to break
  • The hard drives in that machine are LOUD. I mean VERY LOUD


So, I got the idea of converting my Gentoo Sparc machine to be diskless. Of course, the first place I searched for the topic was the Gentoo forums, and I found this:
http://forums.gentoo.org/viewtopic.php?t=54293&highlight=diskless

Now my setup was different for a number of reasons:

  • The NFS server is an x86 box, and thus cannot build the system for the client
  • SparcStations do not support PXE boot (though they do support RARP boot)
  • I was not using the default ethernet interface for network boot


Now, I will tell you how I got this working (at least the parts that are different from the document above):

The server side configuration is very similar to the document I linked above, with the exception of using RARP instead of DHCP. Make the server-side directory, emerge tftp-hpa and set it up as directed. Instead of setting up dhcpd, emerge rarpd. Then try to do a "/etc/init.d/rarpd start"... it will give you instructions on how to configure it. Sorry, no in line code here, I figure if you're setting up a sparcstation to boot off the network you can figure that part out :).

Next, ignore all instructions about the bootloader. You are not going to be configuring a bootloader on either the server or the client (well, at least not a software bootloader).

Go ahead and set up NFS and your /etc/hosts.

NOW, here's where its vastly different. In the document linked above, he is presuming you are setting up a new x86 system. I am presuming you are setting this up on an EXISTING Gentoo sparcstation system, which has hard drives and which already has an existing Gentoo system. I actually think it would be easy to set this up with a new system, but I have not tried it myself, so I won't give you any advise on it. As a hint though, I would do the "2. Gentoo setup on the server" section from the above document on the client with /mnt/gentoo mounted from the server.

Boot to your existing Gentoo system on your sparcstation's hard drive. Since the system already exists, you can ignore all the initial Gentoo setup stuff. However you do need to recompile your kernel with the following options enabled:

  • TCP/IP networking
  • IP: kernel level autoconfiguration
  • IP: RARP support
  • NFS file system support
  • Provide NFSv3 client support
  • Root file system on NFS


NOW, here's another thing that's different. I know you're used to stripping vmlinux to fit in SILO's boot memory, as instructed in the gentoo-sparc-install document, but DON'T DO IT!!!! You won't be able to make the boot image if you strip vmlinux.

emerge mkinitrd. I know, I know, its masked... it worked for me, that's all I can tell you. :) Then run something like "mkinitrd initrd.img linux-2.4.24-sparc-r1", it will create a file called initrd.img (the second parameter is just for version information).

Now you have a file called vmlinux and a file called initrd.img. Now run something like "tilo -o tftp.img vmlinux initrd.img". That will create a file called tftp.img. tftp.img is the file you are going to be loading from the server at boot time.

Get the Gentoo system duplicated on the NFS server. The way I did this was to boot from a livecd on the sparcstation, mount the NFS server and the Gentoo partitions, "tar -cp" the gentoo system on the sparcstation to a tarball on the NFS server, then "tar -xp" in the exported directory on the NFS server. Sorry that's vague, I don't want to spend an hour talking about duplicating the filesystem.

Boy this is getting long... anyway I have an Sbus HME card in my sparcstation, which I'd prefer to be the network boot device rather than the onboard network device. To make it the default network boot device I went to the OpenPROM, did a "show-devs" which will display the paths of all relevant devices, and then a "nvalias net /iommu/sbus/path/your/device".

Now, try to "boot net". If it says something like "Didn't get ARP/RARP packet" go back and configure the RARP server correctly. If it doesn't say that, but it still doesn't work, then that's good!! That's what I intended. :)

Check the /var/log/messages (or similar file) on you NFS server... in.tftpd should have some error messages similar to "filename C0A80002.SUN4M not found". Unfortunately you cannot specify the filename to boot from the sparcstation, it is expecting a particular filename. And guess what? "C0A80002.SUN4M" (or whatever it says in your tftp log) is that filename! So link tftp.img to "C0A80002.SUN4M" (or whatever) in the appropriate place so that the sparcstation can get to it.

Now, go back to your sparcstation, and get to the OpenPROM. do a "setenv boot-device net" (make the network boot the default), and then do a "setenv boot-file ip=rarp root=/dev/nfs nfsroot=nfsserver:/path/to/system" (set the linux kernel command line arguments). If you don't want to make it the default right away, you can just run "boot net ip=rarp root=/dev/nfs nfsroot=nfsserver:/path/to/system" to try it out.

Now, if everything works, you can take all the disks out of the sparcstation and it will never know the difference! Make sure you change /etc/fstab so Gentoo doesn't try to mount the wrong filesystem (you may have to change /etc/mtab as well, I did).

If something isn't clear above, most likely its answered in the linked document, but feel free to ask me questions. I hope someone finds this useful!!! :wink:
Back to top
View user's profile Send private message
erol
n00b
n00b


Joined: 30 Mar 2003
Posts: 7
Location: Münster, Germany

PostPosted: Sun Feb 08, 2004 11:45 am    Post subject: Reply with quote

Can you strip the vmlinux after you created the image? Or no? Size of the netboot image does not really matter, or it does?

And a note for "C0A80002.SUN4M". It's basicly the IP of the netboot client converted to hex plus designated architecture (sun4m, sun4u). :)
_________________
running Gentoo with
AthlonXP 1800+, 512 MB -- Sun Ultra60 2x360 MHz, 256 MB -- Dell Notebook PIIIm 1.2GHz, 256 MB
Back to top
View user's profile Send private message
dogshu
Apprentice
Apprentice


Joined: 22 Jun 2003
Posts: 168
Location: New Haven, CT, USA

PostPosted: Sun Feb 08, 2004 9:38 pm    Post subject: Reply with quote

vmlinux isn't used after you create the netboot image, so it doesn't really matter what you do with that file afterwards. The netboot image (tftp.img as described above) is what you actually boot.

If you're going to be network booting the machine all the time, you probably want to get out of the habit of stripping the binary. If you are ever going to need to boot off of a hard disk, however, the stripped vmlinux is what you need.

I believe the reason the binary cannot be stripped is that the "tilo" network boot image creator requires some of the symbols that are stripped out to work properly.... at least it wouldn't work for me with a stripped vmlinux.

As far as I know, the size of the image does not matter. However, tilo automatically compresses both the initrd and the vmlinux, so in my case the network boot file is about a megabyte smaller than the stripped uncompressed kernel.
Back to top
View user's profile Send private message
AndreR
n00b
n00b


Joined: 28 Apr 2004
Posts: 14
Location: Portugal

PostPosted: Tue May 11, 2004 8:27 pm    Post subject: Reply with quote

Are you mounting a swap partition over NFS? If yes, is that stable?

Thanks,
Andre
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc 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