📜 ⬆️ ⬇️

Features of restoring / transferring FreeBSD to a host with a different hardware configuration

FreeBSD port


Specifically, we will discuss the most common problem in the transfer of BSD system


For professionals who know Linux, BSD systems are understandable “by analogy,” with the exception of some features. About the features and talk.
Yes, there is an excellent guide on FreeBSD on the official site, and even in Russian it is also there, but the point about which will be discussed is described far from the first page, but if the critical server “falls”, which was most recently approached back (or never), and it should be urgently raised on another host with a non-analogous configuration, then you can search for a long time.
And at the same time, these are the basics, without studying of which it is impossible to go further.

So, a practical task: transferring FreeBSD to another host (controllers may vary: IDE / Raid ISCI / VMware ESX / Citrix Xen).
')

Everyone knows that if the hard drive with WinXP is transferred to another computer (similar), then most likely (~ 99%), the system will boot. If the HDD controllers are incompatible, you can get a familiar BSOD. A similar situation with Linux - there will be a black kernel panic.)
There are a couple of interesting options with BSD.
My first topic will be short, so I will consider only one of my "bad" option.

Transferring "in the forehead" gives an error loading the root directory.
What made it happen?
a) The disk naming system has changed (the naming notation itself can be viewed in any BSD manual)
b) The disk numbering system has also changed (In BSD, there is a difference in which IDE / Sata port you connected to the hard disk, and this does not depend on the arrangement in the BIOS loader)

(However, briefly about the necessary additional information:
"Main section" - Slice - plot. The abbreviation s1 is the first segment. A partition in BSD is a segment within a region (“Windows of the primary partition”).
A section (analogous to a logical disk in Windows) has a special file, the naming of which is derived from the name of the section-slice by adding a letter (a, b, c, d, e, f ...). Swap traditionally has the letter “b”. On a disk - a site no more than 4, sections no more than 8.
Logical structure - Disk Label
Disc structure description:
/ etc / fstab
Standard directory structure - partition name, mount point
/ root (root directory, not a root folder)
/ swap (2 (3) xRAM)
/ tmp
/ var
/ usr)

Algorithm of the decision:
1) Boot from a boot disk that supports the FreeBSD file system. Suit frenzy.
At boot time, we carefully look at the name of the detected old disk on our new hardware.
Remember that our boot system can mount the found disk in the “read only” mode, so we check it with the mount command, and if so, we will remount (unmount and mount again) in the normal mode.
Next, we find the fstab file (responsible for mounting disks) and manually (vi, mc) rule the right one.
Personally, in my case, strings like ad4s1a (... ad4s1f) (root directory /) and all the others needed to be renamed to da0s1a, (... da0s1fa), which corresponds to section 1 of a zero SCSI disk.
In another case, the naming may change.
Persist.
Reboot.
It should load.

Next, you will find a test of the network, software, possible reassembly of ports, etc., but this question is next ...

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


All Articles