温馨提示×

centos怎么挂载u盘

小樊
49
2026-08-30 04:52:56
栏目: 智能运维

CentOS 下挂载 U 盘,一般按以下步骤操作即可(适用于 CentOS 7 / 8 / Stream,也支持大多数 Linux 发行版)。


一、确认 U 盘是否被识别

插入 U 盘后,执行:

lsblk

fdisk -l

一般 U 盘会显示为类似:

/dev/sdb
/dev/sdb1

其中:

  • /dev/sdb:U 盘设备
  • /dev/sdb1:U 盘的第一个分区(通常挂载它)

二、创建挂载目录

一般挂载到 /mnt/media 下:

mkdir -p /mnt/usb

三、挂载 U 盘

1️⃣ 常见情况(FAT32 / exFAT / NTFS)

✅ FAT32(最常见)

mount -t vfat /dev/sdb1 /mnt/usb

如果中文文件名乱码,可指定编码:

mount -t vfat -o iocharset=utf8 /dev/sdb1 /mnt/usb

✅ NTFS(Windows U 盘)

先安装 NTFS 支持:

# CentOS 7
yum install -y epel-release
yum install -y ntfs-3g

# CentOS 8 / Stream
dnf install -y epel-release
dnf install -y ntfs-3g

然后挂载:

mount -t ntfs-3g /dev/sdb1 /mnt/usb

✅ exFAT(Win10 / 大容量 U 盘)

# CentOS 7
yum install -y epel-release
yum install -y exfat-utils fuse-exfat

# CentOS 8 / Stream
dnf install -y exfatprogs

挂载:

mount -t exfat /dev/sdb1 /mnt/usb

四、检查是否挂载成功

df -h

ls /mnt/usb

五、卸载 U 盘(非常重要)

退出 U 盘目录后执行:

umount /mnt/usb

umount /dev/sdb1

⚠️ 不要直接拔 U 盘,否则可能损坏数据


六、开机自动挂载(可选)

编辑 /etc/fstab

blkid /dev/sdb1

得到 UUID,例如:

UUID=1234-5678  /mnt/usb vfat defaults 0 0

添加到 /etc/fstab

vim /etc/fstab

⚠️ 不推荐 U 盘写进 fstab,容易影响开机。


七、常见问题

❌ 提示 “Operation not permitted”

  • 确认是 root 用户
  • 或加 -o uid=1000,gid=1000
mount -t vfat -o uid=1000,gid=1000 /dev/sdb1 /mnt/usb

❌ 提示 “unknown filesystem type”

说明缺少文件系统支持,参考上文安装对应工具。


如果你愿意,可以告诉我:

  • ✅ CentOS 版本
  • ✅ U 盘文件系统(FAT32 / NTFS / exFAT)
  • ✅ 是否服务器(无桌面)

我可以给你最精确的一步到位命令

0