[mythtv-users] Multiple diskless frontends off one image

diespambox at gmx.net diespambox at gmx.net
Fri Mar 18 09:14:55 UTC 2011


Robin Gilks <g8ecj at gilks.org> wrote:
> Greetings all
> 
> I want to add another frontend, a second diskless Ztoac ION m/b. I'm
> currently doing a diskless network boot (keeps the noise down) and would
> like to do the same again for the new frontend which is identical, in
> hardware terms anyway, but without having to maintain another 2G of image
> on the main backend/server. Disk space is not the issue, keeping things in
> sync is!!
> 
> I would guess I'd need to have separate /var, /tmp and maybe /etc and
> /home directories with /usr, /sbin, /opt, /mnt and /lib as common ones.
> Does this sound reasonable and just how do I do it? (I'm sure someone here
> has done it before!!). Something has to get the mounts in the right order
> during boot so I'm hoping this is a wheel I don't have to re-invent :)
Hi,
im using a netbooted gentoo, everything except the home directories is
the same for both frontends. Both Frontends use the same user so i'm
simply mounting different nfs shares to /home/mythfrontend. Any other
folders which requiere rw are mounted to tmpfs. 
The init script is a bit ugly and you could probably do it nicer with
unionfs or something similar... but it's working...


I give the kernel this skript in the init= parameter:

#!/bin/bash
 ### create ramdisks ###
 echo "creating ramdisk for /tmp"
 mount -n -t tmpfs tmpfs /tmp

 echo "creating ramdisk for /var/lib/init.d"
 mount -n -t tmpfs tmpfs /var/lib/init.d
 echo "creating ramdisk for /var/lib/xkb"
 mount -n -t tmpfs tmpfs /var/lib/xkb

 echo "creating ramdisk for /var/lib/dbus"
 mount -n -t tmpfs tmpfs /var/lib/dbus


 echo "creating ramdisk for /var/log"
 mount -n -t tmpfs tmpfs /var/log

 echo "creating ramdisk for /var/run"
 mount -n -t tmpfs tmpfs /var/run

 echo "creating ramdisk for /var/lock"
 mount -n -t tmpfs tmpfs /var/lock

 echo "creating ramdisk for /var/cache/hald"
 mount -n -t tmpfs tmpfs /var/cache/hald

 mkdir -p /var/run/lirc/
 mount -n -t tmpfs tmpfs /var/run/lirc/

 echo "creating ramdisk for /root"
 mount -n -t tmpfs tmpfs /root
 ### / ###

 echo "ramdisk for dhcp-client"
 mount -n -t tmpfs tmpfs /var/lib/dhcp

 ### create ramdisk for /etc ###
 echo "saving /etc from NFS-Mount"
 cd /etc && tar cf /tmp/etc.tar *


 echo "creating ramdisk for /etc"
 mount -n -t tmpfs tmpfs /etc

 echo "populating /etc"
 tar xf /tmp/etc.tar -C /etc
 rm /tmp/etc.tar
 ### / ###

 echo "Mounting NFS Home"
 MAC_ETH0=`ifconfig |grep HWaddr| sed s/.*HWaddr\ //`
 echo "found MAC: " $MAC_ETH0 
 MOUNT_OPTS="rw,intr,async,nfsvers=3,bg,actimeo=0,tcp"
 echo "192.168.1.99:/var/gentoo-netboot/homes/home-${MAC_ETH0} /home nfs $MOUNT_OPTS 0 0" >> /etc/fstab

exec /sbin/init </dev/console >/dev/console 2>&1



More information about the mythtv-users mailing list