Hi Russell,

all of the information you need should be available from the 'mount'
and 'btrfs subvol list' commands. Though I realise it can be awkward
to parse it out of there, this will be the only way to get accurate
information in the face of bind-mounts and other fancy tricks. One
other datapoint that you might be able to use is that btrfs, I
believe, always shows inode number 256 for subvolumes in 'stat'. Keep
in mind there that the root subvolume is, as the name implies, also
technically a subvolume.

Regards, Bart

On Sat, Dec 29, 2012 at 6:04 AM, Russell Coker
<russell+bt...@coker.com.au> wrote:
> What's a good way of determining the mount point for a BTRFS filesystem in a
> shell script?
>
> /home/user might be a filesystem, a directory under a filesystem /home, a
> directory under a subvol /home of /, a subvol of /, or a subvol of the /home
> filesystem.  How do I determine which it is?
>
> --
> My Main Blog         http://etbe.coker.com.au/
> My Documents Blog    http://doc.coker.com.au/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to