2

I have one issue.

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.8G  5.8G  3.5G  63% /
udev             11M     0   11M   0% /dev
tmpfs           1.3G  9.5M  1.3G   1% /run
tmpfs           3.2G   74M  3.1G   3% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
tmpfs           3.2G     0  3.2G   0% /sys/fs/cgroup
/dev/sda6        66G  2.8G   60G   5% /home
tmpfs           628M  4.1k  628M   1% /run/user/117
tmpfs           628M   37k  628M   1% /run/user/1000
/dev/sr0        3.6G  3.6G     0 100% /media/cdrom0

Above is my list of free space and usage on my HDD.

I need more space for web development in /var/www and I want to somehow change size of /home partition /dev/sda1 and made new partition only for /var/www

Is that possible?

1 Answers1

2

As @jordanm pointed out in a comment, it's much safer to symlink into a new location in an existing partition than to try to resize partitions while keeping their current content.

In your situation, this would be achieved by something like:

cd /var
sudo mv -i www /home/
sudo ln -s /home/www .

(as a side note: it's usually a good habit to include the -i flag to mv in order to get a warning message if you're about to overwrite something, especially if you're issuing the mv with sudo)

Dalker
  • 1,582
  • 1
  • 11
  • 16