On Fri, Sep 08, 2017 at 08:41:57PM +0200, Ulli Horlacher wrote: > On Fri 2017-09-08 (15:10), David Sterba wrote: > > On Fri, Sep 08, 2017 at 10:54:46AM +0200, Ulli Horlacher wrote: > > > > > How can I test if a subvolume is a snapshot? > > > > The inode number is 256 on a btrfs filesystem: > > > > if [ stat -f --format=%T $path = btrfs -a stat --format=%i $path = 256 ]; ... > > > > The directory that's result of snapshotting a subvolume, also called > > EMPTY_SUBVOL has inode number 2, but that's not considered a normal > > subvolume. > > This is not true. Oh I see, I've read the mail too quickly sorry, not just a subvolume but really a snapshot. Then the simple inode number check does not work of cours, the answer is more or less what Peter Grandi replied. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
