A rookie's question about Btrfs and snapper

Dear friends,
I am a physics graduate student, because of the requirements of the experimental equipment, now I started to teach myself linux, I tried several versions of linux, and finally chose suse, of course, the initial reason is that I need a system that looks and works like windows (at that time, I didn’t know the difference between KDE and GOME), with my As I got to know it better, I liked suse, especially YAST and the default B-tree filesystem, which is very useful for newbies like me.
Now I’m facing a problem, because I’m not familiar with linux, especially the complex and strict permissions management, when I log in with a non-root account, I can make changes to some installers, and I often encounter permissions problems, for example, when anaconda can’t create a virtual environment, or when several people need to use a public folder, I try to use chmod -R 777 and chmod 2777 to solve the problem violently. When I use chmod directly on /etc and /usr, my system hangs, unsurprisingly. I’ve learnt a bit before that the snapshot feature of snapper and btrfs can be good for backups and prevent me from doing something really stupid. However, when I tested it today, I found that snapper seems to only create snapshots when I install and remove software, and it doesn’t seem to react to a lot of incorrectly modified permissions. Quite a few folders in the suse root directory are mounted as subvolumes for snapshots, but when I do this in yast’s filesystem snapshots, I find that the GUI seems to only be able to “back up globally” and not to specify a subvolume (which it can do using the command line).
Today, after setting /usr wrongly to 775, I unsurprisingly broke my system once, and tried to use yast’s snapper to revert, only to find that my image did not contain a backup of the /usr permissions change (when I showed the difference), and I ended up having to find the normal /usr under some version of /.snapshots, and then just overwrite the original file.
I’m trying to figure out the logic of the btrfs that SUSE has set up by default, or any GUI management software that will allow me to better control and restore files.
I’ve written a lot, which is not in line with the virtues of programmers, I just want to expose my mistakes as much as possible, and I hope you can give me some help and advice.
(Also, I would like to know if there are any scripts or settings I can use to avoid being bothered by permissions issues without using root, I don’t care about security, I generally just write code and programs)

That is simply a NoNo. You should solve your “problems” another way.

The documentation has many informations what snapper can do and what not:

Hello @zl2001 ,

There is much in your post.

Just a couple of things to get you started. You can use the yast security center to set relaxed file permissions in generalized way. Once in the security center, choose configure on the second item, which is labeled “Use secure file permissions”. You can choose “easy” from the popup.

I don’t understand why you might actually need wide open /etc or anything else traditionally owned by root. If you really want to have a globally accessible playground, probably better to use “/usr/local”.

Snapper is a great tool for some, but it is not a substitute for backups.

Cheers

You mentioned anaconda. Are most of your struggles with python dependencies? This combined with being new to Linux could be uniquely frustrating. I haven’t done much beyond one-off stuff in python in years but you might want to reach out to some python specific forums for best practices.

I’m still new to btrfs myself but possibly in meantime you could explicitly do something like this before an adventurous change:

sudo snapper create --desc “I may be about to break something”

I’m sure someone will correct me if there is more involved.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.