Linux端 USBIP测试
1. 环境准备
-
机器1:这台机器就是需要插上usb, IP为172.20.156.86, 安装的是centos7
-
机器2:IP是172.20.156.105, 安装的是centos7
注:
机器1插上USB, 所以机器1装的是host, 机器2装的是vhci, 这点需要搞清楚
2. 机器1安装USBIP-host
- centos7换源:
cp CentOS-Base.repo CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 下载centos源
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -ivh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
- 安装usbip
yum -y install kmod-usbip usbip-utils
-
插上USB
-
挂载USB
步骤如下:
fdisk -l
[root@localhost ~]# fdisk -l
Disk /dev/sda: 480.1 GB, 480103981056 bytes, 937703088 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000df1cc
Device Boot Start End Blocks Id System
/dev/sda1 2048 6143 2048 83 Linux
/dev/sda2 * 6144 2103295 1048576 83 Linux
/dev/sda3 2103296 937701375 467799040 8e Linux LVM
Disk /dev/mapper/centos-root: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-swap: 68.7 GB, 68719476736 bytes, 134217728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-var: 324.4 GB, 324404248576 bytes, 633602048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdb: 31.5 GB, 31457280000 bytes, 61440000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x162a1965
Device Boot Start End Blocks Id System
/dev/sdb1 * 64 61438143 30719040 c W95 FAT32 (</