Is that possible to free some disk of /tmp and move to /usr?

hey i have been using Fedora for several years, but so far i don’t know how to troubleshooting for increase more disk in Linux/Fedora , i always re install if there is new Fedora coming, i always do this for years, really that is true ! because there is few tutorial about how to increase more free this into file system, and sometimes i dont understand follow by their guide but always failed, so than i spend much times for few days to debug it better i re install.

when i install Fedora 31 now in my Laptop, and i have increate more space on /usr, but unfortunately the space i put is not enough and i think i have to make more free disk on /usr , here is the ss of my disk with df -h -T

Filesystem                              Type      Size  Used Avail Use% Mounted on
devtmpfs                                devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs                                   tmpfs     3.9G  133M  3.8G   4% /dev/shm
tmpfs                                   tmpfs     3.9G  1.9M  3.9G   1% /run
/dev/mapper/fedora_localhost--live-root ext4       24G  2.0G   21G   9% /
/dev/mapper/fedora_localhost--live-usr  ext4       11G  6.7G  3.7G  65% /usr
/dev/mapper/fedora_localhost--live-var  ext4       11G  961M  9.1G  10% /var
/dev/mapper/fedora_localhost--live-tmp  ext4      5.9G   27M  5.5G   1% /tmp
/dev/mapper/fedora_localhost--live-home ext4       23G  4.1G   18G  20% /home
/dev/sda5                               ext4      1.1G  283M  722M  29% /boot
tmpfs                                   tmpfs     791M  256K  790M   1% /run/user/1000

i was having problem on /tmp because not make big space disk on there before so i increase it and now it only use for 1%, i want take 2.5GB on /tmp and move it to /usr, is that possible ? is that any command line to make this magic easier ? or there is a tool for make this happen ?

when i partition, i use LVM i think

Hi @pocketaln, and welcome!

Firstoff, if you’re updating by reinstalling anyways, you might want to simply wait for Fedora 33 to come out in a few weeks (or try the beta release right now), backup your /home elsewhere, wipe the disk and reinstall Fedora with it’s default partitioning. That will let Fedora use btrfs as the root filesystem, which means you will no longer have to care about the sizes of different partitions (look up btrfs subvolumes for details on how this works). I think that will be of great benefit, especially given your relatively small hard disk.

Now, to your question:

/tmp is normally a tmpfs, i.e. mounted into RAM - you can simply revert to that. Can you post the content of /etc/fstab?

Anyway, your partition layout is rather funky

  • you have a large / partition, but its main space consumers (/usr and /var) are on separate partitions, leaving / fairly empty
  • you have a large /var partition but don’t use it
    so you could use your harddisk space way more efficiently by doing some fundamental repartitioning, which is why I’d advise to go the Fedora-33-with-btrfs route.
3 Likes

i follow the answer on this my question about free disk, when i run

sudo resize2fs /dev/mapper/fedora_localhost--live-tmp

i got

resize2fs 1.45.5 (07-Jan-2020)
resize2fs: Device or resource busy while trying to open /dev/mapper/fedora_localhost--live-tmp
Couldn't find valid filesystem superblock.

Did you unmount (sudo umount /tmp) before resizing?
Also, it will be much simpler to get rid of the tmp partition entirely, you don’t need it.

Can you post the content of /etc/fstab?

Post the output:

cat /etc/default/grub; grep -v -e ^# -e ^$ /etc/fstab

That shows you definitely used LVM.
Give us the output of “sudo pvs” “sudo lvs” and “sudo vgs”