2

I frequently get low disk space warning while I have 1.4TB on /media directory. I assume I need to add this space to /home. How can I do it without loosing my already installed packages? Here is my current disk space status after running:

$ df -h -x{tmp,devtmp,squash}fs:

Filesystem      Size  Used Avail Use% Mounted on
udev             16G     0   16G   0% /dev
tmpfs           3.2G  9.4M  3.2G   1% /run
/dev/sda6       178G  168G 1022M 100% /
tmpfs            16G  265M   16G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/loop0       89M   89M     0 100% /snap/core/7270
/dev/loop1       92M   92M     0 100% /snap/vectr/2
/dev/loop2      298M  298M     0 100% /snap/pycharm-community/132
/dev/loop3       89M   89M     0 100% /snap/core/7169
/dev/loop4      298M  298M     0 100% /snap/pycharm-community/128
tmpfs           3.2G   68K  3.2G   1% /run/user/1000
/dev/sdb2       466G  1.3G  465G   1% /media/mfani/Win_Data_Drv
/dev/sdb1       1.4T  179G  1.1T  14% /media/mfani/72f334b0-29a3-4f81-a52f-ed30de1ca5a01
terdon
  • 100,812
Mehr
  • 23

1 Answers1

4

The problem is that your /, the root of the filesystem, is at 100%. The extra space you have on other partitions, such as /media, isn't relevant here. The system is installed on / and that's the one that needs more space.

Since you do have loads of space on /media, the easiest solution is to find things in your $HOME that are taking a lot of space and move those to /media. For example, if you have video, music or image files, perhaps in the directories $HOME/Videos, $HOME/Music and $HOME/Pictures, move them to /media/mfani/72f334b0-29a3-4f81-a52f-ed30de1ca5a01 and then create symlinks in your $HOME pointing to their new locations:

cd $HOME
for dir in Videos Music Pictures; do
    mv "$dir" /media/mfani/72f334b0-29a3-4f81-a52f-ed30de1ca5a01/
    ln -s /media/mfani/72f334b0-29a3-4f81-a52f-ed30de1ca5a01/"$dir" . 
done

You will now have symlinks in your $HOME which will take up no space but which you can use to access your files as though they hadn't been moved.

terdon
  • 100,812
  • Rather than keep long UUID which is hard to remember or use, often easier to create label for partitions like data or if you want separate partition for some data you can use folder name like videos. https://askubuntu.com/questions/276911/how-to-rename-partitions I try to remember to add labels when creating partitions with gparted, but use Disks when I forget. With gpt there are two labels, one file system and one partition. I keep both the same. – oldfred Jul 22 '19 at 18:23
  • @oldfred I think you meant to leave that comment under the question. The OP won't be notified of comments you leave under other people's posts. – terdon Jul 22 '19 at 18:30