首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我的Ubuntu分区消失了吗?

问我的Ubuntu分区消失了吗?
EN

Ask Ubuntu用户
提问于 2016-01-25 21:03:42
回答 1查看 2.3K关注 0票数 0

我有一台Ubuntu和Win10双引导机。窗户是用水管冲洗的,我用unetbootin修复了它。Ubuntu消失了,即有Ubuntu和Win的启动菜单消失了。现在我只有Win10了。

我尝试过使用unetbootin和一个活动的Ubuntu磁盘来修复Ubuntu,但是它什么也没做(虽然我没有尝试高级选项,只是默认的)。

我并不真正理解分区,但我认为我的Ubuntu已经被Windows/unetbootin覆盖了。我能把Ubuntu找回来吗?

测试盘显示我的分区如下所示

sda看起来像这样

蒂娅!

EN

回答 1

Ask Ubuntu用户

发布于 2016-01-26 00:37:00

乍一看,Windows 10并没有重写驱动器的分区表,所以主引导记录就被更改了。您需要做的是恢复MBR,我认为可以用一个名为“g期”的Linux工具来完成。您可能需要下载此工具。http://gparted.org/download.php注意它给你的所有警告。备份所有数据并备份当前(坏的) MBR。一旦您在运行ubuntu的USB中启动,或者从站点上可用的ISO制作的live或USB启动,您就可以从USB上运行。这意味着在CD或USB上制作一个实时的ISO映像,并从USB启动以便运行gparted。也有一个免费的工具来恢复运行在windows上的MBR,但我怀疑您是否能够从windows恢复旧的MBR。总是使用备份的MBR。Windows安装有自己的想法。对我起作用的是下载一个ISO的ubuntu,这是可启动的选择USB,然后使用加载的副本,在该USB。您不能用分区管理器更改挂载驱动器,所以卸载驱动器以便重新分区或将MBR更改为一个引导Linux和windows的驱动器。由于您的分区表似乎仍然完好无损,我建议您做一个新的MBR,这是双重启动。

访问GParted应用程序所有功能的最佳方法是使用GParted Live映像。GParted Live允许您在GNU和其他操作系统(如Windows或Mac )上使用GParted。

修复操作系统启动问题

“执行下列操作之一时,计算机可能无法启动操作系统:

代码语言:javascript
复制
Delete a partition.

Move a partition.

***Install another operating system and overwrite the Master Boot Record (MBR).*** 

幸运的是,引导失败通常是可以修复的。

如果您的计算机使用GRUB引导加载程序,请参阅名为“修复GRUB引导问题”的部分,以恢复启动能力。

如果您的计算机不使用GRUB,则建议您查阅文档以了解如何解决问题。您可以参考GParted常见问题或GParted论坛。你也可以上网了解其他人是如何解决类似问题的。“

修复GRUB引导问题

许多GNU/Linux发行版都使用Grand Unified加载程序(GRUB)。要修复GRUB引导问题,首先要确定使用了哪个主要版本的GRUB。

GRUB有两个主要版本:

代码语言:javascript
复制
GRUB, also known as GRUB 2, covers versions 1.98 and higher. GRUB 2 works with both GUID partition tables (GPT) and msdos partition tables.

GRUB Legacy, traditionally known as GRUB, covers versions 0.9x and earlier. GRUB Legacy works with msdos partition tables only. 

GRUB 2在以下GNU/Linux发行版中用作默认的引导加载程序:

代码语言:javascript
复制
CentOS 7 and higher

Debian 6 (Squeeze) and higher

Fedora 16 (Verne) and higher

openSUSE 12.2 and higher

Ubuntu 9.10 (Karmic Koala) and higher 

如果您不确定您的计算机是使用GRUB 2还是GRUB遗产,您可以尝试在Internet上搜索答案。

恢复GRUB 2引导装载机

使用以下步骤还原GRUB 2引导加载程序:

代码语言:javascript
复制
Boot from Live media such as GParted Live or your GNU/Linux distribution image. Open a terminal window.

Determine which partition contains the / file system for your GNU/Linux distribution.

Use GParted to list the partitions on your disk device. Look for a partition that contains your GNU/Linux / file system. This Linux partition will likely use a file system such as ext2, ext3, ext4, or btrfs.

备注

如果/分区位于LVM上,那么逻辑卷管理器必须是活动的。可以使用以下命令启动LVM:

vgchange -a y

对于LVM,相当于磁盘分区的是逻辑卷。可以使用以下命令列出逻辑卷:

lvscan

代码语言:javascript
复制
 Create a mount point directory by entering (as root):

# mkdir /tmp/mydir

Mount the / partition on the mount point directory. For example assume the / file system is contained in the /dev/sda5 partition. Enter (as root):

# mount /dev/sda5 /tmp/mydir

If you have a separate /boot partition, for example at /dev/sda3, then an extra step is required. Mount the /boot partition at /tmp/mydir/boot by entering (as root):

# mount /dev/sda3 /tmp/mydir/boot

Note

If you do not know whether you have a separate boot partition then you probably do not and can ignore this step.

Prepare to change the root environment by entering (as root):

# mount --bind /dev /tmp/mydir/dev

# mount --bind /proc /tmp/mydir/proc

# mount --bind /sys /tmp/mydir/sys

Change the root environment by entering (as root):

# chroot /tmp/mydir

Reinstall GRUB 2 on the boot device. Note that the device name is used and not the partition name. For example, if the / partition is /dev/sda5 then the device is /dev/sda.

For Debian, Ubuntu, and other offshoot GNU/Linux distributions, enter the command (as root):

# grub-install /dev/sda

For CentOS, Fedora, openSUSE and other offshoot GNU/Linux distributions, enter the command (as root):

# grub2-install /dev/sda

Exit the chroot environment by entering (as root):

# exit

Reboot your computer. 

恢复GRUB遗产引导加载器

使用以下步骤还原GRUB引导加载程序:

代码语言:javascript
复制
Boot from Live media such as your GNU/Linux distribution image. Open a terminal window.
Note

The Live media must contain the GRUB Legacy boot loader. If your GNU/Linux distribution uses GRUB Legacy, then the distribution Live media will also contain GRUB Legacy.

Start the grub application from the command line (as root).

# grub

Find where grub stage1 is located by using one of the following:

If the /boot folder is stored in the / partition, use the command:

grub> find /boot/grub/stage1

If the /boot folder is stored in a partition different than the / partition, use the command:

grub> find /grub/stage1

The output from the find command might look like the following:

 (hd0,0)

If more than one line is listed in the command output, you will need to decide which device you use for grub.

Set the grub root device by specifying the device returned by the find command.

grub> root (hd0,0)

Reinstall grub by specifying the device returned by the find command.

grub> setup (hd0,0)

Exit grub.

grub> quit

Reboot your computer. 

*************************************************8

*强文本*RTFM!

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/725581

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档