Re: finding root filesystem of a subvolume?

2017-08-23 Thread Axel Burri
On 2017-08-23 14:07, Austin S. Hemmelgarn wrote: > On 2017-08-22 13:41, Peter Grandi wrote: > [ ... ] >> This stupid point relies on ignoring that it is not mandatory to >> mount the main volume, and that therefore "There is no fixed >> relationship between the root directory inode of a subvolume

Re: finding root filesystem of a subvolume?

2017-08-23 Thread Austin S. Hemmelgarn
On 2017-08-22 13:41, Peter Grandi wrote: [ ... ] There is no fixed relationship between the root directory inode of a subvolume and the root directory inode of any other subvolume or the main volume. Actually, there is, because it's inherently rooted in the hierarchy of the volume itself.

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Peter Grandi
[ ... ] >> There is no fixed relationship between the root directory >> inode of a subvolume and the root directory inode of any >> other subvolume or the main volume. > Actually, there is, because it's inherently rooted in the > hierarchy of the volume itself. That root inode for the >

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Roman Mamedov
On Tue, 22 Aug 2017 17:45:37 +0200 Ulli Horlacher wrote: > In perl I have now: > > $root = $volume; > while (`btrfs subvolume show "$root" 2>/dev/null` !~ /toplevel subvolume/) { > $root = dirname($root); > last if $root eq '/'; > } > > If you are okay with

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
On Tue 2017-08-22 (11:03), Austin S. Hemmelgarn wrote: > Or alternatively, repeatedly call `btrfs filesystem show` on the path, > removing one component from the end each time until you get a zero > return code. The path you called it on that got a zero return code is > where the mount is

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Austin S. Hemmelgarn
On 2017-08-22 10:43, Peter Grandi wrote: How do I find the root filesystem of a subvolume? Example: root@fex:~# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on - -1073740800 104244552 967773976 10% /local/.backup/home [ ... ] I know, the root

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Peter Grandi
> How do I find the root filesystem of a subvolume? > Example: > root@fex:~# df -T > Filesystem Type 1K-blocks Used Available Use% Mounted on > - -1073740800 104244552 967773976 10% /local/.backup/home [ ... ] > I know, the root filesystem is /local, That question is

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Austin S. Hemmelgarn
On 2017-08-22 10:23, Hugo Mills wrote: On Tue, Aug 22, 2017 at 10:12:25AM -0400, Austin S. Hemmelgarn wrote: On 2017-08-22 09:53, Ulli Horlacher wrote: On Tue 2017-08-22 (09:37), Austin S. Hemmelgarn wrote: root@fex:~# df -T /local/.backup/home Filesystem Type 1K-blocks Used

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Hugo Mills
On Tue, Aug 22, 2017 at 10:12:25AM -0400, Austin S. Hemmelgarn wrote: > On 2017-08-22 09:53, Ulli Horlacher wrote: > >On Tue 2017-08-22 (09:37), Austin S. Hemmelgarn wrote: > > > >>>root@fex:~# df -T /local/.backup/home > >>>Filesystem Type 1K-blocks Used Available Use% Mounted on > >>>-

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Austin S. Hemmelgarn
On 2017-08-22 09:53, Ulli Horlacher wrote: On Tue 2017-08-22 (09:37), Austin S. Hemmelgarn wrote: root@fex:~# df -T /local/.backup/home Filesystem Type 1K-blocks Used Available Use% Mounted on - -1073740800 104252160 967766336 10% /local/.backup/home Hmm, now I'm

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
On Tue 2017-08-22 (09:37), Austin S. Hemmelgarn wrote: > > root@fex:~# df -T /local/.backup/home > > Filesystem Type 1K-blocks Used Available Use% Mounted on > > - -1073740800 104252160 967766336 10% /local/.backup/home > > Hmm, now I'm really confused, I just checked

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Marat Khalili
Hmm, now I'm really confused, I just checked on the Ubuntu 17.04 and 16.04.3 VM's I have (I only run current and the most recent LTS version), and neither of them behave like this. Was also shocked, but: $ lsb_release -a No LSB modules are available. Distributor ID:Ubuntu Description:

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Marat Khalili
I have no subvol=/ option at all: Probably depends on kernel, but I presume missing subvol means the same as subvol=/ . I am only interested in mounted volumes. If your initial path (/local/.backup/home) is a subvolume but it's not itself present in /proc/mounts then it's probably mounted as

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Austin S. Hemmelgarn
On 2017-08-22 09:30, Ulli Horlacher wrote: On Tue 2017-08-22 (09:27), Austin S. Hemmelgarn wrote: root@fex:~# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on - -1073740800 104244552 967773976 10% /local/.backup/home I've never seen the "- -"

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
On Tue 2017-08-22 (09:27), Austin S. Hemmelgarn wrote: > >>> root@fex:~# df -T > >>> Filesystem Type 1K-blocks Used Available Use% Mounted on > >>> - -1073740800 104244552 967773976 10% > >>> /local/.backup/home > >> > >> I've never seen the "- -" output from df

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Austin S. Hemmelgarn
On 2017-08-22 08:50, Ulli Horlacher wrote: On Tue 2017-08-22 (12:40), Hugo Mills wrote: On Tue, Aug 22, 2017 at 02:23:50PM +0200, Ulli Horlacher wrote: How do I find the root filesystem of a subvolume? Example: root@fex:~# df -T Filesystem Type 1K-blocks Used Available Use% Mounted

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
On Tue 2017-08-22 (15:58), Marat Khalili wrote: > On 22/08/17 15:50, Ulli Horlacher wrote: > > > It seems, I have to scan the subvolume path upwards until I found a real > > mount point, > > I think searching /proc/mounts for the same device and subvol=/ in > options is most straightforward. I

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Marat Khalili
On 22/08/17 15:50, Ulli Horlacher wrote: It seems, I have to scan the subvolume path upwards until I found a real mount point, I think searching /proc/mounts for the same device and subvol=/ in options is most straightforward. But what makes you think it's mounted at all? -- With Best

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
On Tue 2017-08-22 (12:40), Hugo Mills wrote: > On Tue, Aug 22, 2017 at 02:23:50PM +0200, Ulli Horlacher wrote: > > > How do I find the root filesystem of a subvolume? > > Example: > > > > root@fex:~# df -T > > Filesystem Type 1K-blocks Used Available Use% Mounted on > > -

Re: finding root filesystem of a subvolume?

2017-08-22 Thread Hugo Mills
On Tue, Aug 22, 2017 at 02:23:50PM +0200, Ulli Horlacher wrote: > How do I find the root filesystem of a subvolume? > Example: > > root@fex:~# df -T > Filesystem Type 1K-blocks Used Available Use% Mounted on > - -1073740800 104244552 967773976 10% /local/.backup/home

finding root filesystem of a subvolume?

2017-08-22 Thread Ulli Horlacher
How do I find the root filesystem of a subvolume? Example: root@fex:~# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on - -1073740800 104244552 967773976 10% /local/.backup/home root@fex:~# btrfs subvolume show /local/.backup/home /local/.backup/home