看起来,在我尝试更新启动菜单时,我彻底搞砸了,因为我删除了之前使用 live usb 安装 ubuntu 留下的两个未知分区。我不小心将 grub 发送到了 sdc 而不是 sda,现在计算机找不到分区列表。sda1 放错了位置,但并没有消失,sda6 是 Ubuntu 16.04。我以为我可以通过重新安装 Ubuntu 14.04 来找回 grub,但它在停止之前就卸载了 Windows。如果我正常启动它,我得到的只是最小的 bin-bash grub。我必须使用带有 14.04 的 live usb,因为我搞砸了时使用的 16.04 驱动器损坏了。有没有办法挽救这场灾难,以便我至少可以重新启动它?任何帮助我都会非常感激。以下是发生的事情:
ubuntu@ubuntu:~$ sudo blkid -o list
device fs_type label mount point UUID
/dev/loop0 squashfs /rofs
/dev/sda1 ntfs PQSERVICE (not mounted) DE221B70221B4CC1
/dev/sda2 ntfs SYSTEM RESERVED (not mounted) 4CF01BBFF01BAE68
/dev/sda3 ntfs Acer (not mounted) 08EA1D44EA1D3004
/dev/sda5 swap <swap> e9ad90ad-f73a-49b0- b3fb-a4ae29b3aac7
/dev/sda6 ext4 (not mounted) 7021ee40-917c-4354-8fce-01e3cf0f1858
/dev/sdb1 vfat UBUNTU 1404 /cdrom 8699-B94C
ubuntu@ubuntu:~$ sudo mount /dev/sda6 /mnt
\ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev &&
> sudo mount --bind /proc /mnt/proc &&
> sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/sda
Installing for i386-pc platform.
/proc/devices: fopen failed: No such file or directory
device node not found
/proc/devices: fopen failed: No such file or directory
device node not found
grub-install: warning: Sector 18 is already in use by the program`Acer registration utility (?)'; avoiding it. This software may cause boot or other problems in future. Please ask its authors not to store data in the boot track.
grub-install: warning: Sector 32 is already in use by the program `FlexNet'; avoiding it. This software may cause boot or other problems in future. Please ask its authors not to store data in the boot track.
Installation finished. No error reported.
root@ubuntu:/#
ubuntu@ubuntu:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/cow 2888496 81328 2807168 3% /
/dev 2877008 12 2876996 1% /mnt/dev
tmpfs 577700 1288 576412 1% /run
/dev/sdb1 7801432 1046440 6754992 14% /cdrom
/dev/loop0 975872 975872 0 100% /rofs
none 4 0 4 0% /sys/fs/cgroup
tmpfs 2888496 1072 2887424 1% /tmp
none 5120 4 5116 1% /run/lock
none 2888496 80 2888416 1% /run/shm
none 102400 84 102316 1% /run/user
/dev/sda6 118658332 11728020 100879752 11% /mnt
ubuntu@ubuntu:~$ sudo parted -ls # ... space minus ell ess
Model: ATA WDC WD6400BEVT-2 (scsi)
Disk /dev/sda: 640GB
Sector size (logical/physical): 512B/512B
Partition Table: msdo
Number Start End Size Type File system Flags
1 1049kB 15.0GB 15.0GB primary ntfs diag
2 15.0GB 15.1GB 105MB primary ntfs boot
3 15.1GB 249GB 234GB primary ntfs
4 249GB 640GB 391GB extended
6 249GB 373GB 124GB logical ext4
5 373GB 379GB 6091MB logical linux-swap(v1)
Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sdb: 8004MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 16.4kB 8004MB 8004MB primary fat32 boot
ubuntu@ubuntu:~$ sudo lsblk -fm
NAME FSTYPE LABEL MOUNTPOINT NAME SIZE OWNER GROUP MODE
sda sda 596.2G root disk brw-rw----
├─sda1 ntfs PQSERVICE ├─sda1 14G root disk brw-rw----
├─sda2 ntfs SYSTEM RESERVED ├─sda2 100M root disk brw-rw----
├─sda3 ntfs Acer ├─sda3 218.1G root disk brw-rw----
├─sda4 ├─sda4 1K root disk brw-rw----
├─sda5 swap [SWAP] ├─sda5 5.7G root disk brw-rw----
└─sda6 ext4 /mnt └─sda6 115.1G root disk brw-rw----
sdb sdb 7.5G root disk brw-rw----
└─sdb1 vfat UBUNTU 1404 /cdrom └─sdb1 7.5G root disk brw-rw----
sr0 sr0 1024M root cdrom brw-rw----
loop0 squashfs /rofs loop0 953M root disk brw-rw----
ubuntu@ubuntu:~$ ls -F /boot/grub
gfxblacklist.txt grubenv
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda1': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
答案1
问题解决了。我清空了磁盘并重新安装了 Ubuntu。虽然我丢失了 Windows 和其他所有东西,但计算机现在运行正常。我学会了永远不要弄乱任何可能影响 grub 的东西。只需让那些未知的分区保持原样...