Linux挂载U盘操作和错误解决

Centos7.x挂载U盘

一、挂载方法

1.查看U盘信息:

执行命令fdisk -l

Linux挂载U盘操作和错误解决

 

2.挂载到/mnt下的任意目录

mkdir /mnt/usb_disk

mount -t ntfs-3g /dev/sdb4 /mnt/usb_disk

 

3.cd /mnt/usb_disk,即可操作U盘。

 

二、问题解决

问题1:Linux挂载U盘时,报错mount: unknown filesystem type 'ntfs' 错误

方法:安装 ntfs-3g 来解决

1.下载ntfs-3g安装包,下载到Linux系统任意一个目录下/tmp下

wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz

2.解压后,进入目录,编译安装

#cd ntfs-3g_ntfsprogs-2017.3.23

编译过程可能会出现:configure: error: no acceptable C compiler found in $PATH,请看问题二解决方法。

#./configure

# make

# make install

 

问题2:configure: error: no acceptable C compiler found in $PATH 问题解决

方法: 安装GCC软件套件

# yum install gcc

 

问题3挂载NTFS磁盘时出现input/output error

NTFS is either inconsistent, or there is a hardware fault, or it‘s a

SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows

then reboot into Windows twice. The usage of the /f parameter is very

important! If the device is a SoftRAID/FakeRAID then first activate

it and mount a different device under the /dev/mapper/ directory, (e.g.

/dev/mapper/nvidia_eahaabcc1).

方法: 

# ntfsfix /dev/sdb1

至此可以正常访问U盘:

 

Linux挂载U盘操作和错误解决