I have installed an Ubuntu server on a VMWare workstation with a space of 20GB storage as seen below;
After the installation I've attached another 40GB worth storage to the existing Ubuntu server installation (seen below);
Now I want to add this 40GB to my /
(root) directory or to /var/
directory but my df -h
result shows;
root@Userver:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 18G 900M 16G 6% /
udev 990M 4.0K 990M 1% /dev
tmpfs 400M 308K 399M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 999M 0 999M 0% /run/shm
none 100M 0 100M 0% /run/user
root@Userver:~#
What should I do now? Further, I have only ssh access to the server.
Best Answer
First, create a new partition on the second hard disk drive
sdb
and fomrat it, this can be done in one step:Then mount the created partition on the
/var/www/
folderNote that the
www
folder should be empty, if not move its contents to another folder, mount the new drive and move the files back again towww
.To make mounting permanent so you won't need to mount the drive every time you restart the machine, add the following line to
/etc/fstab