Hi I'm trying to deploy diskless OpenSuSE clients at my workplace. The idea is to boot the computers via PXE and then load a complete OpenSuSE via NFS. Yet I tryed to build my own initrd and it works, sometimes and sometimes not :-(, especially some programms like Openoffice do not work. I'm sure that there may be an other possibility of booting opensuse via nfs using the existing initrd's of the opensuse project. I was wondering if anyone has done something similar yet or can anybody give me a hint. On google if found some hints to do similar things with fedora but in that case they used it for one computer only, but in my case I need serveral computers using the same resources an that means that all files on the nfs mus be readonly (especially lock and pidfiles must be independently on the machines). Greetings Benedikt Thelen -- Benedikt Thelen Via ospedale 7 6500 Bellinzona Zürichstr 81 8600 Dübendorf thelenb@student.ethz.ch
Hi, We are using opensuse and OneSIS to do something similar but for a linux cluster. Here is a link to oneSIS. http://www.onesis.org. Hope this helps. Rene On 10/16/06 5:14 AM, "Benedikt Thelen" <thelenb@student.ethz.ch> wrote:
Hi I'm trying to deploy diskless OpenSuSE clients at my workplace. The idea is to boot the computers via PXE and then load a complete OpenSuSE via NFS. Yet I tryed to build my own initrd and it works, sometimes and sometimes not :-(, especially some programms like Openoffice do not work. I'm sure that there may be an other possibility of booting opensuse via nfs using the existing initrd's of the opensuse project. I was wondering if anyone has done something similar yet or can anybody give me a hint. On google if found some hints to do similar things with fedora but in that case they used it for one computer only, but in my case I need serveral computers using the same resources an that means that all files on the nfs mus be readonly (especially lock and pidfiles must be independently on the machines).
Greetings Benedikt Thelen
--------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Benedikt Thelen wrote:
Hi I'm trying to deploy diskless OpenSuSE clients at my workplace. The idea is to boot the computers via PXE and then load a complete OpenSuSE via NFS. Yet I tryed to build my own initrd and it works, sometimes and sometimes not :-(, especially some programms like Openoffice do not work. I'm sure that there may be an other possibility of booting opensuse via nfs using the existing initrd's of the opensuse project.
Hi Benedikt I'm doing something similar - booting machines via PXE, but with root filesystem on a SAN connected via fibre. What you're trying to do should work perfectly fine.
but in my case I need serveral computers using the same resources an that means that all files on the nfs mus be readonly (especially lock and pidfiles must be independently on the machines).
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var. I've got a cluster that I boot using etherboot with /usr NFS-mounted read-only, and everything else on the local disk. /Per Jessen, Herrliberg -- http://www.spamchek.com/ - managed email security. Starting at CHF5.00/month/user. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var.
/var is not enough, you also need some client-writeable files in /etc and a writeable /media and /tmp (for X etc.). Our solution is a per-host writeable NFS mount for /var and /etc/local where we link all files from /etc to /etc/local that must be written by clients (this is special and requires some maintenance tools we developed for our distribution). /media is deployed as tmpfs which works fine. /dev is not a problem anymore since 10.1 now uses a tmpfs for /dev automatically. /tmp is a local disk partition. cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var.
/var is not enough, you also need some client-writeable files in /etc and a writeable /media and /tmp (for X etc.). Our solution is a per-host writeable NFS mount for /var and /etc/local where we link all files from /etc to /etc/local that must be written by clients (this is special and requires some maintenance tools we developed for our distribution). /media is deployed as tmpfs which works fine. /dev is not a problem anymore since 10.1 now uses a tmpfs for /dev automatically. /tmp is a local disk partition.
Maybe you might be interested in LTSP, the "Linux Terminal Server Project" [1]. They also use a single root filesystem mounted via NFS with a single central configuration file. Files that needs to be writeable are in a small symlinked ramdisk under /tmp. I use LTSP for diskless X-Terminal-Clients since some years and it works like a charm :-) [1] http://ltsp.org - Davey --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var.
/var is not enough, you also need some client-writeable files in /etc and a writeable /media and /tmp (for X etc.). Our solution is a per-host writeable NFS mount for /var and /etc/local where we link all files from /etc to /etc/local that must be written by clients (this is special and requires some maintenance tools we developed for our distribution). /media is deployed as tmpfs which works fine. /dev is not a problem anymore since 10.1 now uses a tmpfs for /dev automatically. /tmp is a local disk partition.
Maybe you might be interested in LTSP, the "Linux Terminal Server Project" [1]. They also use a single root filesystem mounted via NFS with a single central configuration file. Files that needs to be writeable are in a small symlinked ramdisk under /tmp.
Bah. My initramfs script, a beefed up version of what mkinitrd creates, _properly_ mounts an nfs and a local disk, merges them to a unionfs and voila, you get / being an unionfs, without funky symlink hacks like knoppix, with a writable and persistent layer. If desired, the local disk is cleared before building the union, effectively making it a large tmpfs.
I use LTSP for diskless X-Terminal-Clients since some years and it works like a charm :-)
[1] http://ltsp.org
- Davey --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-`J' -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 17 Oct 2006, Jan Engelhardt wrote:
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var. /tmp is a local disk partition.
Maybe you might be interested in LTSP, the "Linux Terminal Server Project" [1]. They also use a single root filesystem mounted via NFS with a single central configuration file. Files that needs to be writeable are in a small symlinked ramdisk under /tmp.
Bah. My initramfs script, a beefed up version of what mkinitrd creates, _properly_ mounts an nfs and a local disk, merges them to a unionfs and voila, you get / being an unionfs, without funky symlink hacks like knoppix, with a writable and persistent layer. If desired, the local disk is cleared before building the union, effectively making it a large tmpfs.
Where can we get your script? It looks really interesting. -- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
If you're NFS-mounting the root filesystem, you need either different areas per machine, or local disk for workspace, e.g. for /var. /tmp is a local disk partition.
Maybe you might be interested in LTSP, the "Linux Terminal Server Project" [1]. They also use a single root filesystem mounted via NFS with a single central configuration file. Files that needs to be writeable are in a small symlinked ramdisk under /tmp.
Bah. My initramfs script, a beefed up version of what mkinitrd creates, _properly_ mounts an nfs and a local disk, merges them to a unionfs and voila, you get / being an unionfs, without funky symlink hacks like knoppix, with a writable and persistent layer. If desired, the local disk is cleared before building the union, effectively making it a large tmpfs.
Where can we get your script? It looks really interesting.
You can ignore the long minus part where scsi is removed. --- initrd-devel~/init 2006-09-07 20:47:44.000000000 +0200 +++ initrd-devel/init 2006-10-17 18:57:52.254798736 +0200 @@ -3,6 +3,7 @@ export PATH=/sbin:/usr/sbin:/bin:/usr/bin die() { + /bin/sh umount /proc umount /sys umount /dev @@ -302,75 +303,6 @@ modprobe ide-disk $params params= for p in $(cat /proc/cmdline) ; do case $p in - scsi_mod.*) - params="$params ${p#scsi_mod.}" - ;; - esac -done - -# check for SCSI parameters in /proc/cmdline -devflags=0 -for p in $(cat /proc/cmdline) ; do - case $p in - scsi_mod.*) - params="$params ${p#scsi_mod.}" - ;; - scsi_reportlun2=1) - echo "scsi_reportlun2 compat: Use scsi_mod.default_dev_flags=0x20000 instead" - devflags=$((131072+$devflags)) - ;; - scsi_noreportlun=1) - echo "scsi_noreportlun compat: Use scsi_mod.default_dev_flags=0x40000 instead" - devflags=$((262144+$devflags)) - ;; - scsi_sparselun=1) - echo "scsi_sparselun compat: Use scsi_mod.default_dev_flags=0x40 instead" - devflags=$((64+$devflags)) - ;; - scsi_largelun=1) - echo "scsi_largelun compat: Use scsi_mod.default_dev_flags=0x200 instead" - devflags=$((512+$devflags)) - ;; - llun_blklst=*) - echo "llun_blklst is not supported any more" - echo "use scsi_mod.dev_flags=VENDOR:MODEL:0x240[,V:M:0x240[,...]]" - ;; - max_ghost_devices=*) - echo "max_ghost_devices is not needed any more" - ;; - max_sparseluns=*) - echo "max_sparseluns not supported any more" - echo "use scsi_mod.max_luns or enable the new REPORT_LUNS scsi" - echo "scanning methods; try scsi_mod.default_dev_flags=0x20000" - ;; - max_luns=*|max_report_luns=*|inq_timeout=*|dev_flags=*|default_dev_flags=*) - echo "scsi_mod compat: Please use prefix: scsi_mod.$p" - params="$params $p" - ;; - esac -done -if [ $devflags != 0 ]; then - params="default_dev_flags=$devflags $params" -fi - -echo "Loading scsi_mod" -modprobe scsi_mod $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in - sd_mod.*) - params="$params ${p#sd_mod.}" - ;; - esac -done - -echo "Loading sd_mod" -modprobe sd_mod $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in mii.*) params="$params ${p#mii.}" ;; @@ -431,54 +363,6 @@ modprobe piix $params params= for p in $(cat /proc/cmdline) ; do case $p in - scsi_transport_spi.*) - params="$params ${p#scsi_transport_spi.}" - ;; - esac -done - -echo "Loading scsi_transport_spi" -modprobe scsi_transport_spi $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in - mptbase.*) - params="$params ${p#mptbase.}" - ;; - esac -done - -echo "Loading mptbase" -modprobe mptbase $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in - mptscsih.*) - params="$params ${p#mptscsih.}" - ;; - esac -done - -echo "Loading mptscsih" -modprobe mptscsih $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in - mptspi.*) - params="$params ${p#mptspi.}" - ;; - esac -done - -echo "Loading mptspi" -modprobe mptspi $params - -params= -for p in $(cat /proc/cmdline) ; do - case $p in sis900.*) params="$params ${p#sis900.}" ;; @@ -514,7 +398,9 @@ modprobe sis5513 $params if [ -z "$rootdev_cmdline" ]; then case "$ROOTPATH" in - "") ;; + "") + rootfstype="unionfs" + ;; *:*) rootfstype="nfs" rootdev="$ROOTPATH" ;; @@ -528,10 +414,8 @@ if [ -z "$rootdev_cmdline" ]; then fi ;; esac if [ -z "$rootdev" ]; then - echo "no local root= kernel option given and no root" \ - "server set by the dhcp server." + echo "Building root from union" echo 256 > /proc/sys/kernel/real-root-dev - die 0 fi fi @@ -657,6 +541,26 @@ done echo "Loading nfs" modprobe nfs +params= +for p in $(cat /proc/cmdline) ; do + case $p in + unionfs.*) + params="$params ${p#unionfs.}" + ;; + esac +done + +echo "Loading unionfs" +modprobe unionfs + +for p in $(cat /proc/cmdline); do + case "$p" in + (live) + live_readwrite=1; + ;; + esac; +done; + # Wait for udev to settle /sbin/udevsettle --timeout=$udev_timeout # Check for a resume device @@ -712,7 +616,7 @@ elif [ -x /bin/fsck.${rootfstype} ]; the fi opt="-o ro" -[ -n "$read_write" ] && opt="-o rw" +[ -n "$read_write" -o "$rootfstype" == "unionfs" ] && opt="-o rw" [ "$rootfstype" = "nfs" ] && opt="${opt},nolock" # tell kernel root is /dev/ram0, prevents remount after initrd @@ -723,12 +627,62 @@ echo "Mounting root $rootdev" [ "$rootfstype" = "xfs" -a -n "$journaldev" ] && opt="${opt},logdev=$journaldev" [ "$rootfstype" = "xfs" -a -n "$rootfsflags" ] && opt="${opt},$rootfsflags" [ "$rootfstype" = "reiserfs" -a -n "$journaldev" ] && opt="${opt},jdev=$journaldev" + +###set -x; +if [ "$rootfstype" = "unionfs" ]; then + mkdir -p /.STATIC /.DYNAMIC; + ip link set lo up; + ip addr add 127.0.0.1/8 dev lo; + ip route add 127.0.0.1/8 dev lo scope link; + dhclient -sf /sbin/dhclient-script -lf /dhclient.leases eth0; + NFS=1; + + if [ -n "$live_readwrite" ]; then + nfsextraopt="-r"; + opt="$opt,dirs=/.STATIC=rw"; + else + opt="$opt,dirs=/.DYNAMIC=rw:/.STATIC=nfsro"; + fi; + + if [ "$NFS" -gt 0 ]; then + echo -en "\e[0;33m""Using NFS""\e[0m\n"; # ]] + portmap -d & + portmap_id=$!; + mount `cat /.DYNAMIC/.next-server`:/tftpboot/terran /.STATIC \ + -o async,nolock,rsize=512,wsize=512 $nfsextraopt || { + echo -en "\e[0;31m""nfsroot could not be mounted""\e[0m\a\n"; # ]] + die 1; + }; + kill -TERM $portmap_id; + else + echo -en "\e[0;33m""Using CIFS""\e[0m\n"; # ]] + mount -t cifs -o username=tftpboot,password=tftpboot $nfsextraopt \ + //`cat /.DYNAMIC/.next-server`/terran /.STATIC || { + echo -en "\e[0;31m""cifsroot could not be mounted""\e[0m\a\n"; # ]] + die 1; + }; + fi; + + mount LABEL=tmp /.DYNAMIC || { + echo -en "\e[1;31m""Not good.""\e[0;31m"" Will use RAM for temporal storage for now.""\e[0m\a\n"; # ]]] + mount -t tmpfs none /.DYNAMIC; + }; + echo "Clearing DYNAMIC"; + rm -Rf /.DYNAMIC/* /.DYNAMIC/.[A-Za-z]*; + rootdev="none"; +fi; + [ -n "$rootfstype" ] && opt="${opt} -t $rootfstype" if [ -x /bin/nfsmount -a "$rootfstype" = "nfs" ]; then nfsmount $rootdev /root || die 1 else mount $opt $rootdev /root || die 1 fi + +mkdir -p /root/{.STATIC,.DYNAMIC}; +mount -n --move /.STATIC /root/.STATIC; +mount -n --move /.DYNAMIC /root/.DYNAMIC; + # Look for an init binary on the root filesystem if [ -n "$init" ] ; then if [ ! -f "/root$init" ]; then #<EOF> -`J' -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
Benedikt Thelen
-
Boyd Lynn Gerber
-
David Mayr
-
Frank Steiner
-
Jan Engelhardt
-
Per Jessen
-
Rene Salmon