Ubuntu和Windows10双系统,Ubuntu系统下不能正常写入磁盘。

原因: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.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值