[OpenIndiana-discuss] safely cleanup pkg cache?

Stephan Althaus Stephan.Althaus at Duedinghausen.eu
Sun Feb 21 21:42:00 UTC 2021


Hello!

The "-s" option does the minimal obvious remove of the corresponding 
snapshot:

$ beadm list
BE                                Active Mountpoint Space   Policy Created
openindiana-2020:11:03            -      - 42.08M  static 2020-11-03 09:30
openindiana-2020:11:26            -      - 40.50M  static 2020-11-26 13:52
openindiana-2020:11:26-backup-1   -      - 263K    static 2020-12-11 22:27
openindiana-2020:12:29            -      - 34.60M  static 2020-12-29 22:07
openindiana-2021:01:13            -      - 34.68M  static 2021-01-13 21:57
openindiana-2021:02:18            -      - 409.54M static 2021-02-18 22:31
openindiana-2021:02:18-backup-1   -      - 42.21M  static 2021-02-19 13:35
openindiana-2021:02:20            -      - 42.67M  static 2021-02-20 20:52
openindiana-2021:02:20-1          NR     / 166.94G static 2021-02-20 21:22
openindiana-2021:02:20-1-backup-1 -      - 261K    static 2021-02-20 21:30
$ zfs list -t all -r rpool|grep "2020:11:03"
rpool/ROOT/openindiana-2020:11:03 42.1M  5.40G  36.4G  /
$ sudo beadm destroy -s openindiana-2020:11:03
Are you sure you want to destroy openindiana-2020:11:03?
This action cannot be undone (y/[n]): y
Destroyed successfully
$ zfs list -t all -r rpool|grep "2020:11:03"
$

Which facts am i missing here ?

Greetings,
Stephan

On 02/21/21 10:03 PM, Andreas Wacknitz wrote:
> That doesn‘t work correctly either.
>
> Von meinem iPhone gesendet
>
>> Am 21.02.2021 um 21:43 schrieb Stephan Althaus <Stephan.Althaus at duedinghausen.eu>:
>>
>> On 02/21/21 09:17 AM, Andreas Wacknitz wrote:
>>>> Am 21.02.21 um 09:10 schrieb Toomas Soome via openindiana-discuss:
>>>>
>>>>> On 21. Feb 2021, at 08:45, Tim Mooney via openindiana-discuss <openindiana-discuss at openindiana.org> wrote:
>>>>>
>>>>>
>>>>> All-
>>>>>
>>>>> My space-constrained OI hipster build VM is running low on space.
>>>>>
>>>>> It looks like either pkg caching or pkg history is using quite a lot of
>>>>> space:
>>>>>
>>>>> $ pfexec du -ks /var/pkg/* | sort -n
>>>>> 0       /var/pkg/gui_cache
>>>>> 0       /var/pkg/lock
>>>>> 0       /var/pkg/modified
>>>>> 0       /var/pkg/ssl
>>>>> 6       /var/pkg/pkg5.image
>>>>> 955     /var/pkg/lost+found
>>>>> 5557    /var/pkg/history
>>>>> 23086   /var/pkg/license
>>>>> 203166  /var/pkg/cache
>>>>> 241106  /var/pkg/state
>>>>> 9271692 /var/pkg/publisher
>>>>>
>>>>> What is the correct, safe way to clean up anything from pkg that I don't
>>>>> need?
>>>>>
>>>>> The closest information I've found is an article from Oracle on "Minimize
>>>>> Stored Image Metadata":
>>>>>
>>>>>      https://docs.oracle.com/cd/E53394_01/html/E54739/minvarpkg.html
>>>>>
>>>>> This suggests changing the 'flush-content-cache-on-success' property
>>>>> to true (OI defaults to False).
>>>>>
>>>>> Is that it, or are there other (generally safe) cleanup steps that I could
>>>>> take too?  Is 'pkg purge-history' a good idea?
>>>>>
>>>> do not forget to check beadm list -a / zfs list -t snapshot
>>>>
>>>> rgds,
>>>> toomas
>>>>
>>> I have a question regarding beadm destroy here:
>>> I do regularly destroy old BEs with "pfexec beadm destroy <BE name>"
>>> keeping only a handful BEs.
>>> Checking with "zfs list -t snapshot" shows that this won't destroy most
>>> (all?) related snapshots, eg. it typically frees only some mb.
>>> Thus, my rpool is filling over the time and I have to manually destroy
>>> zfs snapshots that belong to deleted BEs.
>>> Is that an intentional behavior of beadm destroy and is there something
>>> how I can enhance on my procedure?
>>>
>>> Regards,
>>> Andreas
>>>
>>> _______________________________________________
>>> openindiana-discuss mailing list
>>> openindiana-discuss at openindiana.org
>>> https://openindiana.org/mailman/listinfo/openindiana-discuss
>> Hello!
>>
>>
>> I use
>>
>> beadm destroy -s <bename>
>>
>> to auto-destroy the corresponding snapshots. See "man beadm"
>>
>>
>> Greetings,
>>
>> Stephan
>>
>>
>>
>> _______________________________________________
>> openindiana-discuss mailing list
>> openindiana-discuss at openindiana.org
>> https://openindiana.org/mailman/listinfo/openindiana-discuss
>
> _______________________________________________
> openindiana-discuss mailing list
> openindiana-discuss at openindiana.org
> https://openindiana.org/mailman/listinfo/openindiana-discuss





More information about the openindiana-discuss mailing list