Рейтинг:2

/var/log has huge size because of snap

флаг cn

Recently after I restarted my computer, it was giving "Low Disk Space Warning" . I did not care and because of that /var/log became %100 and I could not open my OS. So I deleted some files under /var.

Now it is %95 but it still gives that warning at beginning. You can see in picture after I clicked "examine" in that warning:

after clicked examine button on the warning

This is the size:

 canerveg@canerVegan  ~  df -h                              
Filesystem      Size  Used Avail Use% Mounted on
udev            7,7G     0  7,7G   0% /dev
tmpfs           1,6G   97M  1,5G   7% /run
/dev/nvme0n1p5   61G  6,9G   51G  12% /
tmpfs           7,7G  715M  7,0G  10% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           7,7G     0  7,7G   0% /sys/fs/cgroup
/dev/nvme0n1p2  946M  144M  737M  17% /boot
/dev/nvme0n1p1  975M   11M  964M   2% /boot/efi
/dev/nvme0n1p6  149G   34G  107G  25% /home
/dev/nvme0n1p4  5,6G  5,2G  143M  98% /var
/dev/loop1      9,2M  9,2M     0 100% /snap/canonical-livepatch/99
/dev/loop3      100M  100M     0 100% /snap/core/11316
/dev/loop4       56M   56M     0 100% /snap/core18/2066
/dev/loop7       65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/loop5      163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop6      219M  219M     0 100% /snap/gnome-3-34-1804/66
/dev/loop8       66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/loop10     323M  323M     0 100% /snap/wine-platform-6-stable/5
/dev/loop16      51M   51M     0 100% /snap/snap-store/542
/dev/loop17      33M   33M     0 100% /snap/snapd/12398
/dev/loop18      56M   56M     0 100% /snap/core18/2074
/dev/loop22      51M   51M     0 100% /snap/snap-store/547
/dev/loop19     323M  323M     0 100% /snap/wine-platform-6-stable/3
/dev/loop21     165M  165M     0 100% /snap/gnome-3-28-1804/161
/dev/loop23     5,5M  5,5M     0 100% /snap/notepad-plus-plus/285
/dev/loop24     304M  304M     0 100% /snap/wine-platform-5-stable/16
/dev/loop25     219M  219M     0 100% /snap/gnome-3-34-1804/72
tmpfs           1,6G   28K  1,6G   1% /run/user/125
tmpfs           1,6G   48K  1,6G   1% /run/user/1000
/dev/loop26     338M  338M     0 100% /snap/wine-platform-runtime/228
/dev/loop12     100M  100M     0 100% /snap/core/11420
/dev/loop2       33M   33M     0 100% /snap/snapd/12704
/dev/loop14     5,5M  5,5M     0 100% /snap/notepad-plus-plus/287
/dev/loop20      11M   11M     0 100% /snap/canonical-livepatch/104
/dev/loop27     338M  338M     0 100% /snap/wine-platform-runtime/231

I did not know /var would be used so much. That is why i had given only 5.7 gb.

Biggest files in /var:

✘ canerveg@canerVegan  ~  sudo du -h --max-depth=6 /var | sort -h|tail -n25
6,1M    /var/cache/cracklib
6,4M    /var/lib/gdm3
6,6M    /var/cache/cups
8,1M    /var/cache/apparmor
8,9M    /var/lib/snapd/snapshots
12M /var/lib/app-info/icons/ubuntu-focal-universe/64x64
12M /var/log
17M /var/lib/app-info/icons/ubuntu-focal-universe
20M /var/lib/app-info
20M /var/lib/app-info/icons
28M /var/cache/app-info
28M /var/cache/app-info/cache
70M /var/lib/dpkg/info
75M /var/lib/dpkg
84M /var/cache/apt
148M    /var/cache
422M    /var/lib/snapd/seed
422M    /var/lib/snapd/seed/snaps
527M    /var/lib/apt
527M    /var/lib/apt/lists
1,8G    /var/lib/snapd/snaps
2,1G    /var/lib/snapd/cache
4,3G    /var/lib/snapd
4,9G    /var/lib
5,1G    /var

I think i can delete this safely:

2,1G    /var/lib/snapd/cache

but why do I have to delete those? If I knew it would go so high, I could give more size. Should I increase size because I have

/dev/nvme0n1p6  149G   34G  107G  25% /home

but it will be risky to shrink/resize.

Those are snaps:

 canerveg@canerVegan  ~  snap list --all    
Name                    Version                     Rev    Tracking         Publisher   Notes
canonical-livepatch     9.6.2                       99     latest/stable    canonical✓  disabled
canonical-livepatch     9.7.2                       104    latest/stable    canonical✓  -
core                    16-2.51.1                   11316  latest/stable    canonical✓  core,disabled
core                    16-2.51.3                   11420  latest/stable    canonical✓  core
core18                  20210507                    2066   latest/stable    canonical✓  base,disabled
core18                  20210611                    2074   latest/stable    canonical✓  base
gnome-3-28-1804         3.28.0-19-g98f9e67.98f9e67  145    latest/stable    canonical✓  disabled
gnome-3-28-1804         3.28.0-19-g98f9e67.98f9e67  161    latest/stable    canonical✓  -
gnome-3-34-1804         0+git.3556cb3               66     latest/stable/…  canonical✓  disabled
gnome-3-34-1804         0+git.3556cb3               72     latest/stable/…  canonical✓  -
gtk-common-themes       0.1-52-gb92ac40             1515   latest/stable/…  canonical✓  -
gtk-common-themes       0.1-50-gf7627e4             1514   latest/stable/…  canonical✓  disabled
notepad-plus-plus       8.1.2                       287    latest/stable    mmtrt       -
notepad-plus-plus       8.1.1                       285    latest/stable    mmtrt       disabled
snap-store              3.38.0-63-g766b86f          542    latest/stable/…  canonical✓  disabled
snap-store              3.38.0-64-g23c4c77          547    latest/stable/…  canonical✓  -
snapd                   2.51.3                      12704  latest/stable    canonical✓  snapd
snapd                   2.51.1                      12398  latest/stable    canonical✓  snapd,disabled
wine-platform-5-stable  5.0.3                       16     latest/stable    mmtrt       -
wine-platform-6-stable  6.0.1                       3      latest/stable    mmtrt       disabled
wine-platform-6-stable  6.0.1                       5      latest/stable    mmtrt       -
wine-platform-runtime   v1.0                        231    latest/stable    mmtrt       -
wine-platform-runtime   v1.0                        228    latest/stable    mmtrt       disabled

Here it removes old versions: https://www.debugpoint.com/2021/03/clean-up-snap/

but I am thinking of removing snap completely. I can install whenever I need to install something from snap. What do you think of that?

software updater is downloading some updates now but it also decrease the size of /var. So, I cant download any apt bigger than 5 gb becase I have 5 gb /var?

software updater

I went to software center. clicked installed tab and removed all wines. There were 3 wines. I don't know why I installed those or an application maybe installed to be able to work.

Now it seems better:

 canerveg@canerVegan  ~  snap list --all
Name                 Version                     Rev    Tracking         Publisher   Notes
canonical-livepatch  9.7.2                       104    latest/stable    canonical✓  -
canonical-livepatch  9.6.2                       99     latest/stable    canonical✓  disabled
core                 16-2.51.3                   11420  latest/stable    canonical✓  core
core                 16-2.51.1                   11316  latest/stable    canonical✓  core,disabled
core18               20210507                    2066   latest/stable    canonical✓  base,disabled
core18               20210611                    2074   latest/stable    canonical✓  base
gnome-3-28-1804      3.28.0-19-g98f9e67.98f9e67  161    latest/stable    canonical✓  -
gnome-3-28-1804      3.28.0-19-g98f9e67.98f9e67  145    latest/stable    canonical✓  disabled
gnome-3-34-1804      0+git.3556cb3               66     latest/stable/…  canonical✓  disabled
gnome-3-34-1804      0+git.3556cb3               72     latest/stable/…  canonical✓  -
gtk-common-themes    0.1-50-gf7627e4             1514   latest/stable/…  canonical✓  disabled
gtk-common-themes    0.1-52-gb92ac40             1515   latest/stable/…  canonical✓  -
notepad-plus-plus    8.1.1                       285    latest/stable    mmtrt       disabled
notepad-plus-plus    8.1.2                       287    latest/stable    mmtrt       -
snap-store           3.38.0-63-g766b86f          542    latest/stable/…  canonical✓  disabled
snap-store           3.38.0-64-g23c4c77          547    latest/stable/…  canonical✓  -
snapd                2.51.1                      12398  latest/stable    canonical✓  snapd,disabled
snapd                2.51.3                      12704  latest/stable    canonical✓  snapd

 canerveg@canerVegan  ~  cd /var/lib/snapd/snaps
 canerveg@canerVegan  /var/lib/snapd/snaps  ls
canonical-livepatch_104.snap  core18_2066.snap          gnome-3-34-1804_66.snap      notepad-plus-plus_285.snap  snapd_12704.snap
canonical-livepatch_99.snap   core18_2074.snap          gnome-3-34-1804_72.snap      notepad-plus-plus_287.snap  snap-store_542.snap
core_11316.snap               gnome-3-28-1804_145.snap  gtk-common-themes_1514.snap  partial                     snap-store_547.snap
core_11420.snap               gnome-3-28-1804_161.snap  gtk-common-themes_1515.snap  snapd_12398.snap

 canerveg@canerVegan  /var/lib/snapd/snaps  df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7,7G     0  7,7G   0% /dev
tmpfs           1,6G  2,5M  1,6G   1% /run
/dev/nvme0n1p5   61G  7,2G   51G  13% /
tmpfs           7,7G  733M  7,0G  10% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           7,7G     0  7,7G   0% /sys/fs/cgroup
/dev/nvme0n1p2  946M   93M  789M  11% /boot
/dev/nvme0n1p1  975M   11M  964M   2% /boot/efi
/dev/nvme0n1p6  149G   34G  107G  25% /home
/dev/nvme0n1p4  5,6G  3,8G  1,6G  71% /var
/dev/loop1      9,2M  9,2M     0 100% /snap/canonical-livepatch/99
/dev/loop3      100M  100M     0 100% /snap/core/11316
/dev/loop4       56M   56M     0 100% /snap/core18/2066
/dev/loop7       65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/loop5      163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop6      219M  219M     0 100% /snap/gnome-3-34-1804/66
/dev/loop8       66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/loop16      51M   51M     0 100% /snap/snap-store/542
/dev/loop17      33M   33M     0 100% /snap/snapd/12398
/dev/loop18      56M   56M     0 100% /snap/core18/2074
/dev/loop22      51M   51M     0 100% /snap/snap-store/547
/dev/loop21     165M  165M     0 100% /snap/gnome-3-28-1804/161
/dev/loop23     5,5M  5,5M     0 100% /snap/notepad-plus-plus/285
/dev/loop25     219M  219M     0 100% /snap/gnome-3-34-1804/72
tmpfs           1,6G   28K  1,6G   1% /run/user/125
tmpfs           1,6G   60K  1,6G   1% /run/user/1000
/dev/loop12     100M  100M     0 100% /snap/core/11420
/dev/loop2       33M   33M     0 100% /snap/snapd/12704
/dev/loop14     5,5M  5,5M     0 100% /snap/notepad-plus-plus/287
/dev/loop20      11M   11M     0 100% /snap/canonical-livepatch/104
 canerveg@canerVegan  /var/lib/snapd/snaps  

but I need to delete I think other snaps or apps or maybe even sourceslist.

Also:

 canerveg@canerVegan  ~  sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done
 canerveg@canerVegan  ~  sudo apt-get autoremove                          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.

disks

Рейтинг:0
флаг cn

Ошибка, которую вы совершили, была НЕ в установке или использовании Snaps.

Вы совершили классическую ошибку продвинутого нового пользователя: вы перераспределили разделы.

Давайте посмотрим на фрагмент вашего вывода:

    /dev/nvme0n1p5 61G 6,9G 51G 12%/
    /dev/nvme0n1p6 149G 34G 107G 25% /домашний
    /dev/nvme0n1p4 5,6G 5,2G 143M 98% /var

Рекомендация установщика Ubuntu об одном корневом разделе (включая /var и /home) привела бы к чему-то вроде...

    /dev/nvme0n1p4 217 ГБ 46 ГБ 171 ГБ 21% /

... и у вас не будет проблем с полными разделами.

Сделайте резервную копию ваших данных. Переразметьте разделы, чтобы они соответствовали вашему фактическому использованию. Переустановить.

asdasasd avatar
флаг cn
Можно ли сохранить переразбивкой без переустановки?
user535733 avatar
флаг cn
Ты можешь попробовать. Когда-то удачно. Иногда это не так. Будьте готовы к «нет», так что ваш день будет просто раздражающим, а не катастрофическим.

Ответить или комментировать

Большинство людей не понимают, что склонность к познанию нового открывает путь к обучению и улучшает межличностные связи. В исследованиях Элисон, например, хотя люди могли точно вспомнить, сколько вопросов было задано в их разговорах, они не чувствовали интуитивно связи между вопросами и симпатиями. В четырех исследованиях, в которых участники сами участвовали в разговорах или читали стенограммы чужих разговоров, люди, как правило, не осознавали, что задаваемый вопрос повлияет — или повлиял — на уровень дружбы между собеседниками.