
Code: Select all
diff -r -q /dev/md0 /mnt/sde2Lol, no that must be a typo, the devices in /dev are mounted as their same device name in /mnt(Note: Did you really mount a filesystem under /dev, as in your "df" output?
Is this any different than what rsync -avn --delete /mnt/a/ /mnt/b/ does? rsync compares the directories based on what files are in them, then the files themselves; time-stamp and size... for changes. If the time-stamp, size, or new/deleted file has changed is deletes or copies the new files.This command will do recursively search both directories (-r) and output the names of files that differ (-q). The command will take a long time to run, given so much data. When it's done, if you see no output, it means the contents of the files in both directories match (i.e., it will only print something if something is wrong). Note that this only compares the contents of files, not permissions and ownership, and I'm not sure how it will handle symlinks.Code: Select all
diff -r -q /dev/md0 /mnt/sde2
rsync -av --delete-before --checksum /mnt/a/ /mnt/b/If the diff command above succeeds, you can have pretty good confidence that the contents of the drives check out. Another thing you could do is to calculate a hash (MD5 or SHA1, etc.) of all files on both drives and compare them.

They're software based. For efficiency, they should have some alignment relation to hardware cluster sizes. Historically, they've generally been chosen to fit evenly into or be multiples of 512 bytes, because that has been a common cluster size.awalp wrote:1) Are inode size physical (hardware) or software (filesystem)?
You have already checked for corruption several times. If you're really paranoid about it, you can't do better than the diff command I gave you before. That command does a byte-by-byte comparison of every file. It reports mismatches, and it will also report if it can't find a file in one of the two directories.awalp wrote:2a) if they're based on hardware how would I check for differences in inode sizes to rule out corruption issues?
According to "man mkfs.xfs", XFS inodes have a fixed component and a variable component. When I asked for your xfs_info output, you left out part of it in your post, otherwise I would have told you if I had noticed anything different.awalp wrote:2b) if they're based on the filesystem/software, how would I check for differences in inode sizes to rule out corruption issues?
2bi) if they're software based, how can a get the filesystems to have the same inode sizes (obviously using the size which is currently taking the least space). I'm guessing that would be an option upon formatting.
See what I said about "diff", above. If diff doesn't report an error, then you know that the contents of all of your files is fine. If you want, also add the "-s" parameter. That causes diff to tell you which files are identical in addition to reporting mismatches or errors. (You'll want to pipe the output to some other file, though, because it's going to print a line for every single file!) What diff doesn't check is metadata (permissions, ownership, symbolic links, etc.)awalp wrote:3) [...] what can be done to at least verify that's the situation and no-corruption
If you want the drives to be identical, you're never going to achieve that by creating a new filesystem on the new drive and copying files into it. (And because you can't shrink XFS, the destination partition would have to be exactly the same size or larger than the source partition.) In that case you should use a drive mirroring tool like gparted. I'm not sure whether or not gparted supports RAID though (/dev/md0 indicates some sort of RAID configuration, doesn't it?). For the special case of xfs, you might be able to do what you want with xfsdump and xfsrestore. I've never used those tools myself, though, and I think you'd need a third drive at least as large on which to store the dump file. But it doesn't sound like you need an exact image. If you're just copying the files to a new drive in order to replace the old one, then I believe you have already succeeded.awalp wrote:and hopefully modify the drives to match?
According to "man mkfs.xfs", XFS inodes have a fixed component and a variable component. When I asked for your xfs_info output, you left out part of it in your post, otherwise I would have told you if I had noticed anything different.awalp wrote:2b) if they're based on the filesystem/software, how would I check for differences in inode sizes to rule out corruption issues?
2bi) if they're software based, how can a get the filesystems to have the same inode sizes (obviously using the size which is currently taking the least space). I'm guessing that would be an option upon formatting.
The older of the two filesystems is the original source filesystem which is using 2GB less than the target destination.There are lots of factors that could result in differences in disk usage. From some of what you posted, one of your drives appears to have approximately 8 million more inodes than the other, which indicates that filesystem is probably older and has been used more. The older of the two is probably more fragmented also. krinn described what happens if the filesystems' block sizes are different. Space can be wasted in a similar manner due to fragmentation. With modern filesystems (including at least XFS and ext4, and probably others) the situation is complicated by features like variable inode sizes, extents, tail packing (on reiserfs for instance), etc...
I considered doing a Raid 1 (Raid0 & Partition) setup, but the rsync is way more simple and flexible than any other backup option. Also because I do manual backups every so often (when there are major changes) it also allows me to have an old image of files in case of file lost on the working partition/drive.If you want the drives to be identical, you're never going to achieve that by creating a new filesystem on the new drive and copying files into it. (And because you can't shrink XFS, the destination partition would have to be exactly the same size or larger than the source partition.) In that case you should use a drive mirroring tool like gparted. I'm not sure whether or not gparted supports RAID though (/dev/md0 indicates some sort of RAID configuration, doesn't it?). For the special case of xfs, you might be able to do what you want with xfsdump and xfsrestore. I've never used those tools myself, though, and I think you'd need a third drive at least as large on which to store the dump file. But it doesn't sound like you need an exact image. If you're just copying the files to a new drive in order to replace the old one, then I believe you have already succeeded.awalp wrote:and hopefully modify the drives to match?
delete the destination file and rerun rsync with different options ?awalp wrote:I'm absolutely certain the issue is sparse files.
The problem is there isn't really a problem, except for me not knowing howto scan a file system for them and have reallocated efficiently on the disks.
I know this is the reason because I found similar situations when working with a different new raid0 array and backup array.
-- On this other array the original data takes 700GB of disk usage. (700GB of up to 10+ year old assorted files)
-- Transferring the 700GB onto a new array using rsync -av --spare resulted with 690GB used on the new array
-- --- -- Rsync's -S ( --sparse) option efficiently handled the sparse files.
The disk usage difference problem I originally posted about was caused from using rsync without the sparse option and sparse files. The extra 2GB must have been caused by sparse files expanding on the destination.
New Problem: running rsync again with the sparse option does nothing as rsync is ignoring identical files.
(The destination already contains all the files, rsync'd without --sparse)
That's exactly what I want to do, I just don't want to have to delete all the files I trasnfered and retransfer them, but only the sparse files.dmpogo wrote: delete the destination file and rerun rsync with different options ?
This is entirely storage filesystems. There is no operating system so there shouldn't be anything causing a hard link.chithanh wrote:In addition to sparse files, it is also possible that hard links contribute to the size increase.
Could you right a short script that compares file sizes and see which one differ ? Will perhaps take some time on 466 GB disk, but ...awalp wrote:[
That's exactly what I want to do, I just don't want to have to delete all the files I trasnfered and retransfer them, but only the sparse files.
I have no way of knowing which files are the sprase files and which ones aren't.
Code: Select all
#!
$a = cmd(ls -l)($x);
$b = cmd(du -h)($x);
if ($a >= 4096K)
{
if ($a != $b)
{
cmd ("echo ('$x') >> deletelist.txt");
}
else return;
else return;
}