centos下访问windows系统文件!!!

由于我的笔记本的系统是centos 6 与window10

双系统的引导是由grub控制的。   两个系统的文件系统不同,不能相互访问。

在linux下是这样的:






无法挂载ntfs系统!!!!

======================================

yum只适用于Redhat系,编译安装适用于所有Linux发行版//编译安装略显麻烦,我就先不弄了。

大部分说的都是  ntfs-3g这个软件,与fuse,也无法直接yum安装!!!

http://blog.51cto.com/woonli/1612693

http://blog.51cto.com/kumu1988/754244

https://blog.csdn.net/syx19930206/article/details/42773265


先考虑yum安装工具来访问ntfs:

找了好久,发现这个:

http://www.cnblogs.com/gbyukg/archive/2011/11/02/2232343.html

1. 使用yum的安装方法:

请确定你已经安装了rpmforge软件库的源。请参考:RHEL/CentOS 5.5使用第三方软件库

然后安装下列组件。

yum install fuse ntfs-3g -y

注:如果你在使用 CentOS 5.3 或更旧版本,那么你需要安装来自 ELRepo 的 kmod-fuse。


2. 使用ntfs-3g官方源码编译安装的方法:

ntfs-3g下载页面:http://www.tuxera.com/community/ntfs-3g-download/

安装步骤:

wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz

tar zxvf ntfs-3g_ntfsprogs-2011.4.12.tgz

cdntfs-3g_ntfsprogs-2011.4.12

./configure

make

make install

以上两种方法二选一,yum只适用于Redhat系,编译安装适用于所有Linux发行版

[oh@localhost 桌面]$ yum install fuse ntfs-3g -y
Loaded plugins: fastestmirror, refresh-packagekit, security
You need to be root to perform this command.
[oh@localhost 桌面]$ su - root
Password: 
su: incorrect password
[oh@localhost 桌面]$ su - root
Password: 
[root@localhost ~]# yum install fuse ntfs-3g -y
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.cn99.com
adobe-linux-i386                                                                           | 2.9 kB     00:00     
adobe-linux-i386/primary_db                                                                | 2.7 kB     00:00     
base                                                                                       | 3.7 kB     00:00     
chromium-el6                                                                               | 1.9 kB     00:00     
extras                                                                                     | 3.3 kB     00:00     
updates                                                                                    | 3.4 kB     00:00     
updates/primary_db                                                                         | 6.8 MB     00:12     
包 fuse-2.8.3-5.el6.i686 已安装并且是最新版本
解决依赖关系
--> 执行事务检查
---> Package ntfs-3g.i686 2:2017.3.23-1.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

==================================================================================================================
 软件包                   架构                  版本                                  仓库                   大小
==================================================================================================================
正在安装:
 ntfs-3g                  i686                  2:2017.3.23-1.el6                     epel                  272 k

事务概要
==================================================================================================================
Install       1 Package(s)

总下载量:272 k
Installed size: 760 k
下载软件包:
ntfs-3g-2017.3.23-1.el6.i686.rpm                                                           | 272 kB     00:01     
运行 rpm_check_debug 
执行事务测试
事务测试成功
执行事务
  正在安装   : 2:ntfs-3g-2017.3.23-1.el6.i686                                                                 1/1 
  Verifying  : 2:ntfs-3g-2017.3.23-1.el6.i686                                                                 1/1 

已安装:
  ntfs-3g.i686 2:2017.3.23-1.el6                                                                                  

完毕!
[root@localhost ~]# 


ok,现在可以GNOME访问ntfs文件了


何谓挂载,就算你可以访问ntfs文件系统了,也是需要把它当作一个目录。否则就只能算是在桌面环境中单击操作。

使用mount名令挂载,才能在终端里使用!!!!!


现在问题来了,你需要查看硬盘分区,义得到 /dev/sda2/   这类的东西!!

[root@localhost ~]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda5 on /media/0005B548000978B6 type fuseblk (ro,nosuid,nodev,allow_other,default_permissions,blksize=4096)
You have new mail in /var/spool/mail/root
[root@localhost ~]# 

https://blog.csdn.net/lzjsqn/article/details/72059035

上面的文章有详细说明:

3,parted

parted  is  a  disk  partitioning and partition resizing program.  It allows you to create, destroy, resize, move and copy ext2, linux-swap, FAT, FAT32, and reiserfs partitions.  It can create, resize, and move Macintosh HFS partitions, as  well  as  detect jfs,  ntfs,  ufs,  and  xfs partitions.  It is useful for creating space for new operating systems, reorganising disk usage, and copying data to new hard disks.
This manual page documents parted briefly.  Complete documentation is distributed with the package in GNU Info format; see  near the bottom.

parted命令就比较强大了,用parted命令可以对大于2TB的磁盘设备进行分区,以及创建GPT分区(而fdisk命令就办不到了)。

如果要查看 /dev/sda 各分区的文件系统类型,可以按照以下步骤来查看:(主要是print list命令)



parted /dev/sda
.....
(parted) print list 
[root@localhost ~]# parted /dev/sda
GNU Parted 2.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA TOSHIBA MK5059GS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type      File system     标志
 1      1049kB  75.2GB  75.2GB  primary   ntfs            启动
 2      75.2GB  364GB   289GB   extended                  lba
 5      75.2GB  217GB   142GB   logical   ntfs
 6      217GB   359GB   142GB   logical   ntfs
 7      359GB   361GB   2154MB  logical
 3      364GB   497GB   133GB   primary   ext4
 4      497GB   500GB   3146MB  primary   linux-swap(v1)

(parted)                                                                  

进入parted后输入   print list


这样我就得到了  /dev/sda1 是ntfs文件系统,并且是windows的c盘了

=============================================================

再用   mount -t ntfs-3g /dev/sda1 /mnt/windows/c

但是问题又来了:

[root@localhost mnt]# mkdir windows
[root@localhost mnt]# ls
windows
[root@localhost mnt]# mount -t ntfs-3g /dev/sda1 /mnt/windows/c
Windows is hibernated, refused to mount.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
ntfs-3g-mount: failed to access mountpoint /mnt/windows/c: 没有那个文件或目录
[root@localhost mnt]# 
hibernate:   冬眠!!!!!

那么非系统盘呢:

[root@localhost mnt]# mount -t ntfs-3g /dev/sda5 /mnt/windows/F
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
[root@localhost mnt]# ls
[root@localhost mnt]# ls -a
.  ..
[root@localhost mnt]# 


上网查了查,发现是因为win8,或者win10关机并不是真正的把系统关机了,而是在高级休眠!!!

https://www.cnblogs.com/wangbo2008/p/3782730.html

https://www.cnblogs.com/imqsl/p/6567917.html

得在win10里把快速启动关掉

否则:修复ntfs(系统盘可能不允许修复):

sudo ntfsfix /dev/sda5

可是:

[root@localhost ~]# ntfsfix /dev/sda5
-bash: ntfsfix: command not found

没有ntfsfix这个工具啊!!!!!!!

再查查看为什么会这样!!!   说是设置成只读模式就没问题了!!!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值