Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* How to identify if a partition containing a btrfs volume is mounted and where
@ 2014-02-24 13:48 Mike Fleetwood
  2014-02-24 13:57 ` Hugo Mills
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Fleetwood @ 2014-02-24 13:48 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I am trying to enhance GParted (http://www.gparted.org/) to better
support btrfs, specifically multi-device ones.  GParted displays the
busy status (mounted or not) and the mount point of each partition.

For a single device file system this is easy.  Entry in /proc/mounts
for the partition identifies it's mounted and provides the mount
point.

In the general case for btrfs I don't know how to get from device name
containing a btrfs volume to knowing if it's mounted and where?
btrfs filesystem show can identify the devices in a btrfs, but if the
mounting device was removed from the file system this linkage is
broken.

# mkfs.btrfs /dev/sdb2 /dev/sdb3 /dev/sdb4
# mount /dev/sdb2 /mnt/1
# btrfs device delete /dev/sdb2 /mnt/1

So /dev/sdb2 is no longer part of the file system, but it's still
mounted using it.

# grep btrfs /proc/mounts
/dev/sdb2 /mnt/1 btrfs rw,seclabel,relatime,ssd,space_cache 0 0
# btrfs filesystem show /dev/sdb3
Label: none  uuid: d1e98472-e562-466c-8fa4-ddcaee757c20
    Total devices 2 FS bytes used 156.00KB
    devid    3 size 2.00GB used 961.56MB path /dev/sdb4
    devid    2 size 2.00GB used 552.00MB path /dev/sdb3

So in there a way to determine whether a specific partition containing
a btrfs volume is mounted and on what mount point?

Thanks,
Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-01 13:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 13:48 How to identify if a partition containing a btrfs volume is mounted and where Mike Fleetwood
2014-02-24 13:57 ` Hugo Mills
2014-02-25  3:01   ` Anand Jain
2014-02-25 10:28     ` Mike Fleetwood
2014-02-26 21:50       ` Mike Fleetwood
2014-03-01 13:22         ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox