[linux-lvm] which volume is a file on?

Bryn M. Reeves breeves at redhat.com
Wed Jun 11 08:33:25 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Zarthan South wrote:
> Is there a utility or a simple way to determine which volume a file is located on.

That's more of a file system question than an LVM question and it's no
different than any other type of device: find the mount point of the
file system containing the file and then consult /proc/mounts or the
output of the mount command to determine what LV the file is on.

If you want to know where the data blocks are located physically you'll
need to do a bit more work: find the inode location, determine what
block ranges are allocated to it and then figure out how they map to
physical device regions using e.g. lvdisplay --maps. The details for
this step depend on the file system type you are using. For ext2/3 you
can determine the physical location of a file's data blocks using degbugfs.

Regards,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkhPjdUACgkQ6YSQoMYUY97/MwCgiyszlwRO/oYMR6ABbiITOeBU
pnMAn3JLz1XNFbVlqx2KGJsgGWfhdhYk
=MHes
-----END PGP SIGNATURE-----




More information about the linux-lvm mailing list