Eliminar SNAP (loop) de aparecer no df -h - Ubuntu
No ubuntu, um comando shell muito útil é o "df -h", que exibe os discos montados.
Porém a partir do 18.04 com a inclusão da ferramenta snap, ocorre algo assim:
df -h
Filesystem Size Used Avail Use% Mounted on
udev 7,8G 0 7,8G 0% /dev
tmpfs 1,6G 3,7M 1,6G 1% /run
/dev/sda2 95G 37G 54G 41% /
tmpfs 7,8G 131M 7,7G 2% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/loop2 3,8M 3,8M 0 100% /snap/gnome-system-monitor/100
/dev/loop3 4,2M 4,2M 0 100% /snap/gnome-calculator/352
/dev/loop4 141M 141M 0 100% /snap/gnome-3-26-1604/88
/dev/loop0 55M 55M 0 100% /snap/core18/1074
/dev/loop5 15M 15M 0 100% /snap/gnome-characters/292
/dev/loop1 43M 43M 0 100% /snap/gtk-common-themes/1313
/dev/loop6 150M 150M 0 100% /snap/gnome-3-28-1804/67
/dev/loop7 1,0M 1,0M 0 100% /snap/gnome-logs/61
/dev/loop8 4,2M 4,2M 0 100% /snap/gnome-calculator/406
/dev/loop10 2,3M 2,3M 0 100% /snap/gnome-calculator/260
/dev/loop11 55M 55M 0 100% /snap/core18/1066
/dev/loop12 36M 36M 0 100% /snap/gtk-common-themes/1198
/dev/loop15 141M 141M 0 100% /snap/gnome-3-26-1604/90
/dev/loop14 89M 89M 0 100% /snap/core/7270
/dev/loop16 15M 15M 0 100% /snap/gnome-logs/45
/dev/loop17 3,8M 3,8M 0 100% /snap/gnome-system-monitor/95
/dev/loop18 15M 15M 0 100% /snap/gnome-characters/296
/dev/loop19 1,0M 1,0M 0 100% /snap/gnome-logs/57
/dev/sda1 511M 7,7M 504M 2% /boot/efi
Porém a partir do 18.04 com a inclusão da ferramenta snap, ocorre algo assim:
df -h
Filesystem Size Used Avail Use% Mounted on
udev 7,8G 0 7,8G 0% /dev
tmpfs 1,6G 3,7M 1,6G 1% /run
/dev/sda2 95G 37G 54G 41% /
tmpfs 7,8G 131M 7,7G 2% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/loop2 3,8M 3,8M 0 100% /snap/gnome-system-monitor/100
/dev/loop3 4,2M 4,2M 0 100% /snap/gnome-calculator/352
/dev/loop4 141M 141M 0 100% /snap/gnome-3-26-1604/88
/dev/loop0 55M 55M 0 100% /snap/core18/1074
/dev/loop5 15M 15M 0 100% /snap/gnome-characters/292
/dev/loop1 43M 43M 0 100% /snap/gtk-common-themes/1313
/dev/loop6 150M 150M 0 100% /snap/gnome-3-28-1804/67
/dev/loop7 1,0M 1,0M 0 100% /snap/gnome-logs/61
/dev/loop8 4,2M 4,2M 0 100% /snap/gnome-calculator/406
/dev/loop10 2,3M 2,3M 0 100% /snap/gnome-calculator/260
/dev/loop11 55M 55M 0 100% /snap/core18/1066
/dev/loop12 36M 36M 0 100% /snap/gtk-common-themes/1198
/dev/loop15 141M 141M 0 100% /snap/gnome-3-26-1604/90
/dev/loop14 89M 89M 0 100% /snap/core/7270
/dev/loop16 15M 15M 0 100% /snap/gnome-logs/45
/dev/loop17 3,8M 3,8M 0 100% /snap/gnome-system-monitor/95
/dev/loop18 15M 15M 0 100% /snap/gnome-characters/296
/dev/loop19 1,0M 1,0M 0 100% /snap/gnome-logs/57
/dev/sda1 511M 7,7M 504M 2% /boot/efi
Para evitar que poluam desta forma, é necessário criar um alias:
echo "alias df='df -h -x squashfs -x tmpfs -x devtmpfs'" >> ~/.bash_aliases
E depois:
source ~/.bashrc
Com o resultado:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 95G 37G 54G 41% /
/dev/sda1 511M 7,7M 504M 2% /boot/efi
Caso resolvido.
Comentários