2

TL/DR; From the command line, how can I find out what files are on a given physical volume?

Context: I just added a new, larger harddrive to a logical volume and did a pvmove to migrate all the data from the older, smaller drive to the new one. I ran a smartclt -t long on the new drive first and it finished with zero errors. I'm still paranoid about the data being corrupted.

I'm in the middle of running MD5SUM against all the files in the updated logical volume to compare against the backup but I'd prefer to only do this for the files that reside on the newly added physical volume.

If not from the command line, is there a library I should explore? Got's no problem hacking stuff up in C if need be.

Modular
  • 81
  • 2
  • 9
  • If you `pvmove`d your entire logical volume from one physical volume to another, then the answer is "all of them". Assuming `pvmove` completed successfully, that logical volume now resides entirely on the new physical volume, and there is nothing left of it on the original physical volume (except the original data hasn't been overwritten, though). – twalberg Dec 30 '13 at 21:12
  • Clarification: my LV was split across two PVs. One of the PVs was full so I moved it's contents to the new, larger one. This is all, of course, predicated on the assumption that pvmove does not validate the bits it lays down in the destination PV (no mention of this in the man page) – Modular Dec 30 '13 at 22:34
  • Ah... In that case, which files are on which part is a rather open question, and depends highly on what your actual file system is (ext[234], xfs, jfs, reiserfs, .....). In most cases, there is no particularly easy way to ask "which files are at least partially within this region of my logical volume". A related but opposite-ish question - "which region(s) of my logical volume does this particular file occupy" - is typically much easier to answer, but would still require you walking through each individual file... – twalberg Dec 30 '13 at 23:22
  • Understood... it could be picking inodes from any ole place to build the file. I've not explored file systems apis at the low level but presumably there's a way map inodes to physical extents which can then be mapped to specific PV's. Then, assuming i can get the inodes used by a given file it would be a straight forward (albeit brute force) path to getting what I was looking for. At this point i'm just going to continue down the full MD5 path but it's a bummer than I'll have to go through this again when I replace another drive. Perhaps I'll peek at the pvmove source to see if it validates. – Modular Dec 30 '13 at 23:49

0 Answers0