标签:sdc ice 重启 logic chm bytes mod ssh img
dd常用参数if:就是input file,也可以是某设备文件
of:就是output file,也支持是设备文件
bs:规划的一个block大小,若未指定则默认为512byte
count:指定bs的数量
skip=n,指 if 后面的原文件跳过 n bytes 再开始读取;
seek=n,指 of 后面的目标文件跳过 n bytes 再开始写入;
oflag=direct,真实磁盘io
~# time dd if=/dev/zero of=1.db bs=8k count=30000
30000+0 records in
30000+0 records out
245760000 bytes (246 MB) copied, 0.731931 s, 336 MB/s
real 0m0.735s
user 0m0.001s
sys 0m0.151s
~# dd if=test.dbf bs=8k count=300000 of=/dev/null
30000+0 records in
30000+0 records out
245760000 bytes (246 MB) copied, 0.0342157 s, 7.2 GB/s
root@aikeru:~# fdisk -u -l /dev/sdb
Disk /dev/sdb: 50 MiB, 52428800 bytes, 102400 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
Disklabel type: gpt
Disk identifier: C94E55EA-A4D2-4E78-9D73-46CBAE7A03EF
Device Start End Sectors Size Type
/dev/sdb1 2048 32767 30720 15M EFI System
/dev/sdb2 32768 94207 61440 30M Linux filesystem
/dev/sdb3 94208 102366 8159 4M BIOS boot
备份为文件
dd bs=512 count=102367 if=/dev/sdb of=./nas.img
dd bs=512 count=102367 if=/dev/sdb | ssh 192.168.2.2 "of=./nas.img"
partprobe
for i in `seq 0 32`; do echo "- - -" > /sys/class/scsi_host/host$i/scan;done
dd bs=512 count=102367 if=./nas.img of=/dev/sdc
dd bs=512 count=102367 if=/dev/sdb of=/dev/sdc
dd bs=512 count=102367 if=/dev/sdb | ssh 192.168.2.2 "of=./dev/sdc"
dd if=/dev/zero of=/swapfile bs=1M count=4000
mkswap /swapfile
chmod 600 /swapfile
swapon /swapfile
标签:sdc ice 重启 logic chm bytes mod ssh img
原文地址:https://blog.51cto.com/m51cto/2372674