问题标签 [dd]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
linux - 为什么使用 dd 克隆磁盘时使用 conv=notrunc?
如果您在网上查找如何将整个磁盘克隆到另一个磁盘,您会发现类似的内容:
虽然我理解noerror
,但我很难理解为什么人们认为这notrunc
是“数据完整性”所必需的(例如ArchLinux 的 Wiki所述)。
事实上,我确实同意,如果您将一个分区复制到另一个磁盘上的另一个分区,并且您不想覆盖整个磁盘,只想覆盖一个分区。在这种情况下notrunc
,根据 dd 的手册页,这就是您想要的。
但是,如果您要克隆整个磁盘,notrunc
对您有什么影响?只是时间优化?
linux - 使用DD递归写入特定文件
我有一个要覆盖的硬盘驱动器,不是用空字节,而是用一条消息。
48 69 64 64 65 6e 20 =“隐藏”
到目前为止,这是我的命令:
注意:我也尝试过各种参数,例如 count 和 conv 无济于事
现在,这很好。当我运行时:
我可以看到前几个字节被覆盖,但是,其余的没有改变。我想递归地将“隐藏”写入驱动器。
bash - Using md5sum for speeding up dd disk imaging, sample script: Good idea?
I was thinking of ways to have my laptop HDD backed up safely, and still being able to put the backup rapidly in use if needed. My method would be the following: I would buy an 2.5" HDD of the same size with USB to SATA cable and clone the internal to it, when disaster strikes, I would just have to swap the HDD in the laptop for the other one and I would be good to go again. However, I would like to avoid writing 500GB each time I want to backup my HDD, especially when I know that a fair part of it (+/- 80GB) is rarely written to, this is where the following md5sum/dd script comes to the rescue, I hope:
Now, the question part:
A) With running this, would I miss some part of the disk? Do you see some flaws?
B) Could I win some time compared to the 500GB read/write?
C) Obviously I potentially write less to the target disk. Will I improve the lifetime of that disk?
D) I was thinking of leaving count to 1, and increasing the block size.Is this good idea/bad idea?
E) Would this same script work with an image file as output?
Not being very fluent in programming, there should be plenty of room for improvement, any tips?
Thank you all...
date - 如何在 dd/mm/yyyy 中转换 Javascript 日期格式
我有这个javascript代码,如果日期以这种格式插入,这在我的计算机上工作正常:yyyy-mm-dd,但在linux服务器(共享主机)上,如果日期以这种格式插入,工作正常:mm/dd /yyyyy
代码是这样的:
如何在javascript代码中设置格式dd/mm/yyyy?
谢谢
linux - dd fail to write to tmpfs
I'd like to measure tmpfs performance by using dd. But it fail, like below:
Any help?
zero - Shell dd 脚本 - 填充零而不是跳过字节
好的,对于那些感兴趣的人,我终于找到了答案: dd seek=$(($offset)) bs=1 count=$c conv=notrunc if=$loc2 of=$loc1
所以我想复制 $loc2 的“文本”,并希望将它粘贴到 $loc1 的偏移量 0x2 处,而不删除它之前的字节。当我在任何位置运行此命令时,它都不会跳过字节,而是用 00 00 替换每个字节......直到它达到偏移量并从那里正常工作。例如:
这是我的小代码
image - 如何按顺序为多个 dd 终端命令创建一个applescript(用于多个USB驱动器复制)?
我需要创建一个苹果脚本来按顺序执行 DD 命令,将相同的 .img 文件复制到多个 USB 闪存驱动器
上下文:计算机连接到有源 USB 集线器,其中 7 个 USB 闪存驱动器通过 diskutil 连接和卸载。没有其他 USB 设备或磁盘连接到计算机(因此 U 盘将分配一个 disk1 - disk7 资源映射)
步骤
将准备一个名为“source.img”的文件并将其放在桌面上(比如可启动操作系统的 .img)
必须要求终端将目录更改为桌面
具有管理权限(密码可以插入脚本中,或向用户询问一次)必须要求它执行:
“sudo dd if=source.img of=/dev/rdisk1 bs=1m”
- 脚本必须等到操作结束,然后再要求终端执行另一个DD,这次到disk2:
“sudo dd if=source.img of=/dev/rdisk2 bs=1m”
再次,等到操作结束,再问:
“sudo dd if=source.img of=/dev/rdisk3 bs=1m”
以此类推,使用 rdisk4、rdisk5、rdisk6、rdisk7。
- 在 disk7 操作结束时,该脚本可以关闭终端并向用户发送一条查找器消息(或音频通知),表明对 7 个闪存驱动器的 USB 复制过程已结束。
这是一种创建“便宜的 USB 复制器”的方法,可将可启动图像放在多个棒上,我需要它用于我的学生的学校项目。
有人可以帮忙吗?我是 Applescript 的零。这个东西对很多人都有用。
谢谢 !阿尔贝托
c++ - dd - 了解块大小
我使用“dd”来创建测试文件和跨 HDD 执行备份。没问题。
目前,我正在尝试使用它来测试 NFS 传输速率。起初,我改变了块大小(“bs”参数)......但这让我想到,为什么我需要改变这个参数?
我想模拟的一个典型用例是:
- Node X 在内存中有一个大的数据结构
- 节点 X 想要将其写入位于 NFS 挂载目录中的文件
在这种情况下,二维数组的典型 C/C++ 代码将是:
所以在这种情况下,我们正在以 32 位增量写入缓冲区(sizeof(float)) - 由于这是一个 FILE 对象,它可能也被缓冲了(也许这不是一件好事,但可能与此无关讨论)。
我很难从“bs”块中的 if->of 写入“dd”跳转到从内存中写出变量的应用程序(并用 dd 模拟)。
将“bs”的值更改为小于系统 PAGE_SIZE 是否有意义?
这是我目前的理解,所以我不明白为什么更改“dd”块大小很重要:
linux - 在 bash/sh 中分别管道 stderr 和 stdout
我一直在尝试在我的服务器上使用以下命令
dd if=/dev/zero bs=1M count=1024 | md5sum
输出:
如何让它367 MB/s
仅将速度()显示为输出?状态打印到stderr
。
我目前正在使用awk
,但它显示了 md5 哈希。
帮助表示赞赏:)
linux - 运行 dd 命令时是否可以添加安装计时器
我目前正在尝试制作一个安装 USB 密钥,但我不确定 dd 命令是冻结还是只是永久使用,以供将来参考,我想知道是否可以在复制我的 iso 时以某种方式向 dd 命令添加安装计时器到我的拇指驱动器
ps iso是4.9gb
谢谢你先进