I currently run a webserver running Debian. I have a 1GB disk with a single ext4 partition mapped to /
and an 8GB disk with a single ext4 partition mapped to /var/www
.
The 1GB disk is at 70% full without a DB installed. Once I put on psql, my /var
is probably going to fill up the 1GB disk.
So what I want to do is to resize the ext4 on the 8GB disk to 4GB and create another partition using the free space.
Now, in my mind, I've came up with the following set of steps:
umount
and useresize2fs
(orparted
) to resize the partition on the 8GB disk.parted
to create a new 4 GB partition on the free space.mount
the new parition to say/media/new
cp -a
to copy my/var
from the 1GB partition to the new 4GB partition. (or should I usetar
for this?)- add an entry for the new partition in
fstab
- delete the redundant stuff like
/var
from my 1GB disk and/var/www
for the new partition.
I've never done something like this before, so could someone please verify my steps and see if I'm missing anything?
PS. I did a du --max-depth=1
, and it looks like aside from the 200MB taken up by /var
, there is also a 300MB allocated to /usr
and 200MB to /lib
. Should I move these too?