3

I currently have a file server, and all the files are installed in /usr/local/nginx/html/.

The setup is one hard disk with 1 TB of data. This 1 TB of storage is all used up.

I asked the guys to add two HDDs with 2 TB each. These new HDDs will be used for new storage of files. Now, if I mount these two new HDDs into /usr/local/nginx/html/, the current files in there will be deleted.

My goal is to expand the storage in /usr/local/nginx/html/ without losing data in it. Would this be possible?

Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
AnsellC
  • 159
  • 5

2 Answers2

13

The easiest way of moving the files over to the new mountpoint is:

# cd /usr/local/nginx/html
# vi /etc/fstab # (add the new disk to the fstab now so you don't forget!)
# mount /usr/local/nginx/html
# mv * /usr/local/nginx/html

And by the way, use RAID :)

MikeyB
  • 39,291
  • 10
  • 105
  • 189
5

The files wouldn't be deleted by mounting another device at /usr/local/nginx/html - they would just be masked beneath the mounted file system.

In such a situation, I would install the new disks, create appropriate file systems (can't help there - I don't use Linux), temporarily mount the new disk at, say, /mnt and move the data from /usr/local/nginx/html to /mnt. You can then unmount the new device, and mount it at /usr/local/nginx/html and all your current files will be available on the new disk, along with all that extra capacity.

D_Bye
  • 401
  • 2
  • 5