包含 2 个分区的外部 USB 闪存驱动器连接到我的 Raspberry Pi。dd
如果闪存驱动器上的第一个分区与图像文件的第一个分区不同,我想要将图像文件存储到此外部闪存驱动器。
为了实现这一点,我将比较它们的校验和。
计算闪存驱动器分区的校验和很容易:
md5sum /dev/sda1
但是,如何计算存储在映像文件中的第一个分区的校验和?
我使用 Debian 10 操作系统。
包含 2 个分区的外部 USB 闪存驱动器连接到我的 Raspberry Pi。dd
如果闪存驱动器上的第一个分区与图像文件的第一个分区不同,我想要将图像文件存储到此外部闪存驱动器。
为了实现这一点,我将比较它们的校验和。
计算闪存驱动器分区的校验和很容易:
md5sum /dev/sda1
但是,如何计算存储在映像文件中的第一个分区的校验和?
我使用 Debian 10 操作系统。
我正在按照官方 Debian Wiki 教程在 Debian 11 上设置 VPN 服务器。
Forward traffic to provide access to the Internet
除了最后的段落外,一切都很好。
以下几行不起作用:
IF_MAIN=eth0
IF_TUNNEL=tun0
YOUR_OPENVPN_SUBNET=10.9.8.0/24
#YOUR_OPENVPN_SUBNET=10.8.0.0/16 # if using server.conf from sample-server-config
nft add rule ip filter FORWARD iifname "$IF_MAIN" oifname "$IF_TUNNEL" ct state related,established counter accept
nft add rule ip filter FORWARD oifname "$IF_MAIN" ip saddr $YOUR_OPENVPN_SUBNET counter accept
nft add rule ip nat POSTROUTING oifname "$IF_MAIN" ip saddr $YOUR_OPENVPN_SUBNET counter masquerad
这是输出:
root@server:/home/user# nft add rule ip filter FORWARD iifname "$IF_MAIN" oifname "$IF_TUNNEL" ct state related,established counter accept
Error: Could not process rule: No such file or directory
add rule ip filter FORWARD iifname enp1s0 oifname tun0 ct state related,established counter accept
^^^^^^
我在 3 个命令中遇到了类似的错误。我错过了什么吗?本教程中是否缺少某些内容?
我有一个a.txt
带有 CRLF 结尾的文本文件,它是符号链接的目标link.txt
。默认情况下,dos2unix
不遵循符号链接。我必须--follow-symlink
为此添加。
a.txt
如果和link.txt
在同一个分区上,它就可以工作。否则,它将失败。
例子 :
pi@raspberrypi(rw):~$ file a.txt
a.txt: ASCII text, with CRLF line terminators
pi@raspberrypi(rw):~$ ln -s a.txt link.txt
pi@raspberrypi(rw):~$ dos2unix link.txt
dos2unix: Skipping symbolic link link.txt.
pi@raspberrypi(rw):~$ dos2unix --follow-symlink link.txt
dos2unix: converting file link.txt to Unix format...
pi@raspberrypi(rw):~$ file a.txt
a.txt: ASCII text
pi@raspberrypi(rw):~$ ln -s /home/pi/a.txt /mnt/mountpoint/link.txt
# Revert a.txt to CRLF endings
pi@raspberrypi(rw):~$ unix2dos a.txt
unix2dos: converting file a.txt to DOS format...
pi@raspberrypi(rw):~$ file a.txt
a.txt: ASCII text, with CRLF line terminators
pi@raspberrypi(rw):~$ dos2unix --follow-symlink /mnt/mountpoint/link.txt
dos2unix: problems renaming '/mnt/mountpoint/d2utmpS6Oz6x' to '/home/pi/a.txt': Invalid cross-device link
which is the target of symbolic link '/mnt/mountpoint/link.txt'
output file remains in '/mnt/mountpoint/d2utmpS6Oz6x'
dos2unix: problems converting file /mnt/mountpoint/link.txt
我该如何解决?
谢谢