Re: which volume is a file on?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks
I was starting to write some scripts and thought if there was a tool to determine which LV a file was on it would eliminate a some writing.

On Wed, Jun 11, 2008 at 3:33 AM, Bryn M. Reeves <breeves@redhat.com> wrote:
-----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-----

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux