dd
运行几个小时后我崩溃了。通常带有类似的消息
Input/output error
68424+1 records in
68424+1 records out
342124883968 bytes (342 GB) copied, 5114.68 s, 66.9 MB/s
Run Code Online (Sandbox Code Playgroud)
有什么我可以做的吗?有什么方法可以使用输出吗?还是从停止的地方重新开始?
是否有任何理由认为这是因为正在备份的分区正在被使用?
它总是在 70-80% 左右崩溃,通常是在分区应该较少使用的时候。
由于这个过程需要很长时间,所以很难尝试不同的东西。
我输出到图像。我可能可以使用分区,但涉及 LVM:
sudo lvmdiskscan
/dev/centos/swap [ 3.89 GiB]
/dev/sda1 [ 500.00 MiB]
/dev/centos/root [ 50.00 GiB]
/dev/sda2 [ 465.27 GiB] LVM physical volume
/dev/centos/home [ 411.38 GiB]
/dev/sdb1 [ 931.51 GiB]
3 disks
2 partitions
0 LVM physical volume whole disks
1 LVM physical volume
dd conv=sync,noerror if=/dev/centos/home bs=2000000 of=/run/media/ob/X_1T_Media1GHD-PCTU3/c/sd9e22_cel.image
dd: error reading '/dev/centos/home': Input/output error
171062+1 records in
171063+0 records out
342126000000 bytes (342 GB) copied, 4625.3 s, 74.0 MB/s
220856+2 records in
220858+0 records out
441716000000 bytes (442 GB) copied, 6138.1 s, 72.0 MB/s
Run Code Online (Sandbox Code Playgroud)
星期五早上
ddrescue --sector-size=2048 --cluster-size=$((256*512)) --sparse --verbose /dev/centos/home /run/media/ob/X_1T_Media1GHD-PCTU3/c/sd7c_dd.image /run/media/ob/X_1T_Media1GHD-PCTU3/c/sd7c_dd.map
GNU ddrescue 1.18.1
About to copy 441714 MBytes from /dev/centos/home to /run/media/ob/X_1T_Media1GHD-PCTU3/c/sd7c_dd.image
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 131072 sectors Initial skip size: 32 sectors
Sector size: 2048 Bytes
Press Ctrl-C to interrupt
rescued: 441714 MB, errsize: 8192 B, current rate: 0 B/s
ipos: 342124 MB, errors: 1, average rate: 60675 kB/s
opos: 342124 MB, run time: 2.02 h, successful read: 9 s ago
Finished
但
extundelete sd7c_dd.image --restore-directory /home/ob/p -o /tmp/tt
extundelete: Bad magic number in super-block when trying to open filesystem sd7c_dd.image
/dev/mapper/centos-home on /home type xfs (rw,relatime,attr2,inode64,noquota)
Run Code Online (Sandbox Code Playgroud)
您永远不应该dd
在已挂载的文件系统上运行,因为这可能会损坏映像,尤其是。如果你想做备份。您可能想tar
改用。
如果您确定设备没有出现故障,您可以使用seek
(用于在输出文件中寻找 N 个块)和skip=N
(用于跳过输入的 N 个块)标志。在 Linux 系统上,您可以使用该dmesg
命令获取当前内核日志。
如果您不确定要从中复制的设备是否可能出现故障,我建议您使用ddrescue
获取该设备的图像。该工具不会在读取错误时中止并记录它无法正确读取的块的位置。