原因:Windows10的快速启动功能使其在关机状态下仍然占用磁盘。
解决方法:
1、关闭Windows系统的“快速启动”功能。
2、Ubuntu系统挂载磁盘。
ubuntu 20.04挂载ntfs磁盘步骤如下:
查看当前用户id和组id,记下uid和gid
id
显示结果如下:
uid=1000(scue) gid=1000(scue) 组=1000(scue),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare),125(vboxusers),1001(usbfs)
查看当前磁盘的UUID和分区表信息
sudo blkid
显示结果如下:
/dev/sda1: UUID=“DA18EBFA09C1B27D” TYPE=“ntfs” PTTYPE=“atari” PARTLABEL=“Basic data partition” PARTUUID=“7fd2a2dd-d633-4740-bf96-6db2540b0f3a”
创建挂载目录
sudo mkdir -p /home/xxx/data2
此步骤不创建目录的话会导致挂载失败。
打开/etc/fstab
sudo gedit /etc/fstab
添加如下内容:
UUID="DA18EBFA09C1B27D" /home/xx/data2 ntfs defaults,locale=zh_CN.UTF-8 0 0
验证挂载
sudo mount -a
3、若继续出错:Error mounting /dev/sda2/
The NTFS partition is in unsafe state
Windows is hibernated, refused to mount
进行如下操作:
First, make sure you have cleanly shutdown windows and have not hibernated it.
According to the ntfs-3g
manual, there is an option that allows you to do this:
remove_hiberfileremove_hiberfile:
Unlike in case of read-only mount, the read-write mount isUnlike in case of read-only mount, the read-write mount is denied if the NTFS volume is hibernated. One needs either todenied if the NTFS volume is hibernated. One needs either to resume Windows and shutdown it properly, or use this optionresume Windows and shutdown it properly, or use this option which will remove the Windows hibernation file. Please note,which will remove the Windows hibernation file. Please note, this means that the saved Windows session will becompletely lost. Use this option under your own responsibility.
So, I stress that this will destroy any unsaved data that is in the hibernated Windows session. If that is not an issue for you, you should be able to access the drive by running:
sudo ntfs-3g -o remove_hiberfile /dev/sdXN /path/to/mount
Change sdXN
to your windows partition (e.g. /dev/sda1
) and /path/to/mount
to the actual path you want to mount to.
That should mount the drive correctly and since it will delete the hibernated session file, it should mount normally from now on.