linux下挂载(mount)光盘镜像文件、移动硬盘、U盘、Windows网络共

2020-01-30 12:11:13王振洲

     #mkdir -p /mnt/usbhd1

     #mkdir -p /mnt/usbhd2

     注:建立目录用来作挂接点(mount point)

     #mount -t ntfs /dev/sdc1 /mnt/usbhd1

     #mount -t vfat /dev/sdc5 /mnt/usbhd2

     注:对ntfs格式的磁盘分区应使用-t ntfs 参数,对fat32格式的磁盘分区应使用-t vfat参数。若汉字文件名显示为乱码或不显示,可以使用下面的命令格式。

     #mount -t ntfs -o iocharset=cp936 /dev/sdc1 /mnt/usbhd1

     #mount -t vfat -o iocharset=cp936 /dev/sdc5 /mnt/usbhd2

     linux系统下使用fdisk分区命令和mkfs文件系统创建命令可以将移动硬盘的分区制作成linux系统所特有的ext2、ext3格式。这样,在linux下使用就更方便了。使用下面的命令直接挂接即可。

     #mount /dev/sdc1 /mnt/usbhd1

     挂接U盘

     和USB接口的移动硬盘一样对linux系统而言U盘也是当作SCSI设备对待的。使用方法和移动硬盘完全一样。插入U盘之前,应先用fdisk –l 或 more /proc/partitions查看系统的硬盘和硬盘分区情况。

     [root@pldyrouter root]# fdisk -l

     Disk /dev/sda: 73.4 GB, 73407820800 bytes

     255 heads, 63 sectors/track, 8924 cylinders

     Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot Start End Blocks Id System

     /dev/sda1 1 4 32098+ de Dell Utility

     /dev/sda2 * 5 2554 20482875 7 HPFS/NTFS

     /dev/sda3 2555 7904 42973875 83 Linux

     /dev/sda4 7905 8924 8193150 f Win95 Ext'd (LBA)

     /dev/sda5 7905 8924 8193118+ 82 Linux swap

     插入U盘后,再用fdisk –l 或 more /proc/partitions查看系统的硬盘和硬盘分区情况。

     [root@pldyrouter root]# fdisk -l

     Disk /dev/sda: 73.4 GB, 73407820800 bytes

     255 heads, 63 sectors/track, 8924 cylinders

     Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot Start End Blocks Id System

     /dev/sda1 1 4 32098+ de Dell Utility

     /dev/sda2 * 5 2554 20482875 7 HPFS/NTFS

     /dev/sda3 2555 7904 42973875 83 Linux

     /dev/sda4 7905 8924 8193150 f Win95 Ext'd (LBA)

     /dev/sda5 7905 8924 8193118+ 82 Linux swap

     Disk /dev/sdd: 131 MB, 131072000 bytes

     9 heads, 32 sectors/track, 888 cylinders