bin456789 / reinstall

一键DD/重装脚本 (One-click reinstall OS on VPS)
GNU General Public License v3.0
2.78k stars 459 forks source link

重装rocky9失败 #202

Open LemonZuo opened 5 days ago

LemonZuo commented 5 days ago

使用的命令

bash reinstall.sh rocky 9 --password XXXXXX

原来的系统:rocky(云服务商),有两块硬盘RAID 要安装的系统:rocky 9 遇到的问题:截图或者登录 SSH 获取日志 /reinstall.log

Installing package 'mokutil'...
Last metadata expiration check: 0:01:31 ago on Tue Nov 12 13:15:48 2024.
Dependencies resolved.
================================================================================
 Package          Architecture    Version                 Repository       Size
================================================================================
Installing:
 mokutil          x86_64          2:0.6.0-4.el9           baseos           47 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 47 k
Installed size: 98 k
Downloading Packages:
mokutil-0.6.0-4.el9.x86_64.rpm                  1.5 MB/s |  47 kB     00:00    
--------------------------------------------------------------------------------
Total                                           343 kB/s |  47 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : mokutil-2:0.6.0-4.el9.x86_64                           1/1 
  Running scriptlet: mokutil-2:0.6.0-4.el9.x86_64                           1/1 
  Verifying        : mokutil-2:0.6.0-4.el9.x86_64                           1/1 

Installed:
  mokutil-2:0.6.0-4.el9.x86_64                                                  

Complete!
http://dash.cloudflare.com/cdn-cgi/trace
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   204    0   204    0     0  11333      0 --:--:-- --:--:-- --:--:-- 11333
***** SET FINALOS ROCKY 9 *****
***** TEST URL *****
https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1024k  100 1024k    0     0  3696k      0 --:--:-- --:--:-- --:--:-- 3696k
File type: qemu
***** SET NEXTOS ALPINE 3.20 *****
none
Installing package 'dmidecode'...
Last metadata expiration check: 0:01:32 ago on Tue Nov 12 13:15:48 2024.
Dependencies resolved.
================================================================================
 Package            Architecture    Version               Repository       Size
================================================================================
Installing:
 dmidecode          x86_64          1:3.5-3.el9           baseos           95 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 95 k
Installed size: 254 k
Downloading Packages:
dmidecode-3.5-3.el9.x86_64.rpm                  868 kB/s |  95 kB     00:00    
--------------------------------------------------------------------------------
Total                                           332 kB/s |  95 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : dmidecode-1:3.5-3.el9.x86_64                           1/1 
  Running scriptlet: dmidecode-1:3.5-3.el9.x86_64                           1/1 
  Verifying        : dmidecode-1:3.5-3.el9.x86_64                           1/1 

Installed:
  dmidecode-1:3.5-3.el9.x86_64                                                  

Complete!
Installing package 'virt-what'...
Last metadata expiration check: 0:01:33 ago on Tue Nov 12 13:15:48 2024.
Dependencies resolved.
================================================================================
 Package            Architecture    Version               Repository       Size
================================================================================
Installing:
 virt-what          x86_64          1.25-5.el9            baseos           33 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 33 k
Installed size: 56 k
Downloading Packages:
virt-what-1.25-5.el9.x86_64.rpm                 1.0 MB/s |  33 kB     00:00    
--------------------------------------------------------------------------------
Total                                           155 kB/s |  33 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : virt-what-1.25-5.el9.x86_64                            1/1 
  Running scriptlet: virt-what-1.25-5.el9.x86_64                            1/1 
  Verifying        : virt-what-1.25-5.el9.x86_64                            1/1 

Installed:
  virt-what-1.25-5.el9.x86_64                                                   

Complete!
VM: false
***** DOWNLOAD VMLNUZ AND INITRD *****
http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/netboot/vmlinuz-lts
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.8M  100 11.8M    0     0  29.4M      0 --:--:-- --:--:-- --:--:-- 29.4M
http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/netboot/initramfs-lts
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 26.4M  100 26.4M    0     0  49.7M      0 --:--:-- --:--:-- --:--:-- 49.6M
***** MOD ALPINE INITRD *****
220065 blocks
https://raw.githubusercontent.com/bin456789/reinstall/main/trans.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  159k  100  159k    0     0   979k      0 --:--:-- --:--:-- --:--:--  973k
https://raw.githubusercontent.com/bin456789/reinstall/main/alpine-network.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11317  100 11317    0     0    98k      0 --:--:-- --:--:-- --:--:--   98k
***** NETWORK INFO *****
IPv4 MAC: xx:xx:xx:xx:xxx:xx
IPv4 Address: xxx.xx.xx.xxx/24
IPv4 Gateway: xxx.xx.xx.xxx
---
IPv6 MAC: xx:xx:xx:xx:xxx:xx
IPv6 Address: xxxx:xxxx:xx:xxxx::1/56
IPv6 Gateway: xxxx:xxxx:xx:xxxx:ff:ff:ff:ff

***** DOWNLOAD GRUB EFI *****
https://mirror.fcix.net/opensuse/tumbleweed/repo/oss/EFI/BOOT/grub.efi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2057k  100 2057k    0     0  2376k      0 --:--:-- --:--:-- --:--:-- 2373k
BootNext: 0000
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0005,0006,0008,0009,000A,0002
Boot0000* reinstall (rocky 9)
Boot0002  UEFI: Built-in EFI Shell
Boot0005* UEFI: Intel(R) I350 Gigabit Network Connection
Boot0006* UEFI: IP4 Intel(R) I350 Gigabit Network Connection
Boot0008* UEFI: Intel(R) I350 Gigabit Network Connection
Boot0009* UEFI: IP4 Intel(R) I350 Gigabit Network Connection
Boot000A* UEFI: Built-in EFI Shell
***** ERROR *****
Error: OS across 2 disk: sda
sdb

再次执行同样的命令提示

File type: qemu
***** SET NEXTOS ALPINE 3.20 *****
none
VM: false
Boot entry 0001 does not exist
***** ERROR *****
Error: Line 3489 return 17
        efibootmgr | grep -q 'BootNext:' && efibootmgr --quiet --delete-bootnext
bin456789 commented 5 days ago

脚本目前不支持软raid 发下 lsblk -f 的输出,我完善下脚本

LemonZuo commented 5 days ago
[rocky@ns5002145 ~]$ sudo -i
[root@ns5002145 ~]# lsblk -f
NAME    FSTYPE            FSVER            LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                        
├─sda1  vfat              FAT16            EFI_SYSPART DD0C-EC08                             508.3M     0% /boot/efi
├─sda2  linux_raid_member 1.2              md2         fbc966db-7a66-01a3-21ea-63b09573e5ae                
│ └─md2 xfs                                boot        8c54af98-3458-48fe-90a3-dc8526d9c220  605.8M    40% /boot
├─sda3  linux_raid_member 1.2              md3         363b036b-412c-e98a-a08d-34e1744ff29c                
│ └─md3 xfs                                root        0ea433ad-b411-443b-b9d2-b80ea386d090  442.8G     0% /
├─sda4  swap              1                swap-sda4   944a0edb-b71f-4a56-a190-4f3d706610ee                [SWAP]
└─sda5  iso9660           Joliet Extension config-2    2024-11-12-15-02-27-00                              
sdb                                                                                                        
├─sdb1  vfat              FAT16            EFI_SYSPART DD16-BF2E                                           
├─sdb2  linux_raid_member 1.2              md2         fbc966db-7a66-01a3-21ea-63b09573e5ae                
│ └─md2 xfs                                boot        8c54af98-3458-48fe-90a3-dc8526d9c220  605.8M    40% /boot
├─sdb3  linux_raid_member 1.2              md3         363b036b-412c-e98a-a08d-34e1744ff29c                
│ └─md3 xfs                                root        0ea433ad-b411-443b-b9d2-b80ea386d090  442.8G     0% /
└─sdb4  swap              1                swap-sdb4   3922f675-40aa-42fc-9fc0-036d41e3ea3c                [SWAP]
[root@ns5002145 ~]#