Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to backup an LVM on one of my servers with the following command:

dd bs=4M conv=noerror,sync if=/dev/vg_volgroup/LvmName | ssh myuer@myip "dd of=/home/myuser/LvmName bs=4M conv=noerror,sync"

The disk from which I am reading this LVM has a bad sector returning:

dd: reading `/dev/vg_volgroup/Lvmname': Input/output error
224+1 records in
225+0 records out
943718400 bytes (944 MB) copied, 1313.12 s, 719 kB/s

Due to this bad sector I use conv=noerror,sync

The origianl LVM is 100GB and the output LVM is 130GB and growing. Does anyone know why this is or what I am doing wrong?
As far as I know noerror fills the defective blocks with zeros but I am unclear as to how this would make the LVM larger.
Does anyone have any tips or ideas?

Update:

Using kill -USR1 pid
Where pid is the pid of the dd process sending data returns the following:

601+1 records in
601+0 records out
2520776704 bytes (2.5 GB) copied, 4457.14 s, 566 kB/s

Yet the output file is now 154GB in size.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You should inspect the output file to find out, what is in there. Knowing what is in the file helps figuring out, where it came from. For a starting point, you could try head -c10k /home/myuser/LvmName | hexdump -C and tail -c10k /home/myuser/LvmName | hexdump -C

My guess is that it will either consist mostly of NUL characters or of some sort of text messages, which were not intended to get redirected to the file.

share|improve this answer
    
You were right. It seems that as I specified conv=noerror,sync on the other side of the pipe, the dd command on the remote host kept filling in the target file with Null chars even after the sending part of the pipe had finished.Cheers for the help –  user2284355 Apr 13 at 18:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.