Ubuntu 安装程序:“这台计算机未检测到操作系统。”

Ubuntu 安装程序:“这台计算机未检测到操作系统。”

这个问题已被问过无数次,并有无数个答案,但我找不到一个可以解决我的问题。

我只安装了一个操作系统:Ubuntu 16.04 32 位。我想将其更改为 Ubuntu 16.04 64 位。当我尝试安装时,安装程​​序未检测到操作系统并建议擦除整个磁盘,这不是我想要的。

我尝试运行 fixparts 并重写了分区表。但这并没有改变问题。

我已经尝试了 UEFI 和 BIOS 模式。

我以前安装时也遇到过这种情况,不得不“做点别的”并手动分配根分区。但我总是觉得这很麻烦。如果 Ubuntu 能建议采取适当的措施,用新安装替换 32 位启动分区 (sda1),我会非常高兴。

也许下一步是运行 ubiquity 的调试模式,看看是否能找到线索。否则,我将不得不进一步挖掘,从 /usr/lib/ubiquity/plugins/ubi-partman.py 中的“def calculate_operating_systems”开始。

# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial

# sudo fdisk -l

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disk identifier: 0x000a2f5d

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sda1  *         2048     499711     497664   243M 83 Linux
/dev/sda2          501759  312580095  312078337 148.8G  f W95 Ext'd (LBA)
/dev/sda3       312580096 3907028991 3594448896   1.7T 83 Linux
/dev/sda5          501760  312580095  312078336 148.8G 8e Linux LVM

Partition table entries are not in disk order.


Disk /dev/mapper/merlot-root: 146 GiB, 156703391744 bytes, 306061312 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


Disk /dev/mapper/merlot-swap_1: 2.9 GiB, 3078619136 bytes, 6012928 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

# sudo dmsetup deps -o devname
merlot-swap_1: 1 dependencies   : (sda5)
merlot-root: 1 dependencies : (sda5)

# sudo dmsetup -v table /dev/mapper/merlot-root
Name:              merlot-root
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      252, 0
Number of targets: 1
UUID: LVM-nCfFBn74k3QnfrxB0ZX41AxLnua9hTryu96VYKllCnGIJbKdvlPTWshZbejIqeJU

0 306061312 linear 8:5 384

通过删除启动板错误修复 #1265192,我能够让安装程序识别 Ubuntu。这是删除错误修复之前我的系统上的 misc.py 代码和 syslog 输出。

for res in result:
            syslog.syslog(res)
            res = res.split(':')
            # launchpad bug #1265192, fix os-prober Windows EFI path
            res[0] = re.match(r'[/\w\d]+', res[0]).group()
            if res[2] == 'Ubuntu':
                version = [v for v in re.findall('[0-9.]*', res[1]) if v][0]
                # Get rid of the superfluous (development version) (11.04)
                text = re.sub('\s*\(.*\).*', '', res[1])
                _os_prober_oslist[res[0]] = text
                _os_prober_osvers[res[0]] = version
                syslog.syslog(res[0])
                syslog.syslog(text)
                syslog.syslog(version)
            else:
                # Get rid of the bootloader indication. It's not relevant here.
                _os_prober_oslist[res[0]] = res[1].replace(' (loader)', '')
    return _os_prober_oslist, _os_prober_osvers

May 15 14:44:11 ubuntu os-prober: debug: os detected by /usr/lib/os-probes/50mounted-tests
May 15 14:44:11 ubuntu ubiquity[18280]: /dev/mapper/merlot-root:Ubuntu 16.04.1 LTS (16.04):Ubuntu:linux
May 15 14:44:11 ubuntu ubiquity[18280]: /dev/mapper/merlot
May 15 14:44:11 ubuntu ubiquity[18280]: Ubuntu 16.04.1 LTS
May 15 14:44:11 ubuntu ubiquity[18280]: 16.04.1
May 15 14:44:11 ubuntu ubiquity[18280]: Device /dev/mapper/merlot-swap_1 not found in os-prober output
May 15 14:44:11 ubuntu ubiquity[18280]: Device /dev/sda1 not found in os-prober output
May 15 14:44:11 ubuntu ubiquity[18280]: Device /dev/sda5 not found in os-prober output
May 15 14:44:11 ubuntu ubiquity[18280]: Device /dev/sda3 not found in os-prober output
May 15 14:44:11 ubuntu ubiquity[18280]: Device /dev/mapper/merlot-root not found in os-prober output
May 15 14:44:11 ubuntu ubiquity[18280]: switched to page partman

我不是 Python 程序员,但是

res[0] = re.match(r'[/\w\d]+', res[0]).group()

需要

/dev/mapper/merlot-root

并使其

/dev/mapper/merlot

然后 Ubiquity 就无法找到该驱动器。

唉,一旦我评论了错误修复并选择“替换 ubuntu”选项,安装仍然失败,因此需要做更多的工作来解决这个问题。

我已经在这上面花了足够多的时间,所以我打算做“其他事情”并手动安装。

相关内容