惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
V
Visual Studio Blog
美团技术团队
L
LINUX DO - 最新话题
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园_首页
腾讯CDC
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
J
Java Code Geeks
W
WeLiveSecurity
Apple Machine Learning Research
Apple Machine Learning Research
Spread Privacy
Spread Privacy
博客园 - 聂微东
量子位
Recent Announcements
Recent Announcements
S
Schneier on Security
O
OpenAI News
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
T
Tailwind CSS Blog
S
Security Affairs
Y
Y Combinator Blog
P
Privacy International News Feed
Hacker News: Ask HN
Hacker News: Ask HN
Stack Overflow Blog
Stack Overflow Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
U
Unit 42
Webroot Blog
Webroot Blog
Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog RSS Feed
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
V
V2EX
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
DataBreaches.Net
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
S
Security @ Cisco Blogs
The Hacker News
The Hacker News
The GitHub Blog
The GitHub Blog
C
CERT Recently Published Vulnerability Notes

博客园 - niceboy

自己写的一个记录日常事务的小软件,也可以作为密码保险箱和提醒工具 访问IIS元数据库失败解决办法 海事卫星通信 关于GPS车载终端的研究 操作或事件已被禁用模式阻止 售前工程师的来世今生(转载自IT售前论坛的经典基础知识)【转】 用Oracle Instant client 打包Oracle客户端 Oracle数据库中 编号自动增长的实现 关于FTP端口【转】 轻松掌握使用 SQL Server 浏览器,解决SQL Server 2005跨网段不能连接问题 论《金瓶梅》与项目管理中人际关系协调 软件开发质量管理层次模型 软件开发中项目需求管理简述 软件测试的基本概念和方法 Web应用程序的整体测试 VSS使用手册 .Net 2.0新功能:重构(Refactoring)(4) .Net 2.0新功能:重构(Refactoring)(3) .Net 2.0新功能:重构(Refactoring)(2)
Redhat Linux 7.3 虚拟机通过USB挂载NTFS格式的移动硬盘
niceboy · 2018-04-24 · via 博客园 - niceboy

  分为如下几个步骤:

一、设置本地yum,安装gcc(如果本机已经安装gcc,则跳过此步)

  1. 在虚拟机连接linux iso安装盘
  2. 查看光盘挂载情况
  3. mkdir /iso
  4. mount /dev/cdrom /iso
  5. cd /etc/yum.repos.d/
  6. vi local.repo

    [local]

    name=local

    baseurl=file:///iso

    gpgcheck=0

    enabled=1

  7.  本地yum配置完成,执行yum install gcc进行安装

二、编译安装ntfs-3g驱动

  驱动下载地址:https://files.cnblogs.com/files/niceboy/ntfs-3g_ntfsprogs-2016.2.22.zip

  1. 将驱动包拷入Linux解压
  2. 进入解压的目录
  3. 执行 ./configure
  4. 执行 make
  5. 执行 make install

  驱动安装完成。

三、挂载移动赢硬盘

  1. fdisk -l
  2. mkdir /usb_extdisk
  3. mount -t ntfs-3g /dev/sdb3 /usb_extdisk

fdisk -l 输出内容如下:

磁盘 /dev/sdb:2000.4 GB, 2000398934016 字节,3907029168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x00000000

设备 Boot Start End Blocks Id System
/dev/sdb1 1 4294967295 2147483647+ ee GPT

fdisk -l不显示硬盘的格式,可通过parted -l 查看未挂载的硬盘的格式

因为在windwos上移动硬盘未安全退出或者磁盘有问题,导致fdisk -l内容显示不全

通过parted -l查看,内容如下,显示移动硬盘应该是三个分区,但是fdisk -l只显示了第一个分区

Model: ATA ST2000DL001-9VT1 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志
1 1049kB 106MB 105MB fat32 EFI system partition 启动
2 106MB 240MB 134MB Microsoft reserved partition msftres
3 240MB 2000GB 2000GB ntfs Basic data partition

所以最后执行挂载的命令为:mount -t ntfs-3g /dev/sdb3 /usb_extdisk/

使用mount命令只能临时挂载,重启后会失效,要想下次重启自动挂载,可以通过以下方法

[root@localhost yum.repos.d]# echo "mount /dev/cdrom /iso" >> /etc/rc.local

[root@localhost yum.repos.d]# cat /etc/rc.local

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

mount /dev/cdrom /iso

通过修改fstab文件,支持开机自动挂载
修改/etc/fstab文件,文件最后加入:
/dev/sdc1 /usb_extdisk ntfs-3g defaults 0 0

到此并没有完全结束,如果你想随时插上U盘,移动硬盘就可以自动挂载,就好像Windows下使用那样的效果。那么就接着看吧。

在/sbin目录下新建一个脚本 vi /sbin/mount.ntfs

#!/bin/sh

export LANG=Zh_CN.UTF-8

exec /sbin/mount.ntfs-3g $@

保存退出,并且给脚本添加一个可执行权限

chmod a+x /sbin/mount.ntfs

然后你再自动插拔你的移动硬盘就可以了。