2

I got a Linux machine of 1TB. The storage structure is like this:

/dev/xvda1            9.8G  1.9G  7.8G  20% /. 

tmpfs                  30G     0   30G   0% /dev/shm. 

/dev/nvme0n1          1.8T   20G  1.6T   2% /local. 

Now I have my processes run on /tmp folder and my application is failing because there is not enough memory present on device.

How do I get the storage in /local directory to / directory.

Raffa
  • 32,237
Rahul
  • 21

1 Answers1

0

You could create a directory under / like so:

sudo mkdir /new_local

Then bind the /local directory to it like so:

sudo mount --bind /local /new_local

This way all the space and contents of /local will be accessible under /new_local


If however your goal is to extend the storage space on /tmp using the available space on /local then please follow the two steps below:

First, create a directory under /local like so:

sudo mkdir /local/new_tmp

Then, bind it to /tmp like so:

sudo mount --bind /local/new_tmp /tmp

This way all the available free space under /local will be given to /tmp

Raffa
  • 32,237
  • but how will /tmp get the storage then? – Rahul Mar 26 '20 at 21:13
  • 1
    @Rahul I answered your question " How do I get the storage in /local directory to / directory. ". If you want the extend /tmp space, I will update the answer for that. One moment please. – Raffa Mar 26 '20 at 21:20