📜 ⬆️ ⬇️

Installing FreeBSD on a server in Serverloft

In the wake of an unsuccessful attempt with serverloft.eu, I decided to publish my installation guide for FreeBSD on a rented server with Linux.

Why, in fact, I chose serverloft.com? For $ 100 a month without any VAT, I received a brand rack server in Germany (albeit Fujitsu-Siemens), 100GB of space on ftp under backups. Of the nice features - in the server's control panel there is the launch of the Linux rescue console (RIPLinux via PXE), which we will use. And so, a step-by-step guide on how to automatically install FreeBSD on top of Linux.

The remote control console (hereinafter referred to as the IPMI console) is plugged into a separate port and has its own IP address. She loses to HP and Dell consoles on all counts, but I did not see such servers for rent for $ 100 a month. The graphical console is licensed separately, but fortunately there is a Serial Redirection completely free.

Go to the my.serverloft.com control panel , to the server overview section.
There you are interested in:
IP addresses
IP: 123.45.67.89 - substitute it instead of <your_ip>
')
IPMI Access
URL: 98.76.54.32
User name: root
Password: averylongpassword

It is assumed that you have already installed a Linux distribution on the server, and an IPMI console is available to you (it is configured only after the first installation). If the console does not respond, ask to re-power the server, and then change the port on which the console listens to SSH - brute-force passwords sometimes hang the console.

So, on a choice two ways. The first one assumes the availability of a FreeBSD machine for assembling your mfsBSD image, the second will allow you to get by with ready-made developments. Using the IPMI-console is not necessary for the second method, although it does not hurt there. Log into the IPMI console and configure the console serial port as follows: 9600 None VT100 8Bit. In principle, almost everything works at higher speeds, but we will not risk it.
The serial console itself can be seen there, in the form of a java applet, or you can connect to it via telnet or ssh by pressing r Console Redirection

Method one. Manual installation


  1. On a FreeBSD machine, where you plan to build an image for installation, put the ISO with FreeBSD, in the example below, this is 8.0-RELEASE, and mount:
      fetch ftp://ftp.de.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/8.0/8.0-RELEASE-amd64-disc1.iso
     mdconfig -a -t vnode -u 10 -f 8.0-RELEASE-amd64-disc1.iso
     mkdir / cdrom
     mount_cd9660 / dev / md10 / cdrom
     mdconfig -d -u 10
    
  2. Download mfsBSD from here and unpack.
      fetch http://people.freebsd.org/~mm/mfsbsd/mfsbsd-latest.tar.gz
     tar xzf mfsbsd-latest.tar.gz
    
  3. Copy the mfsBSD configs from the corresponding .sample
      cp mfsbsd-1.0-beta3 / conf / loader.conf.sample mfsbsd-1.0-beta3 / conf / loader.conf
     cp mfsbsd-1.0-beta3 / conf / rc.conf.sample mfsbsd-1.0-beta3 / conf / rc.conf
    
  4. Put in the directory where you unpacked mfsbsd-1.0-beta3 this patch and apply it
     fetch http://mfsbsd.ms1.ru/loft1.patch
     patch <loft1.patch
    

    • The patch writes the following lines to conf / loader.conf
        boot_multicons = "YES"
       boot_serial = "YES"
       console = "comconsole, vidconsole" 
    • Go to conf / rc.conf
        ifconfig_bge0 = "DHCP" 
    • Edit install_all.sh is a script for automatic installation of the system. You can correct it by partitioning (you may not like my preferences), also the script adds the user admin with the password habrahabr to the system

  5. Start the server in ServerLoft with Linux rescue console: from the control panel select Hardware - Recovery
  6. Build the image and upload it to the server.
     cd mfsbsd-1.0-beta3
     make BASE = / cdrom / 8.0-RELEASE
     cat mfsboot.img |  ssh root @ <your_ip> "dd of = / dev / sda bs = 1048576"
    
  7. Unmount the ISO from the machine where the mfsBSD image was going
     umount / cdrom
     mdconfig -d -u 10
    
  8. Disable Linux rescue console from the control panel, the server will restart. From the IPMI console, you can watch FreeBSD boot.
  9. Login to the server via SSH (if you did everything right and the network went up), or via an IPMI console. The login is root, the default password is mfsbsd. Run the installation script:
      /install_all.sh 
  10. Check the configuration of your new system in / mnt, I recommend you enter the static IP addresses, then reboot
  11. After the server has rebooted, you can log in via SSH with the admin username, then su will log you out without a password

The second way. Automatic installation


  1. Start the server in ServerLoft with Linux rescue console: from the control panel select Hardware - Recovery
  2. After the system boots, go there via SSH:
     wget http://mfsbsd.ms1.ru/mfsboot.img
     cat mfsboot.img |  dd of = / dev / sda bs = 1048576
    
  3. Disable Linux rescue console from the control panel, the server will restart. From the IPMI console, you can watch the download and installation of FreeBSD, or just wait
  4. After the server has rebooted once again, you can log in via SSH with the admin username and password of habrahabr, then su will let you in without a password

The patch to mfsbsd used to get this image can be found here.

Last steps


Change your passwords and do not forget to upgrade your system to 8.0-RELEASE-p2:
  freebsd-update fetch
 freebsd-update install
 shutdown -r now 


All of the above has been tested on a PerfectServer L Opteron 1.0 server and with FreeBSD 8.0-RELEASE. To work on other types of servers, you may need to edit the installation script for the names of network interfaces and disk controllers.

Finally a couple of words about ServerLoft: take the PerfectServer L Xeon 1.5 server - it also has hardware RAID on the LSI, the frequency of the probe is 2.5 GHz versus 2.1 for Opteron. According to my tests, Xeon is faster by 25 percent.

UPD: On servers with Xeon 2.0, the method does not work. FreeBSD does not see the RAID controller (if it is there at all), and, worst of all, the main network card.

Source: https://habr.com/ru/post/90907/


All Articles