linux怎么挂载U盘
插入U盘之后,按照下面的步骤:
如果想让linux识别U盘,需要把鼠标先定位在虚拟机的linux里面,然后插入优盘,优盘才会被linux识别,再用fdisk -l 来查看U盘的情况。
- [root@mysql-1 ~]# fdisk -l
-
- Disk /dev/sda: 21.4 GB, 21474836480 bytes
- 255 heads, 63 sectors/track, 2610 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 2610 20860402+ 8e Linux LVM
-
- Disk /dev/sdb: 3984 MB, 3984411648 bytes
- 5 heads, 42 sectors/track, 37057 cylinders
- Units = cylinders of 210 * 512 = 107520 bytes
- -----------------------------------------------------------------------
- Device Boot Start End Blocks Id System
- /dev/sdb1 6 37058 3890439 b W95 FAT32
- -----------------------------------------------------------------------
如果是fat格式的U盘,挂载命令:
- mount -t vfat /dev/sdb1 /mnt/udisk
如果是ntfs格式的U盘,挂载命令:
- mount -t ntfs-3g /dev/sdb1 /mnt/udisk
如果没有/mnt/udisk文件夹,可以创建一个
- mkdir /mnt/udisk
即可~
但是注意,ntfs格式要挂载的话,需要下载一个ntfs-3g-2011.4.12-5.el5.i386.rpm包,安装一下~
一、编译安装fuse模块
- Download fuse-2.7.0.tar.gz
- In root terminal
- # tar –zxvf fuse-2.7.0.tar.gz
- # cd fuse-2.7.0
- # ./configure
- # make
- # make install
- # lsmod
- # modprobe fuse
二、安装ntfs-3g软件
- Then (re)configure and install ntfs-3g
- # tar –zxvf ntfs-3g-1.5130.tar.gz
- # cd ntfs-3g-1.5130
- # ./configure -–enable-fuse-module
- # make
- # make install
三、挂载
- Then mount your ntfs drive in linux.
- # fdisk -l(搜索出移动硬盘)
- # mkdir /mnt/windows
- # mount –t ntfs-3g /dev/sda1 /mnt/windows
- Now, you can Read/Write NTFS formatted drive in Linux.
- Hope This help you.
-