0

My 20.04 PC has a 128GB SSD on which / is mounted.

I have an additional 1TB SSD for homes mounted at /home. All done in fstab which I'm fairly confident with.

/ (on /dev/sda2) is showing around 97% full in GParted and I know if this fills I'll have problems. (I'm assuming this is filling due to installing apps etc?).

What's a good way to prevent this happening? What would be a good directory on / to mount elsewhere? /var looks the largest at 29GB so should I move this to another disk (create a new partition on the 1TB?) and create a new mount point in fstab? If so, what's the best way to copy? just with cp or use rsync?

Or is there better way? I also have a 480GB SSD with two partitions I use for backups and VMs mounted at /mnt/bu & /mnt/vms which I guess I could re-purpose to hold all on /.

Thanks

   ~$ sudo du -smc /var/*
[sudo] password for roger: 
7   /var/backups
196 /var/cache
1   /var/crash
29589   /var/lib
1   /var/local
0   /var/lock
1   /var/log
1   /var/mail
1   /var/metrics
13  /var/opt
0   /var/run
31  /var/snap
70  /var/spool
1   /var/tmp
518 /var/www
30421   total

sudo du -smc /* --exclude=/proc --exclude=/run 15 /bin 190 /boot 1 /cdrom 0 /dev 18 /etc 182861 /home 0 /initrd.img 0 /initrd.img.old 1489 /lib 1 /lib64 1 /lost+found 1 /media 1583995 /mnt 4294 /opt 1700 /root 14 /sbin 48696 /snap 1 /srv 2049 /swapfile 0 /sys 2 /tmp 9000 /usr 30421 /var 0 /vmlinuz 0 /vmlinuz.old 1864738 total

Roger06
  • 133
  • Please, [edit] your question and add the output of sudo du -smc /* --exclude=/proc --exclude=/run command and similarly the output of sudo du -smc /var/* command. – FedKad Jul 09 '22 at 11:03
  • You can move /home. To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions https://help.ubuntu.com/community/Partitioning/Home/Moving & https://ubuntuforums.org/showthread.php?t=2455822&p=14010437#post14010437 Or you can create data partition(s) and link those back into /home. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting I use the linking as best not to share /home (user settings) and have multiple installs and want same data in all of them. Often want to experiment with settings & do not want to modify main working install. – oldfred Jul 09 '22 at 13:14

1 Answers1

1

A 128 GB directory for the system only, i.e., no user directories and user data, is incredibly plenty for a linux system. A fat linux system with plenty of applications will rarely need more than 30GB. It will therefore be up to you to see what else is still taking space in that 128 GB / partition.

In other words, moving out system directories to other partitions will not be your solution. Your solution will be to find out what else apart from the system files is taking that much space, and move that out, whatever it is.

Tools like du, ncdu, or graphical tools like Baobab allow to explore what is consuming space on a partition.

vanadium
  • 88,010
  • Thanks @vanadium , that helps. /var/lib/snapd/snaps seems the most greedy at 18.8GB. – Roger06 Jul 09 '22 at 12:01
  • Still that is not your problem. There must be something not belonging to the system, or something that is not normal, causing you to use > 100 GB for only the system. – vanadium Jul 09 '22 at 12:17
  • OK - I've edited my original post with du outputs. – Roger06 Jul 09 '22 at 12:36
  • I am storing websites in /var/www/ but only 518MB.

    sudo du -smch /var/www/* 518M /var/www/html 8.0K /var/www/testvh 518M total roger@roger-ubunt

    – Roger06 Jul 09 '22 at 14:05
  • That does not say a lot. Data could be present on the SSD drive under /home, but not be visible while an external partition is mounted on that directory. – vanadium Jul 09 '22 at 15:31