大网数据广告活动
服务器运维问答

Hetzner's installimage script, RAID1 hard drives + SSD

· 52CE 我爱测

I just purchased a server from Hetzner, with two 4TB hard drives and one 1TB SSD. I want to setup the two hard drives (/dev/sda & /dev/sdb) in RAID1 and install the OS on them, and have the SSD (/dev/sdc) as an extra drive. Until…

问题原文

原帖链接 · Tim Autin · CC BY-SA 4.0

I just purchased a server from Hetzner, with two 4TB hard drives and one 1TB SSD. I want to setup the two hard drives (/dev/sda & /dev/sdb) in RAID1 and install the OS on them, and have the SSD (/dev/sdc) as an extra drive.

Until now, all my tentatives failed. The installimage script runs fine, and tells me that I just need to reboot. But when I reboot, I have this error:

I tried fixing the error without luck and gave up, as I suspect that the problem comes from my installimage script config.

Here's the configs I used for all my tries:

DRIVE1 /dev/sda
DRIVE2 /dev/sdb
#DRIVE3 /dev/sdc # commented to exclude it from the RAID setup
SWRAID 1
SWRAIDLEVEL 1
BOOTLOADER grub
HOSTNAME EX51

And here are the different partitioning schemes I tried:

1°) Nearly the default config

PART  swap   swap   32G
PART  /boot  ext3   512M
PART  /      ext4   all

2°) A try with LVM

PART  /boot  ext3   512M
PART  lvm    vg0    all

LV  vg0  swap  swap  swap  4G
LV  vg0  root  /     ext4  all

3°) Partitions smaller than 2TB in case that the system does not use grub2 (is it?)

PART  swap   swap   32G
PART  /boot  ext3   512M
PART  /      ext4   1T
PART  /p1    ext4   1T
PART  /p2    ext4   1T
PART  /p3    ext4   all

What am I doing wrong?

Thanks!

EDIT: disabling RAID works.

已采纳解答

原帖链接 · Tim Autin · CC BY-SA 4.0

So I finally got it working. I don't remember exactly what went wrong, but here's what I'm doing now:

1°) Use the following config (the /autoconfig file):

DRIVE1 /dev/sda
DRIVE2 /dev/sdb
#DRIVE3 /dev/sdc
SWRAID 1
SWRAIDLEVEL 1
BOOTLOADER grub
HOSTNAME EX61
PART  swap     swap   32G
PART  /boot     ext3    512M
PART  /            ext4    all
IMAGE /root/images/Ubuntu-2204-jammy-arm64-base.tar.gz

For other sample configs see the configs folder in Hetzner's installimage GitHub repo.

2°) Once installimage script has finished, but before rebooting, create mount folder & update fstab:

Create the mount folder:

mkdir /mountFolder

Update fstab:

cat > /etc/fstab

Paste:

proc            /proc    proc  defaults  0 0
/dev/md/0  none     swap  sw        0 0
/dev/md/1  /boot    ext3  defaults  0 0
/dev/md/3  /            ext4  defaults  0 0
/dev/sdc1  /mountFolder   ext4  defaults  0 0

Then reboot.

3°) If the /dev/md2 error occurs, format the SSD:

parted /dev/sdc mklabel gpt
parted /dev/sdc print unit MB print free

Note the size of the disk for the next command

parted --align optimal /dev/sdc mkpart primary ext4 0% 960197MB // replace the size here
mkfs.ext4 /dev/sdc1

Check if fstab needs to be updated again, if so do it:

cat /etc/fstab

(paste the same as in step 2)

Finally create the mount folder and mount the drive:

mkdir /mountFolder
mount -a

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。