Bug 89091 - btrfs subvolume delete should ask for confirmation before deleting
Summary: btrfs subvolume delete should ask for confirmation before deleting
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: David Sterba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-30 14:17 UTC by Shriramana Sharma
Modified: 2016-03-20 11:21 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.17.2-1-desktop
Tree: Mainline
Regression: No


Attachments

Description Shriramana Sharma 2014-11-30 14:17:46 UTC
I request that btrfs subvolume delete should ask for confirmation before deleting since this is potentially a dangerous action from the ordinary user's viewpoint.

Of course there are lots of dangerous actions like dd if=/dev/zero of=/dev/sda, but still, since BtrFS is so nice with regarding to preventing user errors it would be great if it just asked me the once before deleting a subvolume.

BtrFS is great because it enabled deleted files and directories to be recovered from earlier snapshots, but deleted subvolumes cannot be recovered. Well yes if there is a snapshot of the subvol it would help but somehow I still feel deleting subvols is more serious than deleting files/directories *because* it's BtrFS.

While ordinary rm has option -i to actually *ask* to delete files, but in this case of btrfs subvol del I feel it is more appropriate to make asking for confirmation the default and -f can be provided to for those who don't want to be asked to confirm.

Thanks!

[BTW I wasn't sure about filing a btrfs-progs file at kernel bugzilla but I didn't find separate instructions for btrfs-progs so I go ahead and submit here. Like bug #66911 I figured it's OK to do this here.]
Comment 1 Roman Mamedov 2014-12-01 13:42:57 UTC
And I "request" that the current behavior is kept as is.

It is consistent with the behavior of standard Unix tools such as 'rm', and doesn't get in the way when I create and delete snapshots by the dozen during my normal day-to-day operation of Btrfs.

If you are new with Btrfs, maybe you should use it for some time more, place
more thought in your practices regarding keeping or deleting snapshots, not
going right out and asking fundamental things about behavior of its tools to be changed to your liking.
Comment 2 David Sterba 2014-12-02 13:06:30 UTC
In the mailinglist discussion, there was a proposal to ask the user if the command is run from a terminal, no change if running from scripts. A new option -f/--force would be added.

This sounds as a reasonable compromise, but the question is still open for discussion.

Note You need to log in before you can comment on or make changes to this bug.