Linux挂载U盘
我把系统lib库改了,ssh,ftp都不能使用了。
索性还有Telnet可以用。
连接,想要拷文件。思考了好久使用Telnet传文件。
最后想起来设备上有USB口。
- 查看U盘设备信息
通过使用 fdisk 命令,即可查看到 U 盘的设备文件名,执行命令如下:
fdisk -l查询结果:
Disk /dev/mmcblk0: 3850 MB, bytes 4 heads, 16 sectors/track, cylinders Units = cylinders of 64 * 512 = 32768 bytes Device Boot Start End Blocks Id System /dev/mmcblk0p1 321 83 Linux Disk /dev/mmcblk0boot1: 16 MB, bytes 4 heads, 16 sectors/track, 512 cylinders Units = cylinders of 64 * 512 = 32768 bytes Disk /dev/mmcblk0boot1 doesn't contain a valid partition table Disk /dev/mmcblk0boot0: 16 MB, bytes 4 heads, 16 sectors/track, 512 cylinders Units = cylinders of 64 * 512 = 32768 bytes Disk /dev/mmcblk0boot0 doesn't contain a valid partition table Disk /dev/sdb: 31.4 GB, bytes 255 heads, 63 sectors/track, 3824 cylinders Units = cylinders of 16065 * 512 = bytes Device Boot Start End Blocks Id System /dev/sdb1 * 119 3766 7 HPFS/NTFS //ntfs /dev/sdb4 3767 3824 e Win95 FAT16 (LBA) //vfat - 查看到 U 盘的设备文件名,接下来就要创建挂载点了。命令如下:
mkdir /mnt/usb //先创建目录 mount -t vfat -o iocharset=utf8 /dev/sdb4 /mnt/usb/ //挂载到目录 cd /mnt/usb/ ls- 我这个U盘被我分区了,一部分是NTFS文件,一部分是FAT16。两种挂载时命令是有区分的,分别是ntfs、vfat.
- 直接挂载可能会出现中文乱码,所以在挂载时可以指定编码格式。
- 拷贝完成后,需要退出U盘,输入命令:
umount /mnt
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/200356.html原文链接:https://javaforall.net
