我有一个1TB的东芝硬盘,以前是用fedora来分区,其中一个分区是900多G的空间,放了300多G的数据,最近换了苹果电脑发现,不能够挂载,用了 paragon ntfs for mac 不能够读取,当然是破解版,但我后来明白了就算是用了正版也不能够读取,因为我发现,虽然我给那个分区是用的NTFS格式,但是在苹果的磁盘工具里面是显示的Linux类型,Windows里的磁盘工具也是如此显示,windows里面也不能够挂载,那这个Linux类型的NTFS磁盘工具是什么鬼?并且在windows磁盘工具只能删除这个卷,别的操作都是灰色不可用的,到了这里我以为因为这个磁盘分区没有盘符,所以不能挂载,上网搜索无意间知道了,原来windows还有diskpart这个强大的命令,我真是太孤陋寡闻了,如果不是这个命令,估计到最后我只能要格式化硬盘了,还好,还好。
下面介绍一下操作过程:
一、连接硬盘
把硬盘连接到装有windows系统的电脑上
二、打开cmd(win7以上系统需要以管理员身份运行)
三、disk命令恢复硬盘
1、列出所有磁盘
list disk
2、选择需要操作的磁盘,后面的是编号,已选择磁盘前面有*号
select disk 1
3、列出分区
list partition
4、选择分区,同样的后面是编号,已选择前面有*号
select partition 4
5、查看分区的详细信息(这里很关键)
detail partition
输出:
Partition 4 Type : Linux Hidden: Yes Active: No Offset in Bytes: 52430897152
看见命令输出了吧,类型是Linux,而且还是隐藏的,本来linux分区类型,windows就不直接支持,还加了个隐藏属性,难怪mac和windows都认怂了。
看见这里,我想的是可不可以改分区类型,又不需要清空数据,输入help获取帮助
Microsoft DiskPart version 6.3.9600
ACTIVE - Mark the selected partition as active.
ADD - Add a mirror to a simple volume.
ASSIGN - Assign a drive letter or mount point to the selected volume.
ATTRIBUTES - Manipulate volume or disk attributes.
ATTACH - Attaches a virtual disk file.
AUTOMOUNT - Enable and disable automatic mounting of basic volumes.
BREAK - Break a mirror set.
CLEAN - Clear the configuration information, or all information, off the disk.
COMPACT - Attempts to reduce the physical size of the file.
CONVERT - Convert between different disk formats.
CREATE - Create a volume, partition or virtual disk.
DELETE - Delete an object.
DETAIL - Provide details about an object.
DETACH - Detaches a virtual disk file.
EXIT - Exit DiskPart.
EXTEND - Extend a volume.
EXPAND - Expands the maximum size available on a virtual disk.
FILESYSTEMS - Display current and supported file systems on the volume.
FORMAT - Format the volume or partition.
GPT - Assign attributes to the selected GPT partition.
HELP - Display a list of commands.
IMPORT - Import a disk group.
INACTIVE - Mark the selected partition as inactive.
LIST - Display a list of objects.
MERGE - Merges a child disk with its parents.
ONLINE - Online an object that is currently marked as offline.
OFFLINE - Offline an object that is currently marked as online.
RECOVER - Refreshes the state of all disks in the selected pack.
Attempts recovery on disks in the invalid pack, and
resynchronizes mirrored volumes and RAID5 volumes
that have stale plex or parity data.
REM - Does nothing. This is used to comment scripts.
REMOVE - Remove a drive letter or mount point assignment.
REPAIR - Repair a RAID-5 volume with a failed member.
RESCAN - Rescan the computer looking for disks and volumes.
RETAIN - Place a retained partition under a simple volume.
SAN - Display or set the SAN policy for the currently booted OS.
SELECT - Shift the focus to an object.
SETID - Change the partition type.
SHRINK - Reduce the size of the selected volume.
UNIQUEID - Displays or sets the GUID partition table (GPT) identifier or
master boot record (MBR) signature of a disk.
看见setid命令了吗?就是这条命令让我免去格式化硬盘重新分区。
太强大了
输入:
set id=07
此时该分区就会变成NTFS格式,也会由隐藏变为可见。
我这里几乎是马上就弹出了一个硬盘分区,进去看了看数据都还在。
看来微软不软的时候,也是挺硬的,顺便说一句,其实Linux的 fdisk命令也是可以完成以上操作的,但是这个diskpat命令的确是比较简单,因为你不需要再去学习Linux啊。