Author

Topic: PXE booting BAMT (Read 2251 times)

newbie
Activity: 32
Merit: 0
June 09, 2014, 05:51:17 AM
#2
I'm trying to do the same thing. I'm following:
http://www.reddit.com/r/litecoinmining/comments/1qjnya/boot_your_miners_via_pxe_quick_step_by_step_howto/
But they're creating a blank debian distro and it's not quite working as I want it to.

What I"m trying to do is to copy the contents of the litecoin bamt image to the /miners/2/ folder by mounting the litecoin image:
Code:
mount -o loop,offset=682698240 litecoinbamt_r9_1.6.2.img /mnt/bamt
(got the offset by fdisk -l litecoinbamt_r9_1.6.2.img then 512 * start)
Code:
cp -ax /mnt/bamt/bamt/ /miners/2/

then using the settings in the tutorial to boot. But rig seems to hang upon booting.

If i just follow the tutorial i get into a command prompt but can't seem to get a desktop environment working or properly installing cgminer, that's why I just want to use the bamt settings..

Anyone have any success?

[edit]
This is what I've done, straight from the above linked tutorial:
Configure the network to have a static ip:
vim /etc/network/interfaces :
Code:
auto lo eth0
iface lo inet loopback

iface eth0 inet static
        address  192.168.1.200
        netmask 255.255.255.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8
Set up boot images for tftp
Code:
mkdir -p /srv/tftp/pxelinux.cfg
cp /usr/lib/syslinux/pxelinux.0 /srv/tftp/
cp /boot/initrd.img-3.2.0-4-amd64 /srv/tftp/
cp /boot/vmlinuz-3.2.0-4-amd64 /srv/tftp/
we dont export /miners/default so if there is no mac address found in /srv/tftp/pxelinux.cfg/ the boot will fail, this ensure that the clients doesnt get messed up
vim /srv/tftp/pxelinux.cfg/default :
Code:
        DEFAULT vmlinuz-3.2.0-4-amd64 root=/dev/nfs initrd=initrd.img-3.2.0-4-amd64 nfsroot=192.168.1.200:/miners/default ip=dhcp rw
vim /etc/dhcp/dhcpd.conf :
Code:

allow booting;
allow bootp;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.100 192.168.1.150;
  option broadcast-address 192.168.2.255;
  option routers 192.168.1.1;
  option domain-name-servers 8.8.8.8;

  filename "/pxelinux.0";
}

host miner1 {
  hardware ethernet 60:a4:4c:61:55:9f;
  fixed-address 192.168.1.101;
}

host miner2 {
  hardware ethernet 60:a4:4c:61:53:ee;
  fixed-address 192.168.1.102;
}

# more miner hosts comes here

vim /etc/hosts :
Code:
192.168.1.101   miner1 # 60:a4:4c:61:55:9f
192.168.1.102   miner2 # 60:a4:4c:61:53:ee

vim /etc/exports :
Code:
/miners/1       192.168.1.101(rw,no_root_squash,async,insecure,no_subtree_check)
/miners/2       192.168.1.102(rw,no_root_squash,async,insecure,no_subtree_check)

Please note that the config file always starts with 01- then comes the MAC address
Code:
echo DEFAULT vmlinuz-3.2.0-4-amd64 root=/dev/nfs initrd=initrd.img-3.2.0-4-amd64 nfsroot=192.168.1.200:/miners/1 ip=dhcp rw > /srv/tftp/pxelinux.cfg/01-60-a4-4c-61-55-9f
echo DEFAULT vmlinuz-3.2.0-4-amd64 root=/dev/nfs initrd=initrd.img-3.2.0-4-amd64 nfsroot=192.168.1.200:/miners/2 ip=dhcp rw > /srv/tftp/pxelinux.cfg/01-60-a4-4c-61-53-ee
restart dhcp / nfs
service isc-dhcp-server restart
service nfs-kernel-server restart


we create the bootable linux into the nfs share
debootstrap  --arch amd64 wheezy /miners/1/  http://ftp.de.debian.org/debian/ is what it says in the turotiral, i use i368 as --arch
vim /miners/1/etc/fstab :
Code:
    /proc    /proc    proc    defaults   0 0
    /sys     /sys     sysfs   defaults   0 0
echo miner1 > /miners/1/etc/hostname

chroot /miners/1/
mount /proc
passwd


apt-get install vim linux-image-3.2.0-4-amd64 openssh-server is what it says in the tutorial, i use linux-image-3.2.0-4-686-pae
now we boot miner1 from pxe and hopfully we get a prompt and we can ssh to the box from the pxe server:
ssh 192.168.1.101
full member
Activity: 187
Merit: 100
November 24, 2013, 03:44:37 PM
#1
I'll start by saying this is the first time I've ever attempted to set up PXE booting for anything.  Also, my linux skills are not the best, at least in regards to advanced topics like this.

If I can get this working properly, I will post a detailed guide on how to do it.

I've tried many things to get this working, with limited success.
I'm running Ubuntu 12.4 Server as the PXE server.  It is a virtual machine running inside a VMware ESXi box.

Method 1.
My best success is roughly following this guide: http://www.serenux.com/2011/04/howto-create-a-diskless-workstation-that-boots-from-pxe-using-ubuntu/
In a nutshell, I boot BAMT from a usb client and copy the filesystem to the pxe server, which is then shared as nfsroot for the mining rigs to boot from.
Doing that, I can get the clients to boot AND start mining.  The problem is that all the mining rigs are sharing the same root filesystem, so they can't get a lock on any files.  This causes problems with gpumon and I'm sure many other other things.  But at least cgminer still works...

I think I can work around this by setting up a separate nfs share for each mining rig.  But that defeats the purpose of having a single centralized image to manage, it also increases the space requirements.
I believe the proper solution is to set the nfsroot as read-only, and then create a snapshot or overlay for each rig that is rw.  But I don't know how to do that, and can't find any info on how to do it in my case.




Method 2.
My second best attempt is extracting the structure directly from the bamt05c.img file to the pxeserver. Then in the pxeconfig set the kernel command line like this:
Code:
kernel bamt/live/vmlinuz
append initrd=bamt/live/initrd.img boot=live config splash vga=0x317 hostname=bamt-miner fetch=tftp://192.168.0.10/bamt/live/filesystem.squashfs

When I test booting this from a diskless virtual machine, it works.  Gnome loads and everything seems to work perfectly, except that it can't mine because there's no gpu (obviously). 
So then I test it in an actual mining rig, it seems to boot perfectly, until it attempts to open Gnome.  But instead of loading the GUI, it just shows a blank screen with a cursor in the top left corner.  I can SSH into it at this point, but nothing is working and it won't mine.  I have no idea why.  In theory, this booting method should be exactly the same as if it's boot from a usb, because it's using the same exact image.


Can anyone offer any advice on getting either method working?  I prefer method 1, because it's easier to update config files without having to unpackage/repackage the filesystem.  But I'll take whatever works.
Jump to: