0

I have a btrfs filesystem and am running OpenSuse 15. It has been upgraded to new OpenSuses several times. The first install may not have been on btrfs. My root partition is getting a little cramped and I'm having trouble figuring out whether it's safe, and how, to delete what I think may be an "unneeded" snapper snapshot.

> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        41G   35G  5.1G  88% /

Does anything here look like a tasty candidate for deletion? Maybe the 17G qgroup?

> btrfs qgroup show /
qgroupid         rfer         excl 
--------         ----         ---- 
0/5          16.00KiB     16.00KiB 
0/257        16.00KiB     16.00KiB 
0/258        14.67MiB     14.67MiB 
....
0/710        11.28GiB    372.00KiB 
1/0          28.32GiB     17.04GiB 
255/269      16.00KiB     16.00KiB 

Snapper lists the following snapshots:

> snapper list
Type   | #   | Pre # | Date                     | User | Cleanup | Description           | Userdata     
-------+-----+-------+--------------------------+------+---------+-----------------------+--------------
single | 0   |       |                          | root |         | current               |              
single | 1   |       | Sat Mar 10 04:01:52 2018 | root |         | first root filesystem |              
pre    | 177 |       | Mon Mar 11 00:37:41 2019 | root | number  | zypp(zypper)          | important=yes
post   | 178 | 177   | Mon Mar 11 00:52:40 2019 | root | number  |                       | important=yes
...
pre    | 283 |       | Sat Sep 21 02:35:12 2019 | root | number  | zypp(zypper)          | important=no 
post   | 284 | 283   | Sat Sep 21 02:36:04 2019 | root | number  |                       | important=no 
pre    | 285 |       | Sun Sep 22 12:51:57 2019 | root | number  | yast snapper          |              
post   | 286 | 285   | Sun Sep 22 12:53:04 2019 | root | number  |                       |              

More gobbledygook to me:

> btrfs subvol show /

@/.snapshots/1/snapshot
        Name:                   snapshot
        UUID:                   4eed144d-9dee-6447-8cd5-75c756bf2367
        Parent UUID:            df2738e0-3b0e-3d42-9cd0-da8252d015be
        Received UUID:          -
        Creation time:          2018-03-10 04:01:52 -0800
        Subvolume ID:           259
        Generation:             936168
        Gen at creation:        11
        Parent ID:              258
        Top level ID:           258
        Flags:                  -
        Snapshot(s):
                                @/.snapshots/177/snapshot
                                @/.snapshots/178/snapshot
                                @/.snapshots/179/snapshot
                                @/.snapshots/180/snapshot
                                @/.snapshots/220/snapshot
                                @/.snapshots/221/snapshot
                                @/.snapshots/234/snapshot
                                @/.snapshots/235/snapshot
                                @/.snapshots/267/snapshot
                                @/.snapshots/268/snapshot
                                @/.snapshots/281/snapshot
                                @/.snapshots/282/snapshot
                                @/.snapshots/283/snapshot
                                @/.snapshots/284/snapshot
                                @/.snapshots/285/snapshot
                                @/.snapshots/286/snapshot
                                @/.snapshots/287/snapshot
                                @/.snapshots/288/snapshot
                                @/.snapshots/289/snapshot
                                @/.snapshots/290/snapshot

Please let me know what other information can help.

3
  • I find it strange that btrfs qgroup show / would show a subvolume ID of 0. Consider adding the output of btrfs subvol list / Commented Sep 24, 2019 at 13:12
  • @EmmanuelRosa Done. I find it all strange... Commented Sep 25, 2019 at 19:09
  • The system is stable and I'd be happy to delete every snapshot if I knew how to properly do so and could be sure that there wouldn't be any large orphans remaining. rm -rf /.snapshots/*? Commented Sep 25, 2019 at 19:18

1 Answer 1

1

Since you're using snapper, it's best to use its tools to manage those snapshots. It's not possible to delete BTRFS snapshots with rm anyway ;)

To delete all the snapshots (except for "current") run: sudo snapper delete 1-290

1
  • Done. Thanks. delete wouldn't operate on a range so I had to specify the snapshots individually. But it cleared ~12GB of space on the 41GB partition for future distro upgrades. I suspect largish orphans hanging around but it's not a show stopper. Commented Sep 30, 2019 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .