vbox clean disk

dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile

dd if=/dev/zero of=/var/dummy bs=8126k

VBoxManage.exe modifymedium --compact c:\path\to\thedisk.vdi

VBoxManage modifymedium disk ./NWABAP75101.vdi –compact

sudo du -sh /var/cache/apt
  • Show top 10 biggest subdirs in the current dir.
 du -sk * | sort -nr | head -10
  • Use File Usage Analyzer (AKA baobab; GNOME based), Filelight or kDirStat (KDE based), to see where the disk space is going visually (ncdu uses a TUI).

  • Check if you have old kernels for deletion

 ls -lh /boot
  • Cleaning packages
 sudo apt autoremove
 sudo apt autoclean

see list of all installed packages, sorted by size. If you see something big and don't use it - uninstall it

 dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
  • Clean unused language files with translations (there are tons of them)
 sudo apt install localepurge
  • Check content of /var/tmp/
 du -sh /var/tmp/
  • Check also
 man deborphan
  • Search for big files:
 find / -type f -size +1024k

or

 find / -size +50000  -exec ls -lahg {} \;
  • Big installed packages (part of the package: debian-goodies)
 dpigs

or

wajig sizes | tail -30.
  • On systemd: Remove the oldest archived journal files until the disk space they use falls below the specified size
 sudo journalctl --vacuum-size 10M
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

df -h
sudo parted -ls
sudo lsblk -f
sudo lsblk -m


dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k status=progress
rm /var/tmp/bigemptyfile

vboxmanage modifymedium x:\path\to\disk.vdi --compact

https://askubuntu.com/questions/5980/how-do-i-free-up-disk-space

posted @ 2023-05-11 17:43  fndefbwefsowpvqfx  阅读(17)  评论(0编辑  收藏  举报