News for hackers. Stuff that matters.
Re:My experience with using cp to copy 432 million files (39... by steveh73 on Thursday September 11, 2014 @07:35PM (#8305838)
"Normally I'd have copied/moved the files at block-level (eg. using dd or pvmove), but suspecting bad blocks, I went for a file-level copy because then I'd know which files contained the bad blocks."
Re:My experience with using cp to copy 432 million files (39... by angry_octet on Thursday September 11, 2014 @08:10PM (#8305963)
I was simplifying... dump backs up inodes not blocks. Some inodes point to file data and some point to directory data. Hard links are references to the same inode in multiple directory entries, so when you run xfsrestore, the link count increments as the FS hierarchy is restored.

xfsdump/zfs send are file system aware, unlike dd, and can detect fs corruption (ZFS especially having extensive checksums). In fact, any info cp sees about corruption comes from the FS code parsing the FS tree.

However, except on zfs/btrfs, data block corruption will pass unnoticed. And in my experience, when you have bad blocks, you have millions of them -- too many to manually fix. As this causes a read hang, it is usually better to dd copy the fs to a clean disk, set to replace bad blocks with zeros, then fsck/xfs_repair when you mount, then xfsdump.

dd conv=noerror,sync,notrunc bs=512 if=/dev/disk of=diskimg

See Also: http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide/tmp/en-US... http://xfs.org/index.php/Reliable_Detection_and_Repair_of_Me...

Re:My experience with using cp to copy 432 million files (39... by Rapzid on Thursday September 11, 2014 @10:23PM (#8306328)
If the risk of keeping the system running while the array rebuilt was deemed to high, I would have just gone with a dd/ddrescue of the remaining disks onto new disks and then moved on from there.

+1 for mentioning ZFS. It's really quite amazing. Almost like futuristic alien technology compared to the other freely available file systems.

Re:My experience with using cp to copy 432 million files (39... by andreasvc on Friday September 12, 2014 @06:36AM (#8307373)
Given the issues encountered it would make sense to split this into two passes: 1. identify files with bad blocks and log; 2. do the block-level copy. The disadvantages of file-level copy weigh heavier than the doing this in a single step.
Re:My experience with using cp to copy 432 million files (39... by rbh42 on Friday September 12, 2014 @11:18AM (#8308465)
That's probably what I'll do if I run into a problem like that another time (I'm the OP).