歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 安裝 Windows 7 之後再安裝 Ubuntu 11.04 處理方法

安裝 Windows 7 之後再安裝 Ubuntu 11.04 處理方法

日期:2017/2/28 16:17:04   编辑:Linux教程

搞清楚是 Adobe 造的孽, 因此這個問題已經在 Launchpad 上面標記為危急級別 (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/730225)。

如果你尚未安裝 Ubuntu 11.04 Natty,現在請先緩一緩;如果已經是受害者了,請

1.進入 Ubuntu,運行 sudo dpkg-reconfigure grub-pc 稍後會讓你選擇 Grub 的安裝目標。在這裡取消對/dev/sda 的選擇,無視警告,改為選擇 Ubuntu 安裝的分區,這樣做可以在 Ubuntu 沒有修復這個問題之前,在 grub 軟件包升級的 時候避免再一次破壞 NTFS 分區。

2.找張 Win7 的安裝盤,進入 PE 之後執行 chdksk c: /f 然後重啟,再次進入 Ubuntu。

3.執行 sudo update-grub 這時候應該可以重新找到 Windows 的啟動項,而且 Windows 應該能夠正常進入了。

4.如果有必要,請使用 sudo dd if=/dev/sda of=/ubuntu.mbr bs=446 count=1 把 MBR 備份出來,復制到一個 Windows 認識的分區,然後到 Windows 下面添加啟動項。這樣 可以避免一旦重裝 Windows 之後 Ubuntu 進不去的尴尬局面。

Bug Description
Binary package hint: grub
The new grub-install of natty alpha3 now detects and avoids FlexNet-occupied sectors, but it seems it somehow mishandles something and writes code into after sector 63, thus make the ntfs partition that starts there unbootable and unreadable.
I have tested with a memory stick /dev/sdc partitioned like this:
ubuntu@ubuntu:~$ sudo fdisk -lu /dev/sdc
Disk /dev/sdc: 16.2 GB, 16236085248 bytes
255 heads, 63 sectors/track, 1973 cylinders, total 31711104 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 identifier: 0x00063979
Device Boot Start End Blocks Id System
/dev/sdc1 63 25671869 12835903+ 7 HPFS/NTFS
/dev/sdc2 25671870 31696244 3012187+ 83 Linux
/dev/sdc1 was not mounted.
/dev/sdc2 was mounted on /mnt.
Then I downloaded FlexNet signature at http://forum.ubuntu.com.cn/viewtopic.php?f=49&t=320155&start=30
unzipped flexnet.sector32.zip, and wrote into sector32:
sudo dd if=flexnet.sector32 of=/dev/sdc seek=32
ran grub-install, it detected and avoided that sector:
ubuntu@ubuntu:~$ sudo grub-install /dev/sdc --root-directory=/mnt
/usr/sbin/grub-setup: warn: Sector 32 is already in use by 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.
NTFS partition /dev/sdc1 was now trashed. By design, the last sector of ntfs is a backup of its boot sector, so I copied the last sector of /dev/sdc1 to its first sector and successfully recovered the file system:
ubuntu@ubuntu:~$ sudo dd if=/dev/sdc of=/dev/sdc count=1 seek=63 skip=25671869
I took a further look at the sectors and found that the first sector of the partition was not the only sector that was overwritten by grub, and was surprised that by recoverying only the first sector the whole file system seemed good.
By removing the FlexNet signature, grub-install never overwrite the NTFS sectors again.
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: grub (not installed)
ProcVersionSignature: Ubuntu 2.6.38-5.32-generic 2.6.38-rc6
Uname: Linux 2.6.38-5-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Sun Mar 6 17:43:14 2011
LiveMediaBuild: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110302)
ProcEnviron:
LANGUAGE=en_US:en
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: grub
UpgradeStatus: No upgrade log present (probably fresh install)

Copyright © Linux教程網 All Rights Reserved