Solved How to remove the oldest backups in a ZFS disk without to destroy the system....

Hello to everyone.

Again one ZFS question. On :

Code:
zroot3/ROOT/default                       294G     7.01G     43.2G      /

only 7G are available. I need more space,but I don't know which backups can I remove without to destroy the system. Can someone explain to me what and how can I remove the oldest backups ? thanks.

Code:
==> zpool list

NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot3      460G   439G  21.3G        -         -    68%    95%  1.00x    ONLINE  -

==> zfs list

NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT

zroot3                                          439G  7.02G    96K  /zroot
zroot3/ROOT                                     294G  7.02G    96K  none
zroot3/ROOT/14.0-RELEASE-p5_2024-04-01_211643   248K  7.02G   115G  /
zroot3/ROOT/14.0-RELEASE-p6_2024-06-04_124102   192K  7.02G   207G  /
zroot3/ROOT/14.0-RELEASE-p6_2024-06-30_235909   248K  7.02G   137G  /
zroot3/ROOT/14.0-RELEASE-p7_2024-07-06_030222   240K  7.02G   141G  /
zroot3/ROOT/14.1-RELEASE-p2_2024-07-16_194545   216K  7.02G   147G  /
zroot3/ROOT/14.1-RELEASE-p2_2024-08-12_120748   472K  7.02G   158G  /
zroot3/ROOT/14.1-RELEASE-p3_2024-09-15_170809   216K  7.02G   153G  /
zroot3/ROOT/default                             294G  7.02G  43.2G  /
zroot3/tmp                                      609M  7.02G   609M  /tmp
zroot3/usr                                     87.2G  7.02G  41.2G  /usr
zroot3/usr/home                                19.2G  7.02G  19.2G  /usr/home
zroot3/usr/home/emby                            112K  7.02G   112K  /usr/home/emby
zroot3/usr/ports                               23.5G  7.02G  23.5G  /usr/ports
zroot3/usr/src                                 2.52G  7.02G  2.52G  /usr/src
zroot3/usr/src-old                              819M  7.02G   819M  /usr/src-old
zroot3/var                                     56.5G  7.02G  54.1G  /var
zroot3/var/audit                                 96K  7.02G    96K  /var/audit
zroot3/var/crash                               1.11G  7.02G  1.11G  /var/crash
zroot3/var/log                                 6.88M  7.02G  6.88M  /var/log
zroot3/var/mail                                1.33G  7.02G  1.33G  /var/mail
zroot3/var/tmp                                 18.1M  7.02G  18.1M  /var/tmp

==> bectl list

BE                                Active Mountpoint Space Created
14.0-RELEASE-p5_2024-04-01_211643 -      -          9.33G 2024-04-01 21:16
14.0-RELEASE-p6_2024-06-04_124102 -      -          56.0G 2024-06-04 12:41
14.0-RELEASE-p6_2024-06-30_235909 -      -          177M  2024-06-30 23:59
14.0-RELEASE-p7_2024-07-06_030222 -      -          1.28G 2024-07-06 03:02
14.1-RELEASE-p2_2024-07-16_194545 -      -          5.99G 2024-07-16 19:45
14.1-RELEASE-p2_2024-08-12_120748 -      -          20.3G 2024-08-12 12:07
14.1-RELEASE-p3_2024-09-15_170809 -      -          17.5G 2024-09-15 17:08
default                           NR     /          294G  2023-12-04 16:08

==> df

Filesystem              1K-blocks       Used     Avail Capacity  Mounted on

zroot3/ROOT/default      52610104   45256844   7353260    86%    /
devfs                           1          0         1     0%    /dev
fdescfs                         1          0         1     0%    /dev/fd
procfs                          8          0         8     0%    /proc
zroot3/tmp                7976776     623516   7353260     8%    /tmp
zroot3/var/log            7360304       7044   7353260     0%    /var/log
zroot3                    7353356         96   7353260     0%    /zroot
zroot3/usr               50546492   43193232   7353260    85%    /usr
zroot3/var/tmp            7371840      18580   7353260     0%    /var/tmp
zroot3/var/mail           8746756    1393496   7353260    16%    /var/mail
zroot3/var/crash          8517816    1164556   7353260    14%    /var/crash
zroot3/var/audit          7353356         96   7353260     0%    /var/audit
zroot3/usr/ports         32005948   24652688   7353260    77%    /usr/ports
zroot3/usr/src            9990884    2637624   7353260    26%    /usr/src
zroot3/usr/src-old        8191548     838288   7353260    10%    /usr/src-old
zroot3/usr/home          27489224   20135964   7353260    73%    /usr/home
zroot3/usr/home/emby      7353372        112   7353260     0%    /usr/home/emby
 
First of all, if you dont need 14.0, just do beadm destroy for them.

beadm destroy zroot3/ROOT/14.0-RELEASE-p5_2024-04-01_211643 ? This action will have an impact to default ?
Can the backups work independently ?

Can you explain to me why if the disk is 460G, (9.33G + 56.0G + 177M + 1.28G + 5.99G + 20.3G + 17.5G + 294G) = 403...

Where is the difference ? (460-403) = ?
 
beadm destroy zroot3/ROOT/14.0-RELEASE-p5_2024-04-01_211643 ? This action will have an impact to default ?
Can the backups work independently ?
No, just beadm destroy name_in_list:

beadm destroy 14.0-RELEASE-p5_2024-04-01_211643

Default will be fine. I deleted my old BE's, from older to newer, except BE before default, everything is OK. Independent work (out of order deletion of BE's?) didn't test.

About space, I think more informative is command zfs get space
 
ZFS BEs/snapshots are interesting. A BE/snapshot space is the "difference" from the source.
If you do beadm list or bectl list, start with the oldest one. Do bectl destroy -o blahblahblah and then bectl list and see what happens to use and space.
bectl list the NR flags indicate "Now in use" and "Reboot will use this", so as other say default is what you are currently running and what you will be rebooted into.
You should be able to "bectl destroy -o" all of the following:


14.0-RELEASE-p5_2024-04-01_211643
14.0-RELEASE-p6_2024-06-04_124102
14.0-RELEASE-p6_2024-06-30_235909
14.0-RELEASE-p7_2024-07-06_030222
14.1-RELEASE-p2_2024-07-16_194545
14.1-RELEASE-p2_2024-08-12_120748
14.1-RELEASE-p3_2024-09-15_170809
 
What's the difference ?

beadm is a package
whereas bectl comes with freebsd
in execution, not much or nothing.
beadm is a shell script roughly equivalent to beadm from Solaris.
bectl is an executable (not shell script) that is basically command line compatible with beadm.

So bectl you don't need to pkg install anything.

Just bectl destroy -o older BEs.
 
Back
Top