Myths about FreeBSD. Differences in software and system design. File system structure

In the field of modern open source software, the word “Linux” has practically become synonymous with the concept of “operating system,” although few people know that in fact it is far from the only Unix-type OS today whose source codes are available to everyone.

According to data obtained from IOSC, in 1999, almost a third of all machines that were connected to the Internet were running on Linux based, while almost 15% used the FreeBSD operating system. What kind of system this is, and to this day only a few know modern users PC, despite all its advantages and widespread use at one time. It is worth noting the fact that many world leaders in the field of Web services are actively working on this system. In particular, it is worth noting that Yahoo's current system is based on FreeBSD. What this gives to users, they themselves hardly know or even think about, but the owners of the system are confident that this is the right decision.

What is BSD?

BSD stands for Berkeley Software Distribution. This is what the software that Berkeley distributed in source code was called at one time. It is worth noting that FreeBSD was originally an addition to the standard UNIX operating system. How was this compared to the current version of the system?

Based on version 4.4 BSD-Lite, several open source operating systems were created. In particular, the composition of these systems included the development of other projects, among which the GNU project deserves special attention.

Structure

The advantages and features that this system has are different from the FreeBSD structure. What is this structure:

  • The kernel, which is designed for careful scheduling of all processes, memory management, working with various devices, as well as support for multiprocessor systems. It should be noted that, unlike Linux OS, in this case There are several types of BSD kernels, each with different features.
  • C library, which is used as the main one system interface programming, and is based on code from Berkeley, and not from the GNI project.
  • All kinds file utilities, compilers, shells, link editors, and other programs end user, some of which are based on GNU code.
  • FreeBSD UNIX- an operating system that includes X Window, which is directly responsible for This system is used in the vast majority of versions of BSD and is officially supported by the X.Org project. This system allows the user to choose from several graphical shells, as well as a number of lightweight window managers.
  • A large number of other system and application programs.

What is real UNIX?

It is worth noting that FreeBSD UNIX itself is an operating system that is always different. And the types of such systems are not clones of each other. They represent only the descendants of a common ancestor - the traditional operating system UNIX. This fact may be somewhat surprising, especially if we remember that the developer of this operating system has never disclosed the codes of his developments to the general public.

Is BSD UNIX?

Indeed, the UNIX operating system was never open source software, and therefore BSD would definitely not be called a UNIX system, if only because the graphical interface of the operating systems is different. However, at the same time, the company that developed UNIX actively used other people's developments, and in particular this applies to software that was developed by the CSRG organization.

Initially, BSD distributions, as well as the graphical interface of operating systems, were complexes of user programs, and this situation continued exactly until the company entered into a contract with DARPA, a subordinate. The purpose of this contract is to update various communication protocols, which supported computer network agencies.

During the 1980s, several workstation companies formed, but it is worth noting that many of them purchased licenses to use UNIX rather than try to develop their own software from scratch. In particular, it is worth highlighting the Sun company, which did this and decided, based on version 4.2BSD, to eventually release its own operating system, which was called SunOSTM. When UNIX developer AT&T eventually decided to commercialize its own operating system, it produced a rather austere implementation, System III, which was eventually followed by System V.

For what reason does this operating system remain unclaimed?

There are a number of reasons why FreeBSD 10 is not in such wide demand today:

  • Developers are most often interested in the quality of their own code, and more in polishing it, rather than in advertising.
  • By by and large, the popularity of Linux is a consequence of a number of external factors relatively this project, in particular, this applies to funds mass media, as well as companies that decided to form their own business, providing services to users of this operating system.
  • BSD developers are overwhelmingly more experienced than Linux developers, so they pay much less attention to making life easier ordinary users. In other words, setting up FreeBSD for regular user is more complex than
  • In 1992, the UNIX developer decided to sue the company BSDI, which supplied the BSD/386 operating system. The main point of accusation in this case was that the OS contained closed code, owned by the plaintiff, and it seems that the case was eventually settled out of court in 1994, but a whole complex of secondary litigation even today poisons the lives of many people.
  • There is an opinion that the BSD projects themselves are different and may even conflict with each other. This opinion is based on events that took place quite a long time ago.

Which is better - Linux or BSD?

Today, most often chosen by installing Apache server, FreeBSD instead of the traditional one found on most other Linux systems. For the average user, the difference between these systems is surprisingly small, since both products are based on UNIX. Both systems are developed on a non-commercial basis.

Who owns BSD?

It is worth noting that there is no specific person or a company that would own BSD development. The development, as well as the subsequent distribution of this system, is carried out by a whole group of highly qualified and at the same time dedicated to the project specialists gathered from all over the world. Certain BSD components are separate projects that have open source, which has its own laws and development teams.

What should I choose?

The choice between these operating systems is indeed quite difficult, so there are several tips that will allow you to choose which option is optimal - Linux or FreeBSD. The commands in both cases are quite similar, so the choice can most often be based on the following:

  • If you are already using a certain Open Source OS, then in this case you should not even change anything.
  • FreeBSD systems can exhibit much better performance, but this rule is not universal.
  • BSD systems have a pretty good reputation, especially when it comes to reliability.
  • BSD projects have a better reputation because they are different high quality, as well as the completeness of available documentation.
  • In BSD you can use the vast majority of executables Linux files, while Linux cannot use many BSD executables.

Provides technical support, and also maintains FreeBSD - ports and systems - FreeBSD Mall, Inc.

On October 10, 2016, the release of the next (11th) version of the popular unix systems. I decided to write detailed instructions with video on two options for installing Freebsd 11 - on a single disk and raid1 in the form of a zfs mirror pool. I haven’t looked closely at this system for a long time, so I decided to describe everything in detail and see what has changed in it lately.

I will consider 2 installation options:

  1. Regular, on a single hard drive. This configuration is suitable for virtual machine, where redundancy is provided at the backup level of the entire virtual machine, without the need for redundancy on hard level disk.
  2. The second option is installation on software raid1, which is implemented in the form mirror pool on zfs. Freebsd has been friends with zfs for a long time. I installed the system on it, if I'm not mistaken, version 8. At that time I had to do everything manually, but now I saw that it was possible to install freebsd on zfs using the standard installer in automatic mode. This setup is suitable for deploying the system on real hardware.

I didn’t see any fundamental changes in the installation compared to the previous 10th version, so I won’t go into all the steps in detail, as I did in the article about. I will try to write more briefly, focusing only on key places. However, this guide to installing from scratch is suitable for beginners, or, as they say, dummies. Everything is told in simple and accessible language.

Download the required freebsd image

Before installation, you need to decide which image to download. I have compiled a short table describing all types Freebsd images 11 for the x64 platform, which can be downloaded. I provided links to Y andex.Mirror, I prefer to download everything from it, as it is fast and convenient.

Download Freebsd 11
Image nameDescriptionDownload image
bootonlyMinimal size image. To install the system from it, you must be connected to the Internet during installation.bootonly.iso 285M
disc1Main system and basic set programs are on disk. Can be installed without a network connection. I usually use this way.disc1.iso 656M
dvd1Maximum image. In addition to the system, it includes software packages. I don’t know what packages they are and what list they are; I’ve never used this image. After installation, I install everything that is needed via the Internet.dvd1.iso 3G
memstickStandard image for installation from a flash drive, similar to disc1.memstick.img 700M

In the following narrative I will use the image disc1 as the most convenient and versatile.

Standard installation

Let's start from scratch installing Freebsd 11 on a single hard drive. We insert iso image into startup and boot from disk. We are greeted by a traditional welcome window with three options to continue:

  1. Install— start installing the system.
  2. Shell- go to the console.
  3. Live CD- boot into Live mode CD.

Select the installation. The next step will ask you to select a layout. Most often, the standard one is enough, so we don’t change anything, but move on with the standard layout.

Now we select the components that will be installed. I usually don't install anything other than lib32. Everything you need can then be installed from the Internet.

At the next stage we select breakdown of hard disk. You can manually specify all the required partitions, select the size, etc. I usually don't do this and install everything on one root partition. I've been doing this for a long time on all systems and don't see any problems with it. Most frequent recommendation— put all the logs in a separate section so that by accidentally filling all the free space they won’t crash the server. In practice, I have never had this happen, so I consider it unnecessary to tinker with sections every time for the sake of very conditional convenience. True, there is a nuance - I always have monitoring of free space on my hard drive configured on all servers. So I have time to quickly respond to problems with free space. Well, I keep an eye on the rotation of the logs, of course, and don’t let them grow to large sizes.

So select the first item - Auto (UFS). We'll look at installing freebsd 11 on zfs later.

Check the proposed disk partitioning scheme. If everything suits you, click Finish and agree to apply the changes, and the installation of the base system will begin.

It lasts literally a few minutes. Clean system installed very quickly. Along the way, you will be asked to provide a password for root. Do it. Next you will need to select network interface for settings.

If you have several of them, then select the one you want to configure for network access. After selecting the interface, you will need to agree to setting the IP address on it. Next I choose to receive settings via DHCP. It's the easiest way. If you need to manually specify an IP address, then abandon dhcp and enter the network parameters manually.

After this you will need to specify dns address server, having previously abandoned ipv6. If you received the settings via dhcp, the address will already be filled in, you just need to confirm it. If you specified the settings manually, enter the DNS server yourself.

Now select the time zone, date and time. There is nothing complicated, I won’t give screenshots. If the date and time are correct, then simply select Skip, if there are discrepancies, manually indicate the correct ones. This, by the way, is an innovation in version 11. Previously, there was no such calendar or clock.

The installation is nearing completion. You need to specify which services you want to start automatically when the system boots. Be sure to indicate sshd to connect to the server remotely, also ntpd not prevent. The rest is up to you, I don't indicate anything else. dumped is the default, let it remain.

In the next step, we are asked to select some security options. I am not familiar with this topic in detail, I have not understood it, but I can see from the names that the things are very useful. You can turn it on. It's up to you here. It won't be worse, but don't expect anything special either. All these settings can be made later.

At the final stage, you will be asked to add users to the system. If you don't do this, you won't be able to connect via ssh to the server. Default in freebsd root user It is forbidden to connect via ssh. This can only be fixed by logging in locally as root and editing ssh settings. So create at least one user and add it to the wheel group so that you can connect via ssh and do su for getting root access.

You should boot into a freshly installed Freebsd 11 system. At this point basic installation finished.

Installation on raid1

Let's perform the same installation, only on software raid1. You must have a server with at least 2 hard drives. We reach the point where you need to select the disk partition and select Auto (ZFS).

In line Pool Type/Disks choose mirror.

And specify both of your drives:

Checking zpool fault tolerance

After the installation is complete, you can test how fault tolerance works. Let's see the status of the pool when everything is fine and both disks are working:

# zpool status -v pool: zroot state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 da0p3 ONLINE 0 0 0 da1p3 ONLINE 0 0 0 errors: No known data errors

Both disks are in place. Now turn off the server and remove one of the disks. Let's see how the server behaves.

# zpool status -v pool: zroot state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using "zpool online". see: http://illumos.org/msg/ZFS-8000-2Q scan: none requested config: NAME STATE READ WRITE CKSUM zroot DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 2081140553640658652 UNAVAIL 0 0 0 was /dev/da0p3

da0p3 ONLINE 0 0 0 errors: No known data errors As you can see, there is no disk, but the system booted safely and is working normally. If we return the same disk to its place and reboot, then everything will be fine, no unnecessary movements need to be made. But let’s imagine that our disk has failed and we need to install a new one. Insert a new one into the server and boot. The new disk received the same name as the failed one - /dev/da0. There are no sections on it.

First of all we send bad disk offline:

# zpool offline zroot da0p3

The pool is now in this state:

# zpool status -v pool: zroot state: DEGRADED status: One or more devices has been taken offline by the administrator. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Online the device using "zpool online" or replace the device with "zpool replace". scan: none requested config: NAME STATE READ WRITE CKSUM zroot DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 2081140553640658652

OFFLINE

0 0 0 was /dev/da0p3 da1p3 ONLINE 0 0 0 errors: No known data errors

Let's copy the partition table from the live disk to the new one. Let's look at it first:

# gpart show => 40 20971440 da1 GPT (10G) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 4194304 2 freebsd-swap (2.0G) 4196352 16773120 3 freebsd-zfs ( 8.0G) 20969472 2008 - free - (1.0M)< /root/da1.backup

We create the same table on the new disk by copying it from the old one:

# gpart backup da1 > /root/da1.backup # gpart restore da0

Let's see what happened: # gpart show => 40 20971440 da1 GPT (10G) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 4194304 2 freebsd-swap (2.0G) 4196352 16773120 3 freebsd-zfs ( 8.0G) 20969472 2008 - free - (1.0M) => 40 20971440 da0 GPT (10G) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 4194304 2 freebsd-swap (2.0G) 4196352 16773120 3 freebsd-zfs (8.0G) 20969472 2008 - free - (1.0M) Just what you need. We'll write it down to

new disk

loader:

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0 partcode written to da0p1 bootcode written to da0

We tell the pool that we are changing the hard drive:

# zpool status -v pool: zroot state: ONLINE scan: resilvered 532M in 0h0m with 0 errors on Sat Oct 15 01:29:49 2016 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 da0p3 ONLINE 0 0 0 da1p3 ONLINE 0 0 0 errors: No known data errors

You can now remove it if you wish. old disk and make sure that the new system boots normally. I did it and was convinced.

Conclusion

Completed installation. Can be done. All information in the article is relevant for version 11.

It turned out not only about the installation, but also a little about zfs, about how to replace a failed disk in case of failure. I always pay attention to things like disk-level fault tolerance. I won’t install the system without this. There must be a raid, either software or hardware. In my work, I constantly encounter hard drive failures, so for me this is everyday life :) Even a backup is not enough in this case. Even if there is a backup, the work of replacing the system takes too much time, and if you mostly work remotely, you will also have to travel to replace something. This is not my option.

Freebsd 11 liked the simple and quick installation on raid1. I think this feature appeared earlier, I just didn't check. I decided to look at the 11th version. Overall, I liked everything. Unlike Debian, a bare system can be installed by eye 5-7 times faster and 3 times faster than CentOS. I hope that the system will continue to develop and delight us with new versions and capabilities.

Many Linux users have already heard about FreeBSD, this system uses a BSD kernel, similar to Linux, since both kernels are based on Unix and support the same POSIX standards. This is the same free, free operating system with open source code, designed to provide maximum safety and flexibility. Most often it is used on servers. The main difference from Linux is that the development of the kernel and software is carried out by one team of developers.

FreeBSD supports many different processor configurations, from servers to microcomputers such as the Raspberry Pi. Like Linux, the system comes with a lot of software that can be installed very easily using ports. There are more than 20,000 packages available. In this instruction we will look at how to do it FreeBSD installation 11 last, on this moment, versions for computer amd64. We will install the version with the interface command line, it is best suited for servers.

As usual, first we need to download installation image, and only then can the installation be performed and setting up freebsd 11.

The official website has several versions for different architectures, we need amd64 or x86, depending on the quantity random access memory, which you want to use.

We will install latest version FreeBSD 11.1, but if more comes later a new version, then I think the article will still be relevant for her.

Step 2. Burn the image to disk

Next, you need to burn the resulting image to a disk or flash drive. You can use one of the methods you know for this. For example, on Linux you can use Unetbootin or Etcher, and on Windows there is Rufus.

Next, insert the media into your computer and change the BIOS settings to boot from the inserted media. To enter the BIOS, during boot press one of the keys: F2, F11, F12 before loading the operating system. Then go to the tab "Boot" and put your medium there first.

Installing FreeBSD 11

Step 3. Bootloader Menu

In the first bootloader menu, you don't need to change any settings. Just click "Enter" to continue working:

Step 4. Select an action

Step 5: Keyboard Layout

Select your keyboard layout, the default is English, in most cases it is better to leave it:

Step 6: Hostname

Enter the hostname for the new system:

Step 7. Selecting programs

On the next screen you will have to select the system components that you want to install FreeBSD 11 on your computer. To mark a component, click "Space". For the server, it is enough to leave the lib32 and Ports compatibility libraries.

When finished, click "Enter".

Step 8. Automatic disk partitioning

Next you need to partition the disk. You can trust the installer and complete automatic marking or do everything manually. If you have multiple hard drives that need to be connected, it is better to use ZFS. But we will look at the example of UFS.

Then select your partition table. If your disk is larger than 2 TB or you are using UEFI instead of BIOS, then you are better off using GPT; in all other cases, MBR is preferable. It will even be better if you disable secure boot and use MBR:

In the next window, the system will show you the created partitions. In case of MBR, two partitions will be created - root and swap partition. Use "Tab" to select a button "Commit" and then click "Enter":

Step 9. Install FreeBSD


Step 10: Superuser Password

When the installation is complete, the system will prompt you to enter a password for the superuser. The installer will ask for the password twice, but it will not be displayed on the screen:

Step 11. Network setup

Then select "Yes" to configure the IPv4 IP address:

You can choose to obtain an address via DHCP or configure it manually:

You can skip setting the IPv6 address:

The last stage of network setup is DNS settings servers. It is best to add, in addition to the standard one, a DNS server from Google - 8.8.8.8:

Step 12. Region

Select the geographic region where your computer is located:

Then select your country:

Step 13: Setting the date

At the next step you need to enter current date and time if they were incorrectly received from the network:


Next, you need to select which services will load by default when the system starts. For example, SSH, NTP and Powerd. The latter allows you to automatically adjust the processor frequency depending on the system load.

Step 15. Additional optimizations

These options allow you to enhance the security of your system. Disable access to the kernel buffer for unprivileged users. Disable debugging, Enable /tmp cleaning at boot time, disable Syslogd socket and Sendmail if you don't plan to use a mail server:

Step 16: Other Users

Next, the installer will ask you if you would like to add more users to the system. Select "yes" and enter all necessary information about the user. The safest thing to do is leave all fields as default; to do this, just click "Enter":

You can choose Bourne shell (sh) or tcsh as your shell. When finished, simply type "Yes":

Step 17: Complete installation

On the last screen, a simple action menu will appear in front of you. If you don't want to change anything, just select the first option - "Exit" and answer "no" to restart your computer:


In the topic there is a raid of Linuxoids :-) HZ, those who complain about some problems with the fr simply do not know how to prepare it. Corny, right? :-) On three of mine last places Frya's work was used to the fullest. And at our current place of work, we remove everything that is possible from Linux, and leave only what is not allowed - as a rule, very specific software developed only for Linux. Everything else - PPPoE servers, web, mail, monitoring, auxiliary servers, file servers- everything spins on the fre. As is typical, we do not experience any problems.

I don’t know what technologies the speakers above use that they cannot use in fr, but I have not seen any fundamental restrictions on FreeBSD as a platform.

There are problems with specific products on fr - yes. I won’t say anything about Bitrix, but the performance of samba on Linux is higher than on fr. But this is not a problem with the system, but rather with samba itself, the developers of which did not want to deal with the problems of samba in free.

In general, it's enough - it's enough good system, and much more logically arranged inside than many Linux distributions. There are scenarios that Linux can implement, but Fria cannot. But there are also reverse scenarios. So there is no universal recipe here.

Any "universal" services on fr work fine. About problems with package managers- this is trash, Linux people lie everything :-) They are very behind the times, special problems Package managers are long gone. Separately, they delivered tales about the fact that if you assemble software from ports, then later you will have problems with packages :-)

ZFS on Linux is far behind ZFS on fr in terms of functionality. In ZFS-on-linux, only in the last release the lz4 compression algorithm was added, which has been available in the framework for more than two years. ACL support was recently added, which again, frya has been able to do for a long time.

In short, a million examples can be given, but the conclusion is quite simple - do not believe the statements that “tool XXX is wow, and tool YYY is wow.” Each of them has its pros and cons, you just need to know them and use the right tool. If you plan to set up servers “in a corporation” or for the tasks of a communication provider, or simply put your website on the Internet, both Fria and Linux will solve these problems perfectly. If you are making some kind of storage, for virtualization, for example, I would use free. If you plan to create a large, high-load web project, perhaps Linux is better suited here.

I, as a former corporate admin, and now an admin of an Internet and service provider, do not experience any problems with fry in my work.

In this article we will look at the operating system - FreeBSD, why it attracts users and what disadvantages it has. Development of the operating system began back in 1993FreeBSD (Berkeley Software Distribution) , the first one came out in the same year official version. The latest release of the system appeared in August 2015. As you can see, the FreeBSD OS is developing steadily and naturally has its fans. Let's figure out why users love FreeBSD so much and what disadvantages this system has.

Many users often compare FreeBSD with Linux, since both of these systems are similar to each other. common feature: free download from the network, open source, free, support forums where you can find many supporters of this OS. The main differences between Linux and BSD in more detail.

The main advantages of the FreeBSD system:

  • Work stability. A few years ago, Netcraft compiled the results of website analysis. The longest continuous operation (by calendar days) was for web projects running FreeBSD.
  • Free OS download. Most users always choose free systems, and do not burden themselves with purchasing expensive licenses for the OS. Thus, you can download and install FreeBSD absolutely free.
  • Open source. Anyone can make their own edits to the code and perform the desired checks without problems, although there are some restrictions, but they are too minimal.
  • Quality.Many world-famous web services use this system, which is an indisputable confirmation of the quality of work. Experts estimate that almost 40% of servers on the CIS market run on this OS.
  • Reliability.This factor is provided by the monolithic core and complete logical structure An OS that is essentially holistic.

Structure FreeBSD systems:

  1. The C library is used as the system programming interface.
  2. The kernel, which is designed to schedule all processes, memory management, work with devices, etc.
  3. A variety of file utilities, compilers, shells, linkers, and other end-user programs, some of them based on GNU code.
  4. FreeBSD's built-in X Window is responsible for graphic design.
  5. Huge selection of system and application programs.

Almost 4 thousand volunteers are involved in the development of FreeBSD, which release updated versions. There are ten releases in total, the last of which was released on August 13, 2015. But still, the system is not as popular as, for example, Linux. Let's look at the reasons why FreeBSD has a small amount of users. First of all, this is the “merit” of the developers who are engaged in polishing the system code and devote very little time to advertising their product. In addition, they care little about the average user and do not simplify the process of setting up and installing the OS, which for many is a key stage when choosing an operating system. After all setting up Linux is much easier than FreeBSD.

Disadvantages of the FreeBSD system .

Among the disadvantages of the OS, users most often highlight the complexity of installing and configuring the system, but with the advent of certain administration skills, this disadvantage becomes insignificant. In addition, there is insufficient literature and difficult access to documentation to learn how FreeBSD works. If you still want this OS to run on your dedicated server, you can contact our technical support and they will quickly and efficiently install and configure FreeBSD. It will also be enough just to select FreeBSD the desired OS when running the server and it will be pre-installed on your server.

Conclusion. If you are choosing an OS for your server, read the following tips, which we hope will help you make right choice. You can often find information on Internet resources that FreeBSD improves performance, this is true, but this rule should not be considered universal. FreeBSD's good reputation is well deserved due to the quality of the OS it provides. And lastly, if you are already using the previously selected OS, you should not change it.

For your information, FreeBSD OS (9.10) is already pre-installed on our VPS servers and you can experience all the advantages of this system by placing an order virtual server in company Hyper Host™ . ?

6628 times 14 Viewed times today