我对之前在这里提供的模糊信息表示歉意。我是通过手机发帖的,现在我正在使用 Ubuntu i 的 USB“尝试”模式。基本上,我使用 SSD 安装 Ubuntu 18.04。它只有 250GB,而且由于 Ubuntu 是我的日常驱动程序,所以我想将我的 /home 目录移动到我的 1TB 硬盘上,这样我就有更多的文件空间。这些是我遵循的步骤:
# To temporarily mount the new partition
sudo mkdir /mnt/tmp
sudo mount /dev/sda1 /mnt/tmp
# Copy HOME to the new location
sudo rsync -avx /home/ /mnt/tmp
sudo mount /dev/sda1 /home
#this is where i had an error
sudo umount /home #got message that device is busy and cannot unmount
# the guide i followed said to unmount and then use rm -rf /home/* but i used
rm -rf /dev/nvme0n1 /home/*
# I got error: this directory is not empty, the guide i used said to reboot if this happened.
#Make HOME permanent
sudo blkid
#copy UUID, then paste in fstab
sudo nano /etc/fstab
#add following line at the end
UUID=<noted number from above> /home ext4 defaults 0 2
#then reboot
通过重新阅读指南,我发现了我犯的一个错误,我只是删除了已经存在“/home”的行上的 UUID,并将其替换为新驱动器的 UUID。
但之后我重新启动了计算机,现在我的计算机直接进入 BIOS 并且找不到任何可启动的驱动器。
输出sudo fdisk -l
Disk /dev/loop0: 1.8 GiB, 1905045504 bytes, 3720792 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/loop1: 91 MiB, 95408128 bytes, 186344 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/loop2: 34.6 MiB, 36216832 bytes, 70736 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/loop3: 140.7 MiB, 147496960 bytes, 288080 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/loop4: 2.3 MiB, 2355200 bytes, 4600 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/loop5: 13 MiB, 13619200 bytes, 26600 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/loop6: 14.5 MiB, 15208448 bytes, 29704 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/loop7: 3.7 MiB, 3878912 bytes, 7576 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/nvme0n1: 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: gpt
Disk identifier: 611E8FFB-79C8-4D36-A5F7-F177138D442B
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 999423 997376 487M Linux swap
/dev/nvme0n1p2 999424 24436735 23437312 11.2G Linux filesystem
/dev/nvme0n1p3 24436736 488396799 463960064 221.2G Linux filesystem
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E4025E76-690C-4779-BBBD-0996D3C7146E
Device Start End Sectors Size Type
/dev/sda1 2048 1953523711 1953521664 931.5G Linux filesystem
Disk /dev/sdb: 57.9 GiB, 62109253632 bytes, 121307136 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: 0x65092a4c
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 121307135 121305088 57.9G c W95 FAT32 (LBA)
Disk /dev/sdc: 7.5 GiB, 8021606400 bytes, 15667200 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: 0x40993ab6
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 0 3899391 3899392 1.9G 0 Empty
/dev/sdc2 3830956 3835883 4928 2.4M ef EFI (FAT-12/16/32)
我刚刚尝试sudo gedit
打开 fstab 文件并通过将带有 /home 的分区的 UUID 放在我编辑它的文件中来编辑它。当我重新启动时,还是一样,没有可启动的设备。
以下是按要求进行的 Boot-Repair 的输出 http://paste.ubuntu.com/p/rVGCm8pYp7/ --- 已更新,另一个因为插入的闪存驱动器而混乱。
我知道我做了什么,当我尝试设置我的辅助硬盘以用作数据驱动器时,我在尝试这些步骤之前重新格式化了它。这样做时,我必须也格式化该驱动器上的 EFI 分区,因此 UEFI 启动无法找到它。
答案1
好的伙计们,在 rtaft 的帮助下我找到了答案。非常感谢。
首先,如果您使用的是 UEFI 启动,请不要格式化安装了 Windows 的硬盘……这将导致您的计算机不知道如何启动。这是因为默认的 ubuntu 安装程序将使用现有的 EFI 进行启动,而不是创建一个。
因此,幸好我在安装时进行了自定义分区,因此在 nvme 驱动器的起始位置有大约 400mb 的空闲空间用于 Linux 交换。所以我只是将其大小减小到 200mb。然后使用 Gparted 将其分区为未格式化且带有 bios_grub 标志。
从那里我只需运行 boot-pair 推荐的修复程序,它就会在未格式化的分区中安装 grub。现在我的电脑可以正常启动了。
感谢大家的帮助。