现在里面/tmp
有一些临时文件。当我将硬盘驱动器 ( /dev/sdc1
)安装在 之上时/tmp
,我可以看到硬盘驱动器上的文件。/tmp
当我的硬盘被挂载时,实际内容会发生什么变化?是否可以在/tmp
安装硬盘驱动器时对实际内容执行 r/w 操作?
python@lanix / $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 286G 43G 229G 16% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.8G 4.0K 3.8G 1% /dev
tmpfs 766M 1.4M 765M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.8G 38M 3.8G 1% /run/shm
none 100M 24K 100M 1% /run/user
/dev/sdb1 7.5G 2.7G 4.9G 35% /mnt
/dev/sdc1 932G 242G 691G 26% …
Run Code Online (Sandbox Code Playgroud) 我已经设置了一个网络:在 VirtualBox 上设置仅主机网络。第一个适配器配置了 NAT,第二个适配器配置了仅主机网络
主机:Windows
来宾:CentOS VM1、CentOS VM2(VM1 的克隆)
在两个虚拟机上执行 ifconfig -a 时,我注意到 MAC 地址完全相同。我的问题是,考虑到 MAC 地址相同,我如何能够从 VM1 ping 到 VM2?
VM1:
eth0 Link encap:Ethernet HWaddr 08:00:27:AF:A3:28
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feaf:a328/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10671 (10.4 KiB) TX bytes:5682 (5.5 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:C4:A8:B6
inet addr:192.168.56.102 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fec4:a8b6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST …
Run Code Online (Sandbox Code Playgroud) lanix@lanix ~ $ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 wlan0
10.0.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Run Code Online (Sandbox Code Playgroud)
我在理解 Gateway 和 Genmask 列中的 0.0.0.0 条目时遇到一些困难。
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 wlan
Run Code Online (Sandbox Code Playgroud)
据我所知,目的地(0.0.0.0)是最不特定的匹配,这意味着与其他路由不匹配的数据包将使用此路由。但是我不明白相应的 Genmask 条目(0.0.0.0)。与其他路由不匹配的数据包将被发送到网关 10.0.0.138,但子网掩码是多少?0?10.0.0.138/0 看起来有点奇怪。不应该是/32之类的吗?因为网关是一个单一地址..
谢谢。