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.

New contributor
Rahul is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Are you needing to create a new swap file in a different location? – Robby1212 Mar 26 at 20:42
  • /dev/xvda1 9.8G 1.9G 7.8G 20% / is getting used when i try to use the /tmp directory, not allowing the application to use the total storage of the device. – Rahul Mar 26 at 21:18
  • Is this Ubuntu? What version? – heynnema Mar 26 at 21:28
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

Best of luck

  • but how will /tmp get the storage then? – Rahul Mar 26 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 at 21:20

Your Answer

Rahul is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.