linux挂载fat格式U盘

我们在window平台挂载u盘是多么的省事,在linux下面的挂载稍微有点负载!首先将其(U盘)插入linux主机的usb接口中,U盘的格式不能是NTFS的文件系统,因为默认linux没有NTFS驱动程序;

检查U盘是否插入

[root@localhost flash]# fdisk -l

Disk /dev/sda: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x23e023df

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3264    26218048+   7  HPFS/NTFS
/dev/sda2            3265        9964    53817750    f  W95 Ext'd (LBA)
/dev/sda5            3265        5485    17840151    7  HPFS/NTFS
/dev/sda6            5486        7706    17840151    b  W95 FAT32
/dev/sda7            7707        8981    10240000   83  Linux
/dev/sda8            8982        9492     4096000   83  Linux
/dev/sda9            9492        9517      204800   82  Linux swap / Solaris

Disk /dev/sdb: 133 MB, 133267456 bytes
2 heads, 32 sectors/track, 4067 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x81b081b0

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4067      130112    6  FAT16

以上显示代码是新一的centos系统分区的真实情况。我插入的是一个很小容量的U盘,可见/dev/sdb1是我们的需要挂载的分区;

创建目录,并加载到此目录

mkdir /mnt/flash
mount -t vfat -o iocharset=cp950 /dev/sda1 /mnt/flash

卸载U盘

请先使用mount 找下刚刚挂载的目录,然后使用umount卸载即可(umount /mnt/flash)如果提示有进程访问卸载的U盘,请先查询PID然后再KILL即可!

转载请注明来源:新一 » linux挂载fat格式U盘

赞 (0) 评论 (0) 分享 ()