安装后断电后分区消失

我的笔记本电脑上安装了Ubuntu 14.04 LTS。 过了一会儿,我有一些麻烦启动它。 我决定重新安装Ubuntu。

我有3个ntfs分区,2个ext3分区,第一个的挂载点是/和第二个是./local和交换分区。 在重新安装过程中,我选择了选项:“擦除Ubuntu 14.04并重新安装”。

在重新安装过程中,电源切断。 再次工作后,我打开笔记本电脑,尝试重新启动安装过程。 我找不到除以下选项之外的任何选项:

  1. 擦除磁盘并安装Ubuntu
  2. 还有别的

当我选择Something else 我看不到我的分区 。 相反,我发现了这个:

 Device Type Mount point Format? Size Used System /dev/mapper/ubuntu--vg-root /dev/mapper/ubuntu--vg-root ext4 631381 MB unknown Linux device-mapper (linear)(631.4 GB) /dev/mapper/ubuntu-vg-swap_1 /dev/mapper/ubuntu-vg-swap_1 swap 8493 MB unknown /dev/sda /dev/sda1 ext2 254 MB 27 MB /dev/sda5 639877 MB unknown 

在Testdisk阶段我有这个:

Testdisk

首先要做的是获取驱动器的取证副本。 完全复制驱动器使您可以灵活地修复副本上的问题,同时确保不会对原件造成进一步损坏。 我喜欢dc3dd比dd更好,因为dc3dd在运行时提供进度报告。

编辑:较新版本的dd现在包含一个进度报告,其中switch status=progress 。 看你的man dd是否确实看到了man dd

1)从实时媒体USB或DVD启动 – 选择“尝试Ubuntu”

2)在提示输入时用CTRL – ALT – T打开一个终端

which dc3dd

这只是一种快速查看是否为法医图像安装了正确工具的方法。 如果它以类似的路径响应

/usr/bin/dc3dd

我们有它。 如果没有,我们必须安装并输入

在继续执行第3步之前, sudo apt-get install dc3dd

3)确定您的源(旧)驱动器名称是什么这可能是/ dev / sda但是为了确保在下面的附加图像中使用来自GUI的磁盘,您可以看到我的sda1是带有2个64GB分区的128GB驱动器。

Recovery1

4)连接新驱动器使用GUI中的磁盘validation设备名称做笔记! 旧磁盘将被称为源,而新磁盘将被称为目标。 所以在这个例子中,source = / dev / sda和target将是/ dev / sdb或它在Disks中所说的任何内容

现在我们有了一个计划,我们将使用dc3dd将源复制到目标。

5)在终端发出命令

dc3dd if=/dev/sdX of=/dev/sdY更改X以匹配源(可能是a)和Y匹配目标(可能是b或c) 检查您的注释并确保您拥有此权限!

注意:要创建映像而不是将= / dev / sdY的物理驱动器更改为= diskimage.dd

虽然我们正在将源驱动器复制到目标,以确保我们可以随时返回,以防出现问题并且我们不会比以前更糟糕,我们应该熟悉一般的分区。 可以在http://www.tomshardware.com/forum/270354-32-understnading-extended-logical-primary-partitions上找到一篇好的文章。这些知识将在后面的过程中发挥作用。

6)当副本完成关闭时,断开驱动器标记的源(旧驱动器)并将其放在安全的地方。

7)使用附带目标(新驱动器)的Live DVD / USB再次启动机器。

8)我们将安装testdisk以恢复目标驱动器上的分区,该分区现在与数据方面的源相同。

打开终端并发出命令

sudo apt-get install testdisk

9)安装完成后,我们发出命令testdisk

以下示例步骤来自非常好的分步教程源

 One condition: TestDisk must be executed with Administrator privileges. Important points for using TestDisk: To navigate in TestDisk, use the Arrow and PageUp/PageDown keys. To proceed, confirm your choice(s) with the Enter key. To return to a previous display or quit TestDisk, use the q (Quit) key. To save modifications under TestDisk, you must confirm them with the y (Yes) and/or Enter keys, and To actually write partition data to the MBR, you must choose the "Write" selection and press the Enter key. 

日志创建 创建日志

 Choose Create to instruct Testdisk to create a log file containing technical information and messages, unless you have a reason to append data to the log or you execute TestDisk from read only media and must create the log elsewhere. Choose None if you do not want messages and details of the process to be written into a log file (useful if for example Testdisk was started from a read-only location). Press Enter to proceed. 

磁盘选择

应检测所有硬盘驱动器,并使用TestDisk:磁盘选择以正确的大小列出

 Use up/down arrow keys to select your hard drive with the lost partition/s. Press Enter to Proceed. 

分区表类型选择

TestDisk显示分区表类型。 菜单分区表类型

 Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type. Press Enter to Proceed. 

当前分区表状态

TestDisk显示菜单(另请参见TestDisk菜单项)。 菜单

 Use the default menu "Analyse" to check your current partition structure and search for lost partitions. Confirm at Analyse with Enter to proceed. 

现在,列出了您当前的分区结构。 检查当前的分区结构是否缺少分区和错误。 分析

第一个分区列出两次,指向损坏的分区或无效的分区表条目。 无效的NTFS引导指向错误的NTFS引导扇区,因此它是一个损坏的文件系统。 扩展分区中只有一个逻辑分区(标签分区2)可用。 缺少一个逻辑分区。

 Confirm at Quick Search to proceed. 

快速搜索分区TestDisk实时显示第一批结果。
快速搜索

在快速搜索期间,TestDisk发现了两个分区,包括缺少标记为分区3的逻辑分区。 第一个结果

 Highlight this partition and press p to list your files (to go back to the previous display, press q to Quit, Files listed in red are deleted entries). 

正确列出所有目录和数据。

 Press Enter to proceed. 

保存分区表还是搜索更多分区? 菜单搜索!

 When all partitions are available and data correctly listed, you should go to the menu Write to save the partition structure. The menu Extd Part gives you the opportunity to decide if the extended partition will use all available disk space or only the required (minimal) space. Since a partition, the first one, is still missing, highlight the menu Deeper Search (if not done automatically already) and press Enter to proceed. 

仍然缺少分区:更深入的搜索

更深入的搜索还将搜索FAT32备份启动扇区,NTFS备份启动超级块,ext2 / ext3备份超级块以检测更多分区,它将扫描每个柱面

在深层搜索之后,结果显示如下:使用备份引导扇区找到第一个分区“分区1”。 在显示的最后一行,您可以阅读消息“使用备份扇区找到NTFS!” 和分区的大小。 “分区2”以不同的大小显示两次。 如果您将其列为已删除,则列为D(eleted)的分区将无法恢复。 列出的两个分区都具有已删除的状态D,因为它们彼此重叠。 您需要确定要恢复的分区。 结果更深入搜索!

 Highlight the first partition Partition 2 and press p to list its data. 

上层逻辑分区(标签分区2)的文件系统已损坏
损坏的文件系统(点击拇指)。

 Press q for Quit to go back to the previous display. Let this partition Partition 2 with a damaged file system marked as D(deleted). Highlight the second partition Partition 2 below Press p to list its files. 

列表文件

它工作正常,你的文件列出,你找到了正确的分区!

 Use the left/right arrow to navigate into your folders and watch your files for more verification 

注意:FAT目录列表限制为10个群集 – 某些文件可能不会出现,但不会影响恢复。

 Press q for Quit to go back to the previous display. The available status are Primary, * bootable, Logical and Deleted. 

使用向左/向右箭头键,将所选分区的状态从D(eleted)更改为L(逻辑)。 这样您就可以恢复此分区。 设置分区以恢复

提示:阅读如何识别主分区和逻辑分区? 注意:如果列出了*(可引导)分区,但如果不从此分区引导,则可以将其更改为主分区。

 Press Enter to proceed. 

分区表恢复

现在可以编写新的分区结构。 注意:自动设置扩展分区。 TestDisk使用不同的分区结构识别这一点。 菜单写

 If all partitions are listed and only in this case, confirm at Write with Enter, y and OK. 

现在,分区已在分区表中注册。 NTFS引导扇区恢复

名为Partition 1的第一个分区的引导扇区仍然损坏。 是时候解决它了。 NTFS引导扇区的状态很差,备份引导扇区有效。 引导扇区不相同。 备份bs

 To copy the backup of the boot sector over the boot sector, select Backup BS, validate with Enter, use y to confirm and next OK. 

有关在TestDisk菜单项下修复引导扇区的更多信息。 将显示以下消息: 备份后bs

引导扇区及其备份现在都正常且完全相同:NTFS引导扇区已成功恢复。

 Press Enter to quit. 

重启

 TestDisk displays You have to restart your Computer to access your data so press Enter a last time and reboot your computer. 

来自cgsecurity的结束说明

如果驱动器受到物理损坏,我们需要使用ddrescue采用不同的方法