Re: Possible to undo subvol delete?

2014-12-08 Thread Austin S Hemmelgarn
On 2014-12-05 13:11, Shriramana Sharma wrote: OK so from https://forums.opensuse.org/showthread.php/440209-ifconfig I learnt that it's because /sbin, /usr/sbin etc is not on the normal user's path on openSUSE (they are, on Kubuntu). Adding them to PATH fixes the situation. (I wasn't even able to

Re: Possible to undo subvol delete?

2014-12-08 Thread Shriramana Sharma
On Mon, Dec 8, 2014 at 6:31 PM, Austin S Hemmelgarn ahferro...@gmail.com wrote: Personally, I prefer a somewhat hybrid approach where everyone has *sbin in their path, but file permissions are used to control what non-administrators can run. This is exactly the same approach as Ubuntu, since

Re: Possible to undo subvol delete?

2014-12-08 Thread Austin S Hemmelgarn
On 2014-12-08 09:16, Shriramana Sharma wrote: On Mon, Dec 8, 2014 at 6:31 PM, Austin S Hemmelgarn ahferro...@gmail.com wrote: Personally, I prefer a somewhat hybrid approach where everyone has *sbin in their path, but file permissions are used to control what non-administrators can run. This

Re: Possible to undo subvol delete?

2014-12-05 Thread David Sterba
On Thu, Dec 04, 2014 at 07:36:34PM +0530, Shriramana Sharma wrote: Well I don't know about you, but I'm just running an openSUSE 13.2 system updated to Tumbleweed here, and even if I just hit btrfs enter (no sudo, no btrfs commands) on my regular (non-root) prompt, I am getting: $ btrfs

Re: Possible to undo subvol delete?

2014-12-05 Thread David Sterba
On Wed, Dec 03, 2014 at 02:54:14PM -0500, Zygo Blaxell wrote: Even with the tty/interactive shell detection in place? Maybe I understood the reference to lvm/mdadm tools wrong. My idea is that the scripts would work as now, no prompts there. How do we reliably distinguish between running

Re: Possible to undo subvol delete?

2014-12-05 Thread Shriramana Sharma
David, I'm just running default openSUSE 13.2 now (had to reinstall for other reasons) and it's there. It's not something I added. Given that you're also on either openSUSE or SLED/SLES, I'd expect your system to act similarly as well. If not, it's downright curious. I guess I'll ask around on

Re: Possible to undo subvol delete?

2014-12-05 Thread Shriramana Sharma
OK so from https://forums.opensuse.org/showthread.php/440209-ifconfig I learnt that it's because /sbin, /usr/sbin etc is not on the normal user's path on openSUSE (they are, on Kubuntu). Adding them to PATH fixes the situation. (I wasn't even able to do ifconfig without giving the password. No

Re: Possible to undo subvol delete?

2014-12-04 Thread Shriramana Sharma
On Thu, Dec 4, 2014 at 12:23 AM, David Sterba dste...@suse.cz wrote: On Tue, Dec 02, 2014 at 08:45:10PM +0530, Shriramana Sharma wrote: On Tue, Dec 2, 2014 at 6:26 PM, David Sterba dste...@suse.cz wrote: Works for me without the root password on a Tumbleweed installation (without

Re: Possible to undo subvol delete?

2014-12-04 Thread Austin S Hemmelgarn
On 2014-12-04 09:06, Shriramana Sharma wrote: On Thu, Dec 4, 2014 at 12:23 AM, David Sterba dste...@suse.cz wrote: On Tue, Dec 02, 2014 at 08:45:10PM +0530, Shriramana Sharma wrote: On Tue, Dec 2, 2014 at 6:26 PM, David Sterba dste...@suse.cz wrote: Works for me without the root password on

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Tue, Dec 02, 2014 at 02:09:45PM +, Hugo Mills wrote: On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On Mon, Dec 01, 2014 at 10:14:03PM -0500, Zygo Blaxell wrote: export BTRFS_SUBVOLUME_DELETE_CONFIRM=1 Ideas? Never rely on aliasing or environment

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Tue, Dec 02, 2014 at 10:25:55AM -0500, Zygo Blaxell wrote: On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On a side note...only root can delete subvolumes, but non-root users can create them, which results in...this: $ /sbin/btrfs sub create foo Create

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Tue, Dec 02, 2014 at 08:45:10PM +0530, Shriramana Sharma wrote: On Tue, Dec 2, 2014 at 6:26 PM, David Sterba dste...@suse.cz wrote: Works for me without the root password on a Tumbleweed installation (without apparmor/selinux). Are you then referring to a btrfs partition mounted with

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Tue, Dec 02, 2014 at 04:11:54PM +0900, Satoru Takeuchi wrote: Hi, (2014/11/30 12:33), Shriramana Sharma wrote: IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the containing subvol exists, it seems that it's not elementary to

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Wed, Dec 03, 2014 at 09:11:48AM +0900, Satoru Takeuchi wrote: It's not a Btrfs itself's feature. It's a snapper's feature. It works as a helper of snapshot management. 1. You takes /snap by snapper create command. 2. You delete /snap by snapper delete command by mistake. Then snapper

Re: Possible to undo subvol delete?

2014-12-03 Thread David Sterba
On Wed, Dec 03, 2014 at 08:05:08AM +0530, Shriramana Sharma wrote: On Wed, Dec 3, 2014 at 5:41 AM, Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com wrote: 2. You delete /snap by snapper delete command by mistake. Then snapper takes a pre snapshot just before deleting /snap. 3. Now

Re: Possible to undo subvol delete?

2014-12-03 Thread Zygo Blaxell
On Wed, Dec 03, 2014 at 07:48:43PM +0100, David Sterba wrote: On Tue, Dec 02, 2014 at 10:25:55AM -0500, Zygo Blaxell wrote: On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On a side note...only root can delete subvolumes, but non-root users can create them, which results

Re: Possible to undo subvol delete?

2014-12-03 Thread Zygo Blaxell
On Wed, Dec 03, 2014 at 07:26:33PM +0100, David Sterba wrote: On Tue, Dec 02, 2014 at 02:09:45PM +, Hugo Mills wrote: On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On Mon, Dec 01, 2014 at 10:14:03PM -0500, Zygo Blaxell wrote: export BTRFS_SUBVOLUME_DELETE_CONFIRM=1

Re: Possible to undo subvol delete?

2014-12-03 Thread Satoru Takeuchi
Hi David, (2014/12/04 4:12), David Sterba wrote: On Wed, Dec 03, 2014 at 09:11:48AM +0900, Satoru Takeuchi wrote: It's not a Btrfs itself's feature. It's a snapper's feature. It works as a helper of snapshot management. 1. You takes /snap by snapper create command. 2. You delete /snap by

Re: Possible to undo subvol delete?

2014-12-02 Thread David Sterba
On Mon, Dec 01, 2014 at 10:14:03PM -0500, Zygo Blaxell wrote: export BTRFS_SUBVOLUME_DELETE_CONFIRM=1 Ideas? Never rely on aliasing or environment variables for defaults, and never change default behavior if your releases are old enough that someone has built scripts on top of them.

Re: Possible to undo subvol delete?

2014-12-02 Thread David Sterba
On Tue, Dec 02, 2014 at 09:10:15AM +0530, Shriramana Sharma wrote: On a side note...only root can delete subvolumes, but non-root users can create them, which results in...this: Not sure about your Debian system, but my openSUSE Tumbleweed (with kernel 3.17.2 and btrfsprogs 3.17) requires

Re: Possible to undo subvol delete?

2014-12-02 Thread Hugo Mills
On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On Mon, Dec 01, 2014 at 10:14:03PM -0500, Zygo Blaxell wrote: export BTRFS_SUBVOLUME_DELETE_CONFIRM=1 Ideas? Never rely on aliasing or environment variables for defaults, and never change default behavior if your

Re: Possible to undo subvol delete?

2014-12-02 Thread Shriramana Sharma
On Tue, Dec 2, 2014 at 6:26 PM, David Sterba dste...@suse.cz wrote: Works for me without the root password on a Tumbleweed installation (without apparmor/selinux). Are you then referring to a btrfs partition mounted with user_subvol_rm_allowed? -- Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

Re: Possible to undo subvol delete?

2014-12-02 Thread Shriramana Sharma
On Tue, Dec 2, 2014 at 12:41 PM, Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com wrote: Snapper can automatically take a snapshot just before taking/deleting snapshots. So, if you delete a snapshot by mistake, it's still alive. Sorta contradicts the whole point of deleting a snapshot, no? Or

Re: Possible to undo subvol delete?

2014-12-02 Thread Zygo Blaxell
On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote: On a side note...only root can delete subvolumes, but non-root users can create them, which results in...this: $ /sbin/btrfs sub create foo Create subvolume './foo' $ date foo/bar $ /sbin/btrfs sub delete

Re: Possible to undo subvol delete?

2014-12-02 Thread Satoru Takeuchi
(2014/12/03 0:17), Shriramana Sharma wrote: On Tue, Dec 2, 2014 at 12:41 PM, Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com wrote: Snapper can automatically take a snapshot just before taking/deleting snapshots. So, if you delete a snapshot by mistake, it's still alive. Sorta contradicts the

Re: Possible to undo subvol delete?

2014-12-02 Thread Shriramana Sharma
On Wed, Dec 3, 2014 at 5:41 AM, Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com wrote: 2. You delete /snap by snapper delete command by mistake. Then snapper takes a pre snapshot just before deleting /snap. 3. Now /snap is deleted, however, a pre snapshot which is the same as /snap

Re: Possible to undo subvol delete?

2014-12-01 Thread Austin S Hemmelgarn
On 2014-11-29 23:23, Marc MERLIN wrote: On Sun, Nov 30, 2014 at 09:03:14AM +0530, Shriramana Sharma wrote: IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the containing subvol exists, it seems that it's not elementary to undelete a subvol

Re: Possible to undo subvol delete?

2014-12-01 Thread Shriramana Sharma
On Mon, Dec 1, 2014 at 6:42 PM, Austin S Hemmelgarn ahferro...@gmail.com wrote: We might want to consider adding an option to btrfs subvol del to ask for confirmation (or make it do so by default and add an option to disable asking for confirmation). I already reported:

Re: Possible to undo subvol delete?

2014-12-01 Thread MegaBrutal
2014-12-01 14:12 GMT+01:00 Austin S Hemmelgarn ahferro...@gmail.com: We might want to consider adding an option to btrfs subvol del to ask for confirmation (or make it do so by default and add an option to disable asking for confirmation). I've also noticed, a subvolume can just be deleted

Re: Possible to undo subvol delete?

2014-12-01 Thread Roman Mamedov
On Mon, 1 Dec 2014 18:49:23 +0530 Shriramana Sharma samj...@gmail.com wrote: As I requested there, I prefer for confirmation by default and -f to force otherwise, rather than behaviour of rm which requires -i to ask confirmation. And I prefer the current behavior (also replied on the bug). A

Re: Possible to undo subvol delete?

2014-12-01 Thread Roman Mamedov
On Mon, 1 Dec 2014 14:38:16 +0100 MegaBrutal megabru...@gmail.com wrote: I've also noticed, a subvolume can just be deleted with an rm -r, just like an ordinary directory. I'd consider to only allow subvolume deletions with exact btrfs subvolume delete commands, and they This is already the

Re: Possible to undo subvol delete?

2014-12-01 Thread Austin S Hemmelgarn
On 2014-12-01 08:38, MegaBrutal wrote: 2014-12-01 14:12 GMT+01:00 Austin S Hemmelgarn ahferro...@gmail.com: We might want to consider adding an option to btrfs subvol del to ask for confirmation (or make it do so by default and add an option to disable asking for confirmation). I've also

Re: Possible to undo subvol delete?

2014-12-01 Thread Holger Hoffstätte
On Mon, 01 Dec 2014 14:38:16 +0100, MegaBrutal wrote: I've also noticed, a subvolume can just be deleted with an rm -r, just like an ordinary directory. I'd consider to only allow subvolume Nope: rootbtrfs subvolume create foo Create subvolume './foo' roottouch foo/bla rootll foo total 0

Re: Possible to undo subvol delete?

2014-12-01 Thread MegaBrutal
2014-12-01 14:47 GMT+01:00 Roman Mamedov r...@romanrm.net: On Mon, 1 Dec 2014 14:38:16 +0100 MegaBrutal megabru...@gmail.com wrote: I've also noticed, a subvolume can just be deleted with an rm -r, just like an ordinary directory. I'd consider to only allow subvolume deletions with exact

Re: Possible to undo subvol delete?

2014-12-01 Thread Shriramana Sharma
On Mon, Dec 1, 2014 at 7:16 PM, Roman Mamedov r...@romanrm.net wrote: A more sensible idea could be adding a global-level '-i' switch, same as in 'rm', so that you or distros could then alias 'btrfs' to 'btrfs -i' (ask confirmation on any irreversible action). Well the difference being that

Re: Possible to undo subvol delete?

2014-12-01 Thread Shriramana Sharma
On Mon, Dec 1, 2014 at 7:24 PM, MegaBrutal megabru...@gmail.com wrote: If you want to make snapshots which can't be removed by ordinary tools, use the 'read-only' mode when creating them. Yeah, good idea! Anyway, is it possible to change a read-only snapshot to read-write and vica-versa, or

Re: Possible to undo subvol delete?

2014-12-01 Thread Robert White
On 12/01/2014 08:40 AM, Shriramana Sharma wrote: IIUC you can only specify RO while creating but you can always cheaply create a RW snapshot of an RO one or an RO snapshot of an RW one... You can turn ReadOnly status on and off (er. true and false) with btrfs property get/set ro=true/false

Re: Possible to undo subvol delete?

2014-12-01 Thread Austin S Hemmelgarn
On 2014-12-01 08:54, MegaBrutal wrote: 2014-12-01 14:47 GMT+01:00 Roman Mamedov r...@romanrm.net: On Mon, 1 Dec 2014 14:38:16 +0100 MegaBrutal megabru...@gmail.com wrote: I've also noticed, a subvolume can just be deleted with an rm -r, just like an ordinary directory. I'd consider to only

Re: Possible to undo subvol delete?

2014-12-01 Thread David Sterba
On Mon, Dec 01, 2014 at 08:50:09AM -0500, Austin S Hemmelgarn wrote: It would not surprise me though if RHEL or SuSE had patched the kernel to allow using rm on a subvolume. This would be quite a big change in behaviour that we would not do without taking it upstream first. -- To unsubscribe

Re: Possible to undo subvol delete?

2014-12-01 Thread David Sterba
On Mon, Dec 01, 2014 at 08:12:02AM -0500, Austin S Hemmelgarn wrote: On 2014-11-29 23:23, Marc MERLIN wrote: On Sun, Nov 30, 2014 at 09:03:14AM +0530, Shriramana Sharma wrote: IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the

Re: Possible to undo subvol delete?

2014-12-01 Thread Zygo Blaxell
On Mon, Dec 01, 2014 at 10:09:44PM +0530, Shriramana Sharma wrote: On Mon, Dec 1, 2014 at 7:16 PM, Roman Mamedov r...@romanrm.net wrote: A more sensible idea could be adding a global-level '-i' switch, same as in 'rm', so that you or distros could then alias 'btrfs' to 'btrfs -i' (ask

Re: Possible to undo subvol delete?

2014-12-01 Thread Shriramana Sharma
On Tue, Dec 2, 2014 at 8:44 AM, Zygo Blaxell ce3g8...@umail.furryterror.org wrote: This is consistent with the way lvm2 and mdadm work when presented with data-losing or otherwise questionable commands and parameters. It will break scripts, but btrfs users should still be expecting that for a

Re: Possible to undo subvol delete?

2014-12-01 Thread MegaBrutal
2014-12-01 17:39 GMT+01:00 Shriramana Sharma samj...@gmail.com: When btrfs has so many features (esp snapshots) to prevent user accidentally deleting data (I liked especially http://www.youtube.com/v/9H7e6BcI5Fo?start=209) I think there has to be *some* modicum of support for warning against

Re: Possible to undo subvol delete?

2014-12-01 Thread MegaBrutal
2014-12-02 4:40 GMT+01:00 Shriramana Sharma samj...@gmail.com: Well in office environs, where the root password is with a certain person only, then that's fine because that person is going to be wary of doing anything that's make others angry at them, but on single-user systems, one's regular

Re: Possible to undo subvol delete?

2014-12-01 Thread Marc MERLIN
On Tue, Dec 02, 2014 at 06:33:38AM +0100, MegaBrutal wrote: 2014-12-01 17:39 GMT+01:00 Shriramana Sharma samj...@gmail.com: When btrfs has so many features (esp snapshots) to prevent user accidentally deleting data (I liked especially http://www.youtube.com/v/9H7e6BcI5Fo?start=209) I

Re: Possible to undo subvol delete?

2014-12-01 Thread Satoru Takeuchi
Hi, (2014/11/30 12:33), Shriramana Sharma wrote: IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the containing subvol exists, it seems that it's not elementary to undelete a subvol itself, because all subvols are under the root-level subvol

Possible to undo subvol delete?

2014-11-29 Thread Shriramana Sharma
IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the containing subvol exists, it seems that it's not elementary to undelete a subvol itself, because all subvols are under the root-level subvol (id 0 or 5, see my other q) but even snapshotting

Re: Possible to undo subvol delete?

2014-11-29 Thread Marc MERLIN
On Sun, Nov 30, 2014 at 09:03:14AM +0530, Shriramana Sharma wrote: IIUC with BtrFS while it is possible to easily undelete a file or ordinary directory if a snapshot of the containing subvol exists, it seems that it's not elementary to undelete a subvol itself, because all subvols are under