Linux挂载U盘步骤如下

1:将U盘插入USB接口,检查是否插好

2:用fdisk命令检查分区和USB设备信息

[root@wgods ~]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 121601 976655610 8e Linux LVM

Disk /dev/sdb: 4012 MB, 4012900352 bytes
223 heads, 55 sectors/track, 639 cylinders
Units = cylinders of 12265 * 512 = 6279680 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 56 640 3580928 c W95 FAT32 (LBA)
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(42, 17, 40) logical=(55, 23, 1)
Partition 1 has different physical/logical endings:
phys=(487, 222, 55) logical=(639, 6, 31)

通过上面信息我们可以看出USB设备是FAT32格式的,标识为/dev/sdb1

[root@wgods ~]# fdisk -l | grep FAT32
/dev/sdb1 * 56 640 3580928 c W95 FAT32 (LBA)

3:在mnt目录下先建立一个usb的目录

[root@wgods ~]# cd /mnt/
[root@wgods mnt]# mkdir usb

4:挂载U盘
[root@wgods mnt]# mount -t vfat /dev/sdb1 /mnt/usb

挂载成功后,我们可以在/mount/usb下看到相关的内容。

5:卸载U盘

执行umount命令卸载U盘时,报如下错误“device is busy”,可以用参数l解决问题。当然你也可以用fuser命令解决问题。如下所示

[root@wgods ~]# umount /mnt/usb
umount: /mnt/usb: device is busy
umount: /mnt/usb: device is busy

[root@wgods ~]# umount -f /mnt/usb
umount2: Device or resource busy
umount: /mnt/usb: device is busy
umount2: Device or resource busy
umount: /mnt/usb: device is busy

[root@wgods ~]# umount -l /mnt/usb

问题解决

---------------------------------------------------------------------------------

[root@wgods usb]# umount /mnt/usb
umount: /mnt/usb: device is busy
umount: /mnt/usb: device is busy
[root@wgods usb]# fuser -m /mnt/usb
/mnt/usb: 21123c 21158c 21180c 21182c 21223c
[root@wgods usb]# ps -auxw | grep 21123
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 21123 0.0 0.0 3784 672 pts/2 T 15:10 0:00 more 12.sql
root 21346 0.0 0.0 3920 696 pts/2 S+ 15:52 0:00 grep 21123

[root@wgods usb]# fuser -kvm /mnt/usb

USER PID ACCESS COMMAND
/mnt/usb: root 21123 f.c.. more
root 21158 ..c.. man
root 21180 ..c.. sh
root 21182 ..c.. less
root 21223 ..c.. bash

[etl@wgods ~]$ umount /mnt/usb
umount: /mnt/usb is not in the fstab (and you are not root)
[etl@wgods ~]$ su - root
Password: 
[root@wgods ~]# umount /mnt/usb

6: 删除usb目录
[root@wgods ~]# umount -l /mnt/usb
[root@wgods ~]# rm -rf /mnt/usb

注意:有时候挂载时,中文的文件名和目录名会出现乱码,为了避免这种情况可以指定字符集,命令如下

[root@wgods ~]# mount -t vfat -o iocharset=utf8,codepage=uft8 /dev/sdb1 /mnt/usb

[root@wgods ~]# mount -t vfat -o iocharset=cp936,codepage=936 /dev/sdb1 /mnt/usb

注意:cp936是指简体中文,cp950是指繁体中文。

CentOS系统挂载FAT32的U盘的更多相关文章

  1. Linux系统挂载FAT32的U盘

    1:将U盘插入USB接口,检查是否插好 2:用fdisk命令检查分区和USB设备信息 [root@yhwang ~]# fdisk -l Disk /dev/sda: 1000.2 GB, 10002 ...

  2. Linux 系统挂载阿里云数据盘

    适用系统:Linux(Redhat , CentOS,Debian,Ubuntu) *  Linux的云服务器数据盘未做分区和格式化,可以根据以下步骤进行分区以及格式化操作. 下面的操作将会把数据盘划 ...

  3. [CentOS 7]挂载ntfs格式U盘

    在我们将U盘插入装有CentOS的系统时,经常会出现如图所示的错误提示.这是因为linux系统并不能兼容NTFS的文件系统.其解决方法如下(建议先进入root模式): 1.首先下载"ntfs ...

  4. U盘安装CentOS无法进入Centos系统解决办法

    转自:http://blog.sina.com.cn/s/blog_3feedf320101idlu.html     目前使用U盘安装系统逐渐因为它的便捷而受到人们的欢迎,但是使用U盘来安装Cent ...

  5. Linux 挂载和卸载U盘

    一般的U盘挂载方法: mount [-fnrsvw]  [-t vfstype] [-o options] device dir 参数:device表示要挂载的设备,dir表示挂载点 -t 指定设备的 ...

  6. CentOS系统下的数据盘挂载

    此教程适用系统:Linux(CentOS,Debian,Ubuntu,Fedora) 通常新开通的Linux云服务器数据盘都未做分区和格式化.在进行数据盘挂载之前我们要先进行分区以及格式化操作.注意, ...

  7. 阿里云CentOS 7系统挂载SSD云盘的教程_Linux

    一.查看SSD云盘 sudo fdisk -l Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors ...

  8. Linux学习之CentOS(六)---mount挂载设备(u盘,光盘,iso等 )

    对于新手学习,mount 命令,一定会有很多疑问.其实我想疑问来源更多的是对linux系统本身特殊性了解问题. linux是基于文件系统,所有的设备都会对应于:/dev/下面的设备.如: [cheng ...

  9. CentOS下挂载数据盘

    CentOS下挂载数据盘 1.显示磁盘使用情况:#df 2.显示磁盘:#fdisk -l 3.格式化分区:#mkfs.ext4 /dev/vdb1           //注:将/dev/vdb1格式 ...

随机推荐

  1. JavaScript 执行环境(作用域)总结

    所有变量(包括基本类型和引用类型)都存在一个执行环境(也称为作用域)当中,这个执行环境决定了变量的生命周期,以及哪一部分可以访问其中的变量. 以下是关于执行环境的几点总结: 执行环境有全局执行环境(全 ...

  2. sql语句编写 有时候一个子查询可以拆分成多个子查询

    sql语句编写 有时候一个子查询可以拆分成多个子查询

  3. LeetCode -- Best Time to Buy and Sell Stock系列

    Question: Best Time to Buy and Sell Stock Say you have an array for which the ith element is the pri ...

  4. 大步小步算法模板题, poj2417

    大步小步模板 (hash稍微有一点麻烦, poj不支持C++11略坑) #include <iostream> #include <vector> #include <c ...

  5. [洛谷P3865]【模板】ST表

    题目大意:区间静态最大值 题解:ST表,zkw线段树 ST表: st[i][j]存[i,i+$j^{2}$-1]的最大值,查询时把区间分成两个长度相同的小区间(可重复) #include<cst ...

  6. [Leetcode] Reverse linked list ii 反转链表

    Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given1->2 ...

  7. 【BZOJ 3505】 [Cqoi2014]数三角形 容斥原理+排列组合+GCD

    我们先把所有三角形用排列组合算出来,再把一行一列上的三点共线减去,然后我们只观察向右上的三点共线,向左上的乘二即可,我们发现我们如果枚举所有的两边点再乘中间点的个数(GCD),那么我们发现所有的两边点 ...

  8. [POI2008] Poc (原名 Trians) Treap+Hash

    这个题和千山鸟飞绝体现出了一种用平衡树解决动态集合问题,主要套路就是蜜汁标记. 这个题我一开始用替罪羊树搞了一下对了28个点,后来我换成了Treap一搞对了14个点,再后来发现被卡了Hash我竟然在自 ...

  9. 修改innodb_flush_log_at_trx_commit参数提升insert性能

    最近,在一个系统的慢查询日志里发现有个insert操作很慢,达到秒级,并且是比较简单的SQL语句,把语句拿出来到mysql中直接执行,速度却很快. 这种问题一般不是SQL语句本身的问题,而是在具体的应 ...

  10. Tile Cut~网络流入门题

    Description When Frodo, Sam, Merry, and Pippin are at the Green Dragon Inn drinking ale, they like t ...