我正在安装超级账本结构在 Ubuntu 18.04.3 桌面上,通过 sudo -E 执行此文件https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh以及另一个类似的。
但安装完成后,似乎一切顺利,但我无法再使用 Ubuntu,重新启动时只会出现橙色屏幕。
通过 iso-image usb,我访问了“尝试 Ubuntu”选项,打开了一个终端,并安装了 Boot-Repair 工具。
这是我收到的启动修复报告:http://paste.ubuntu.com/p/KVg3BCSGpd/
尝试遵循此处的指示:有没有办法通过 grub 菜单从 usb 启动? 和这里:https://www.youtube.com/watch?v=P3O_FjPu7vw
我编辑了:
grub rescue> ls
(hd0) (hd0, msdos1) (hd1) (hd1,msdos1)
grub rescue> ls (hd0)/
error: unknown filesystem
grub rescue> ls(hd0,msdos1)/
error: unknown filesystem
grub rescue> ls (hd1)/
error: unknown filesystem
grub rescue> ls (hd1,msdos1)/
error: unknown filesystem
grub rescue> set
cmdpath=(hd0)
prefix=(hd0,msdos1)/boot/grub
但是 Boot-Repair 说:
sda1:
File system: LVM2_member
Boot sector type: -
Boot sector info:
sdb1:
File system: LVM2_member
Boot sector type: -
Boot sector info:
ubuntu-vg-root:
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 18.04.4 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab
/boot/grub/i386-pc/core.img
ubuntu-vg-swap_1:
File system: swap
Boot sector type: -
Boot sector info:
Drive/Partition Info:
Drive: sda
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Partition Boot Start Sector End Sector # of Sectors Id
System
/dev/sda1 2,048 488,396,799 488,394,752 8e Linux LVM
在显示“尝试 Ubuntu”(iso 映像 usb)的终端中,我尝试使用 sudo update-grub:
ubuntu@ubuntu: ~$ sudo update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of '/cow'
然后我遵循了以下指示: 无法获取 /cow 的规范路径
然后我得到了“LVM2_member”:
ubuntu@ubuntu:~$ sudo mkdir /mnt/chroot
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt/chroot
mount: /mnt/chroot: unkown filesystem type 'LVM2_member'
但是使用 vgdisplay
ubuntu@ubuntu:~$ sudo vgdisplay
-- Volume group --
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size <465,77 GiB
PE Size 4.00 MiB
VG UUID frpHze-BaQY-T18Q-u5dc-TJH2-NNyp-1T6SsT
ubuntu@ubuntu:~$ sudo lvscan
ACTIVE '/dev/ubunstu-vg/root' [<463.93 GiB] inherit
ACTIVE '/dev/ubuntu-vg/swap_1' [980.00 MiB] inherit
在 iso-image usb 提供的“尝试 Ubuntu”终端中,我尝试了:
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# mount /dev/mapper/ubuntu--vg-root /mnt
root@ubuntu:/home/ubuntu# cd /mnt
root@ubuntu:/mnt# mount -t devtmpfs none dev
root@ubuntu:/mnt# mount -t sysfs none sys
root@ubuntu:/mnt# mount -t proc proc proc
root@ubuntu:/mnt# chroot .
chroot: failed to run command 'bin/bash': No such file or directory
root@ubuntu:/mnt# ls -lah /bin grep bash
-rwxr-xr-x 1 root root 1.1M Jun 6 2019 bash
从这些迹象来看: https://unix.stackexchange.com/questions/338280/chroot-doesnt-find-bin-bash?rq=1
我读到可能是“文件 filename 或脚本或 ELF 解释器不存在,或者找不到文件或解释器所需的共享库”。但如何实际解决它呢?
更新:
也许对整个 /bin 目录进行强制复制并保留所有到 /mnt 的链接使得 /bin/bash 可以通过 chroot 看到和使用: https://drive.google.com/open?id=13a9bgNYzvCzUC6dO1wR5Wx7KlvojVMri
但是我收到了这个错误:
mapdevfs: error while loading shared libraries: libdebian-
installaer.so.4: cannot open shared object file: No such file or
directory
我再次尝试重新安装 grub 并收到此错误:
root@ubuntu:/# grub-install /dev/sda
Installing for i386-pc platform.
WARNING: Failed to connect to lvmetad. Falling back to device
scanning
Installation finished. No error reported.
root@ubuntu:/# grub-install /dev/sdb
Installing for i386-pc platform
WARNING: Failed to connect to lvmetad. Falling back to device
scanning
安装完成。未报告任何错误
https://drive.google.com/open?id=13bHrF1UGcWicVL4aXQfJm4N2odKdWp0B
这是我最后一次尝试更新 grub 的结果:
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# mount /dev/mapper/ubuntu--vg-root /mnt
mount: /mnt: /dev/mapper/ubuntu--vg-root already mounted on /mnt.
root@ubuntu:/home/ubuntu# cd /mnt
root@ubuntu:/mnt# mount -t devtmpfs none dev
mount: /mnt/dev: none already mounted on /mnt/dev.
root@ubuntu:/mnt# mount -t sysfs none sys
mount: /mnt/sys: none already mounted on /mnt/dev.
root@ubuntu:/mnt# mount -t proc proc proc
mount: /mnt/proc: proc already mounted on /proc.
root@ubuntu:/mnt# chroot .
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found initrd image: /boot/initrd.img-5.3.0-28-generic
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Found linux image: /boot/vmlinuz-5.0.0-23-generic
Found initrd image: /boot/initrd.img-5.0.0-23-generic
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
mapdevfs: error while loading shared libraries: libdebian-installer.so.4:
cannot open shared object file: No such file or directory
log-output: error while loading shared libraries: libdebian-
installer.so.4: cannot open shared object file: No such file or directory
mapdevfs: error while loading shared libraries: libdebian-installer.so.4:
cannot open shared object file: No such file or directory
mapdevfs: error while loading shared libraries: libdebian-installer.so.4:
cannot open shared object file: No such file or directory
mapdevfs: error while loading shared libraries: libdebian-installer.so.4:
cannot open shared object file: No such file or directory
mapdevfs: error while loading shared libraries: libdebian-installer.so.4:
cannot open shared object file: No such file or directory
Adding boot menu entry for EFI firmware configuration
done
重大更新:重启系统现在一切正常。经验教训:每次安装新东西时,都要检查并验证它可能会产生一些副作用
期待您的帮助。Marco