* delete recursivly subvolumes? @ 2019-07-05 19:39 Ulli Horlacher 2019-07-05 19:47 ` Ulli Horlacher 0 siblings, 1 reply; 5+ messages in thread From: Ulli Horlacher @ 2019-07-05 19:39 UTC (permalink / raw) To: linux-btrfs I am a master in writing unnecessary software :-} "I have a great idea! I'll write a program for this!" (some time and many lines of code later) "ARGH... there is already such a program and it is better than mine!" This time I ask BEFORE I do the coding: Is there a command/script/whatever to remove subvolume which contains (somewhere) other subvolumes? Example: root@xerus:/test# btrfs_subvolume_list /test/ | grep /tmp /test/tmp /test/tmp/xx/ss1 /test/tmp/xx/ss2 /test/tmp/xx/ss3 root@xerus:/test# btrfs subvolume delete /test/tmp Delete subvolume (no-commit): '/test/tmp' ERROR: cannot delete '/test/tmp': Directory not empty -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ REF:<20190705193945.GB23600@tik.uni-stuttgart.de> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: delete recursivly subvolumes? 2019-07-05 19:39 delete recursivly subvolumes? Ulli Horlacher @ 2019-07-05 19:47 ` Ulli Horlacher 2019-07-05 19:51 ` Hugo Mills 0 siblings, 1 reply; 5+ messages in thread From: Ulli Horlacher @ 2019-07-05 19:47 UTC (permalink / raw) To: linux-btrfs On Fri 2019-07-05 (21:39), Ulli Horlacher wrote: > Is there a command/script/whatever to remove subvolume which contains > (somewhere) other subvolumes? ADONN QUESTION! :-) Is there a command/script/whatever to snapshot (copy) a subvolume which contains (somewhere) other subvolumes? Example: root@xerus:/test# btrfs_subvolume_list /test/ | grep /tmp /test/tmp /test/tmp/xx/ss1 /test/tmp/xx/ss2 /test/tmp/xx/ss3 I want to have (with one command): /test/tmp --> /test/tmp2 /test/tmp/xx/ss1 --> /test/tmp2/xx/ss1 /test/tmp/xx/ss2 --> /test/tmp2/xx/ss2 /test/tmp/xx/ss3 --> /test/tmp2/xx/ss3 -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ REF:<20190705193945.GB23600@tik.uni-stuttgart.de> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: delete recursivly subvolumes? 2019-07-05 19:47 ` Ulli Horlacher @ 2019-07-05 19:51 ` Hugo Mills 2019-07-05 19:56 ` Ulli Horlacher 0 siblings, 1 reply; 5+ messages in thread From: Hugo Mills @ 2019-07-05 19:51 UTC (permalink / raw) To: linux-btrfs [-- Attachment #1: Type: text/plain, Size: 1301 bytes --] On Fri, Jul 05, 2019 at 09:47:20PM +0200, Ulli Horlacher wrote: > On Fri 2019-07-05 (21:39), Ulli Horlacher wrote: > > > Is there a command/script/whatever to remove subvolume which contains > > (somewhere) other subvolumes? > > ADONN QUESTION! :-) > > Is there a command/script/whatever to snapshot (copy) a subvolume which > contains (somewhere) other subvolumes? > > Example: > > root@xerus:/test# btrfs_subvolume_list /test/ | grep /tmp > /test/tmp > /test/tmp/xx/ss1 > /test/tmp/xx/ss2 > /test/tmp/xx/ss3 > > I want to have (with one command): > > /test/tmp --> /test/tmp2 > /test/tmp/xx/ss1 --> /test/tmp2/xx/ss1 > /test/tmp/xx/ss2 --> /test/tmp2/xx/ss2 > /test/tmp/xx/ss3 --> /test/tmp2/xx/ss3 Remember that this isn't quite so useful, because you can't make read-only snapshots in that structure. Generally, I'd recommend not having nested subvols at all, but to put every subvol independently, and mount them into the places you want them to be. That avoids a lot of the issues of nested subvols, such as the ones you're trying to deal with here. Hugo. -- Hugo Mills | "You know, the British have always been nice to mad hugo@... carfax.org.uk | people." http://carfax.org.uk/ | PGP: E2AB1DE4 | Laura Jesson, Brief Encounter [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: delete recursivly subvolumes? 2019-07-05 19:51 ` Hugo Mills @ 2019-07-05 19:56 ` Ulli Horlacher 2019-07-05 20:02 ` Hugo Mills 0 siblings, 1 reply; 5+ messages in thread From: Ulli Horlacher @ 2019-07-05 19:56 UTC (permalink / raw) To: linux-btrfs On Fri 2019-07-05 (19:51), Hugo Mills wrote: > > Is there a command/script/whatever to snapshot (copy) a subvolume which > > contains (somewhere) other subvolumes? > > > > Example: > > > > root@xerus:/test# btrfs_subvolume_list /test/ | grep /tmp > > /test/tmp > > /test/tmp/xx/ss1 > > /test/tmp/xx/ss2 > > /test/tmp/xx/ss3 > > > > I want to have (with one command): > > > > /test/tmp --> /test/tmp2 > > /test/tmp/xx/ss1 --> /test/tmp2/xx/ss1 > > /test/tmp/xx/ss2 --> /test/tmp2/xx/ss2 > > /test/tmp/xx/ss3 --> /test/tmp2/xx/ss3 > > Remember that this isn't quite so useful, because you can't make > read-only snapshots in that structure. ss1 ss2 and ss3 are indeed read-only snapshots! Of course they do not contain other subvolumes. > Generally, I'd recommend not having nested subvols at all, but to > put every subvol independently, and mount them into the places you > want them to be. That avoids a lot of the issues of nested subvols, > such as the ones you're trying to deal with here. *I* do it this way from the very beginning :-) But I have *users* with *strange* ideas :-} I need to handle their data. -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ REF:<20190705195142.GQ32479@carfax.org.uk> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: delete recursivly subvolumes? 2019-07-05 19:56 ` Ulli Horlacher @ 2019-07-05 20:02 ` Hugo Mills 0 siblings, 0 replies; 5+ messages in thread From: Hugo Mills @ 2019-07-05 20:02 UTC (permalink / raw) To: linux-btrfs [-- Attachment #1: Type: text/plain, Size: 1820 bytes --] On Fri, Jul 05, 2019 at 09:56:39PM +0200, Ulli Horlacher wrote: > On Fri 2019-07-05 (19:51), Hugo Mills wrote: > > > > Is there a command/script/whatever to snapshot (copy) a subvolume which > > > contains (somewhere) other subvolumes? > > > > > > Example: > > > > > > root@xerus:/test# btrfs_subvolume_list /test/ | grep /tmp > > > /test/tmp > > > /test/tmp/xx/ss1 > > > /test/tmp/xx/ss2 > > > /test/tmp/xx/ss3 > > > > > > I want to have (with one command): > > > > > > /test/tmp --> /test/tmp2 > > > /test/tmp/xx/ss1 --> /test/tmp2/xx/ss1 > > > /test/tmp/xx/ss2 --> /test/tmp2/xx/ss2 > > > /test/tmp/xx/ss3 --> /test/tmp2/xx/ss3 > > > > Remember that this isn't quite so useful, because you can't make > > read-only snapshots in that structure. > > ss1 ss2 and ss3 are indeed read-only snapshots! > Of course they do not contain other subvolumes. What I'm saying is that you can't make a RO snapshot of test/tmp to test/tmp2 and have your RO snapshots of ss1-3 in place within it. (OK, you could make the snapshot RW initially, snapshot the others into place and then force it RO, but then you've just broken send/receive on tmp2). > > Generally, I'd recommend not having nested subvols at all, but to > > put every subvol independently, and mount them into the places you > > want them to be. That avoids a lot of the issues of nested subvols, > > such as the ones you're trying to deal with here. > > *I* do it this way from the very beginning :-) > But I have *users* with *strange* ideas :-} > > I need to handle their data. That makes it more awkward. :( Hugo. -- Hugo Mills | "You know, the British have always been nice to mad hugo@... carfax.org.uk | people." http://carfax.org.uk/ | PGP: E2AB1DE4 | Laura Jesson, Brief Encounter [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-05 20:02 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-07-05 19:39 delete recursivly subvolumes? Ulli Horlacher 2019-07-05 19:47 ` Ulli Horlacher 2019-07-05 19:51 ` Hugo Mills 2019-07-05 19:56 ` Ulli Horlacher 2019-07-05 20:02 ` Hugo Mills
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox