Hetzner安装iso系统教程

安装映像脚本

Hetzner 提供的 installimage 脚本是安装各种 Linux 发行版的一种简单快捷的方法。

您可以直接从服务器上的救援系统运行安装映像。它的菜单界面使您可以轻松选择所需的Linux发行版。您可以完全控制如何对驱动器进行分区。您可以使用简单的编辑器来定义您希望如何使用软件 RAID 和 LVM。

运行安装映像

要使用安装映像,您首先需要激活救援系统,然后启动到救援系统

使用机器人上显示的密码以“root”身份登录救援系统。然后键入 

installimage

 以启动安装映像脚本:

root@rescue ~ # installimage

在以下菜单中,您应该看到:

Example of the images menu

选择图像后,您将收到一条注释,指出编辑器将启动,这将打开配置文件。

午夜指挥官

mcedit

)被用作编辑器。

开始之前

在开始安装之前,请检查服务器是否具有硬件RAID控制器。如果是这样,请在通过安装映像安装操作系统之前创建所需的 RAID。 您可以在相应文章中找到更多信息:

Adaptec LSI/Megaraid

如果您的服务器已经安装了操作系统,建议停止当前活动的软件 RAID 并删除当前分区,以防止在安装过程中可能出现的问题。

要停止所有软件 RAID 阵列,您可以使用以下命令:

mdadm --stop /dev/md/*

要擦除所有驱动器上的分区表,您可以使用以下命令:

# for SATA drives:
wipefs -fa /dev/sd*
# for NVMe drives:
wipefs -fa /dev/nvme*n1

操作系统选择

我们提供了许多您可以使用的标准图像。这些通常是特定发行版的最新版本。

高级用户还可以通过转到文件夹来安装这些发行版的旧版本。重要说明:我们不为这些旧映像提供任何支持。old_images

此外,高级用户还可以创建自己的操作系统映像并进行安装。请查看有关如何安装自己的操作系统映像的指南,以获取有关如何实现此操作的信息以及要求列表。

自动设置

如果在救援系统中找到文件,它将自动将其用作配置文件。除非文件中有错误,否则您将看不到菜单和/或编辑器。installimage/autosetup

Variables

You can adjust the following variables to customize the installation.

Drives

The drives that are present in the server are identified in the first row with the variable DRIVE. Above each line, you can see the type of drive.

Here, you can select which drives you want the OS to be installed on. The drives will be completely wiped, and all data currently on them will be lost.

If you want to leave a drive in its current state and not make any changes to it, you can leave it out (remove it) by placing a before it. Important note: Doing this means that you need to properly adjust the number after the next DRIVE variable.#

Example:

# SSDSC2BB480G4
#DRIVE1 /dev/sda
# SSDSC2BB480G4
DRIVE1 /dev/sdb

SWRAID

If the server has multiple drives, you can use the variables and to create different software RAID levels. Any software RAID levels are always applied to all drives. (That means drives marked with DRIVE, as discussed above.) drives. If you don't want software RAID on a particular drive, you'll need to remove it accordingly.SWRAIDSWRAIDLEVEL

The script can create software RAID with levels 0, 1, 5, 6 or 10.

Bootloader

The bootloader Grub is pre-configured. (In the past we also offered Lilo). Depending on the operating system, GRUB2 or GRUB1 (legacy Grub) is installed.

Hostname

The variable sets the corresponding host name in the system.HOSTNAME

Partitions / file systems

The installimage also supports adjustments to the partitioning scheme (including the use of LVM). You can find the designated syntax in the examples in the editor.

操作系统映像

这是操作系统映像的完整路径;只有在安装自定义映像时,才需要指定它。

安装

使用 F10(保存并退出)离开编辑器后,将检查配置文件的语法。如果它包含错误,您将返回到编辑器。

Installimage done.png

如果在 1-5 分钟后看到此输出(具体取决于所使用的映像和分区),则系统已准备就绪并可启动。

root 密码设置为救援系统的当前密码。

在救援系统中,reboot

root@rescue ~ # reboot

新安装的系统已启动,您可以使用以前的救援系统密码登录。

特殊性

当使用 installimage 脚本安装 Debian 或 Ubuntu 时,cronjob 的时间是随机设置的。/etc/cron.d/mdadm

常见问题

为什么不能创建大于 2 TiB 的分区?

只能使用 GUID 分区表 (GPT) 创建大于 2TiB 的分区。因此,您只能安装包含 GRUB2 的操作系统;它支持从 GPT 驱动器启动。

安装脚本显示一个或多个错误。我该怎么办?

重新运行安装。如果再次收到相同的错误,请将完整的屏幕输出和文件内容发送到 support@hetzner.com/root/debug.txt

我是否必须将“all”放在分区表的末尾,或者我可以将这一行放在顶部吗?

配置文件中的大小意味着使用驱动器上剩余的可用空间。由于分区是逐个创建的,因此分区表将在使用后结束,因为之后将没有可用空间。当然,也可以根本不使用“全部”。allall

按 F10 不起作用。相反(或类似的东西)显示。~21

按“逃生”,然后。在大多数情况下,这与 F10 具有相同的效果。0

剧本的作者是谁?我可以自由使用它吗?

这些脚本由Hetzner Online GmbH的开发人员编写,他们维护和扩展它们。这些脚本是用bash编写的,可以在救援系统中使用。您可以自由修改和使用它们。Hetzner Online GmbH 对因更改脚本而造成的任何损害不承担任何责任,也不对包含脚本更改的指南提供任何支持。

https://github.com/hetzneronline/installimage

安装 LAMP 时,MySQL Root 密码是什么?

您可以在文件中的 LAMP 映像上找到 MySQL 根密码。/password.txt

无标签