You are not logged in.

#1 2025-01-08 23:48:37

SD
Member
Registered: 2025-01-04
Posts: 25

Using Snapper to restore home folder

My home folder was getting full and must've created some temp files that was causing issues by being too full. Game was not launching, couldn't open the browser and getting a warning on my terminal about .zsh... I deleted folders and files but the space did not seem to increase for some reason. Eventually, I deleted the dotfiles for Hyprland, making my DE a bit unusable at the moment. So I decided to chroot into live CD. I have .snapshots file for snapper but whenever I do

 snapper list--configs 

or

 snapper -c config list 

it yields:

Failure (org.freedesktop.DBus.Error.FileNotFound). 

I can, however, see the files in question up until an hour ago, when issues started to arise, as well as previous ones. I don't know how to best proceed, whether to try to do a snapshot restore and risk causing more harm than good, deleting more space on live CD, somehow or login as normal and go through there?
Seems like the snapshot would be the best way but also the riskier. The info on the Arch wiki about snapper might not apply exactly because I mounted as btrfs but without using the @subvolume schema but 2 partitions, which might be causing the issues as well...

Offline

#2 2025-01-09 00:50:42

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

I have since gotten into another distro live CD just to be able to use a graphical interface. Kept on deleting folders in my home folder which, instead of the 33 GB (being essentially full), now says 18 GB but, as suspected, it still gives the only 660 MB free, which is causing issues. I suspect that may be the case as to why the kitty terminal is not opening on Hyprland and am having issues overall in there. I still think the snapper restore would be the best solution but I can't seem to be able to do it. I have about 180 snapshots at this point and would like to restore to one of about 4 hours ago. Any idea as to why the free disk space is not being updated? What would be the best course of action now, barring a full reinstall of everything?

Offline

#3 2025-01-09 05:18:56

-thc
Member
Registered: 2017-03-15
Posts: 775

Re: Using Snapper to restore home folder

SD wrote:

I have about 180 snapshots at this point and would like to restore to one of about 4 hours ago. Any idea as to why the free disk space is not being updated?

180 snapshots? You probably don't know what you are doing. Otherwise you wouldn't wonder where the disk space is going (it's consumed by the snapshots).

Offline

#4 2025-01-09 11:11:26

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

Yeah, I think that may be part of the problem. Do you think that would also explain why, no matter how much I delete, it still gives the same remaining space in the home folder? How do I rollback to snapshot number 160 or 165? Then, after restoring, I'd just try to edit or delete older snapshots
I saw on Arch wiki that I need to stop the service, but when I do it on chroot, doesn't show anything active. I can just see the snapshots. I can't access the terminal on my installation, only chroot through live CD or tty in the sddm login screen

Offline

#5 2025-01-09 11:39:23

-thc
Member
Registered: 2017-03-15
Posts: 775

Re: Using Snapper to restore home folder

SD wrote:

Yeah, I think that may be part of the problem. Do you think that would also explain why, no matter how much I delete, it still gives the same remaining space in the home folder?

Yep.

SD wrote:

How do I rollback to snapshot number 160 or 165? Then, after restoring, I'd just try to edit or delete older snapshots
I saw on Arch wiki that I need to stop the service, but when I do it on chroot, doesn't show anything active. I can just see the snapshots. I can't access the terminal on my installation, only chroot through live CD or tty in the sddm login screen

I'm not an expert on BTRFS but the first step I would take is to boot from a live medium and check the filesystem.
Create a backup.
If it's O.K. I would try to remove the ~50 oldest snapshots and check the filesystem for breathing space.
If there is some space I would try to revert to a specific snapshot either from the live medium or the booted installation (if possible).

Last edited by -thc (2025-01-09 11:50:51)

Offline

#6 2025-01-09 11:44:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,897

Re: Using Snapper to restore home folder

That's the point of snapshots whenever you change or delete a file, as long as there's a snapshot to rollback to a certain state you're not going to reclaim that space unless you also delete the file from all snapshots.

A cursory googler shows that snapper should have a --no-dbus cmdline option you should be able to use while in the chroot without the actual service running

Offline

#7 2025-01-09 12:16:53

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

So the best course of action would be to delete older snapshots in chroot, probably the first hundred or so, then somehow try to rollback?
Looking into that option of the --no-dbus, but still don't know how to restore a snapshot. I know I installed grub-btrfs a few days ago, I was expecting it to be an option in GRUB itself but doesn't seem like it.

Offline

#8 2025-01-09 14:22:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,897

Re: Using Snapper to restore home folder

Read the snapper wiki page https://wiki.archlinux.org/title/Snapper and if something is unclear there read the snapper opensuse upstream docs. Did you run grub-mkconfig after installing grub-btrfs? I doubt this will help if your root and home are indeed distinct partitions rather than snapshots on a single filesystem as GRUB isn't used to boot into home directories.

if your home is a completely seperate partition rather than a seperate subvol then the "subvol" will just be @ and you should be able to just rollback to a specific snapshot as explained in the wiki. If you can't make heads or tails of that post actable information from your system, like mount your stuff like you think it's correct, chroot in and post the outputs of

mount
snapper --no-dbus -c root list #replace root with your actual snapper config name

https://wiki.archlinux.org/title/List_o … n_services

Last edited by V1del (2025-01-09 14:23:30)

Offline

#9 2025-01-09 16:03:50

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

I am not sure whether I did run that command afterwards, probably not. It's on /dev/nvme0n1p3, together with root and swap, just not "linked" as being a subvolume. When I do live CD stuff in another distro, it shows up as 2 different volumes, after opening the encrypted volume. So subdirectory? I chrooted into root, I can see the files; the snapshots are a hidden folder. .snapshots, in home. when I run the snapper command, I get the list of all the snapshots. Most recent one was today.

173 | single |     | Thu Jan 9 00:56:03 2025 | root | number | boot |
174 | single |     | Thu Jan 9 01:00:18 2025 | root | timeline | timeline |
175 | single |     | Thu Jan 9 06:55:48 2025 | root | timeline | timeline |
176 | single |     | Thu Jan 9 15:10:47 2025 | root | timeline | timeline |

(Can't seem to upload any pastebin, something with zsh, I think the shell isn't working properly.)
and I can see as far back as 131, done on Monday. I'd like to restore to some between that and 165.
I will parse through the wiki carefully, see how I can rollback

Offline

#10 2025-01-09 17:54:45

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

So from what I'm reading on the OpenSUSE docs (the Arch wiki seems a bit confusing and I did not get how to restore it properly there), the best way would be to do a rollback from boot. However, since it's a LVM encrypted partition, that can't be done. So I either try to see the exact files and substitute only those, or do a rollback. I think I'd rather do a full rollback up to a day or so ago. I assume the best way to go about it would be to first delete really old snapshots, anything over a week ago, and only then do the rollback due to space limitations? No risk of screwing up anything since it's, essentially, moving files from one place to the other "under the hood", from what I understand, and not really deleting anything?

Offline

#11 2025-01-09 18:07:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,897

Re: Using Snapper to restore home folder

Basically, yes.

Offline

#12 2025-01-09 18:15:12

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

So, on a live CD now, should I just do a

snapper rollback 160

chrooted? Or would it be better to delete older snapshots first? Because I might still have the issue of space regardless, but I'd rather do it without being chrooted, in a graphical environment that works. I won't risk data that way, if I understand correctly

Offline

#13 2025-01-09 18:39:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,897

Re: Using Snapper to restore home folder

You're not going to have space issues since you are just restoring a snapshot that's already present anyway (already existing/new snapshots don't add to the size unless you actively modify the data), but if you want to be on the safer side it wouldn't hurt to delete old snapshots. from a chroot you'd have to add --no-dbus to that call.

I'm not sure how "running this from a graphical environment" will be any safer. You're not on the actual system you need to do this without the snapper daemon that originally created the snapshots anyway.  But I can't give you any definitive advice since I don't use snapper, I generally doubt you're able to do more damage than what's already done.

Offline

#14 2025-01-09 18:55:06

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

I tried performing that rollback. It gave me an error

Cannot detect ambit since default subvolume is unknown.
This can happen if the system was not set up for rollback.
The ambit can be specified manually using the --ambit option.

to which I searched and saw that you can do --ambit classic as an option. I did that and seemed to have worked but, when I went to reboot, as I opened my encrypted volume, it said failure... too fast to be able to read anything else. I confirm it did not work since I am now logged in with the same issue, after having done the mistake and not having rollback successfully.
Trying in tty (since I can't seem to access kitty in my desktop) in both root and user. Saying snapshot is not found

Last edited by SD (2025-01-09 18:59:22)

Offline

#15 2025-01-09 19:22:59

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

I have logged in in both root and user and says that snapshots can't be found. I eventually had to stop the snapper service to try a rollback, to no avail. I am chrooted again and can see the snapshot directory, however, the numbers seem to have changed with the highest being 107, instead of 176. But that snapshot is as recent as yesterday, almost full 24 hours ago, after having screwed up, so anything more recent than that seems to be there. I can't understand the --ambit flag or why I can't find the snapshots while logged in but can in chroot
Am I supposed to stop the service while chrooted? That makes no sense to me because I'm not technically logged in so I'm a bit confused and can't even find the system itself, the process running
Maybe an issue with the mount? I am truly lost as to why I can't do that rollback

Offline

#16 2025-01-09 20:53:20

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

Trying again on chroot. If I do the --no-dbus flag, it still asks for --ambit. So

snapper --no-dbus --ambit classic rollback 103

gives me a

reading failed
Ambit is classic. 
Snapshot '103' not found.

however, I can cd into the .snapshots directory and see the info.xml of the snapshot folders as well as files inside them.
Are there any packages that might be missing or some mistake at using the service? I also have Timeshift installed, is it possible to use the same snapshots from the chroot, since it doesn't seem to be working with snapper?
Also, I seem to have a .snapshots directory in root and another inside the home folder but the one in root seems to be empty? But, either way, home is visible and I mounted it before chrooting and can see the files yet there's the issue of not finding the snapshot. What am I doing wrong?

Last edited by SD (2025-01-09 21:08:42)

Offline

#17 2025-01-10 14:00:03

SD
Member
Registered: 2025-01-04
Posts: 25

Re: Using Snapper to restore home folder

I'm trying to do it through the actual installation since chroot has not worked. I always get a reading failure, no matter the flags I use, whether root or home. I do not understand why since the partition is mounted and I can see the folder with the specific .snapshots.
So, the issue with logging in is that I can't access the terminal. Trying to access the folders "by hand" does not work either, says "Could not enter folder /home/.snapshots.
I am just trying to remove old snapshots at this point which might make the space issue disappear and maybe get the terminal to work again, since I don't believe I deleted any of that configuration. Being able to access them, I could just try to substitute folders/files one by one since I did not make such a huge deletion mostly temporary files and Hyprland config files)
I think the issue might be fixed if I could mount it as read and write somehow? Because it seems more like an issue with permissions. Even just being able to copy one of the snapshot folders to a flashdrive and then trying to just copy the files there would be enough, albeit a very weird roundabout way of solving the issue. I tried using

 mount -o remount, rw /path... 

but says mount point does not exist. Either way, I can't access the file through any graphical interface but can at least see them in the terminal in some live CD. Really struggling to do anything about this at this point. Any tips?

Last edited by SD (2025-01-10 21:40:30)

Offline

Board footer

Powered by FluxBB