moving space from one partition to another

How can I move some space allocated to one partition to another,
i.e. from "/var" to "/" .

Thanks!

Do you mean your /var is growing bigger and you want to mount it on another larger partition? If yes, you just need to change /etc/fstab.

For example, you currently have,

mount /dev/sda1 /var

and /dev/sda1 doesn't have enough space. So you just change like this, (if /dev/sdb1 is a larger partition)

mount /dev/sda1 /var
mount /dev/sdb1 /mnt
cp /var /mnt -r

then change /etc/fstab to,

/dev/sdb1 /var

then reboot. Hope this helps.

Or you want to cut out some space from a mounted partition and give it to another partition? Is this possible?

Eddie,

"Or you want to cut out some space from a mounted partition and give it to another partition? Is this possible? "

This is exactly what i want!!!

Any ideas?

Thanks.

I don't think it is possible. One partition can only be mounted to one directory. But one directory and its sub-dir can mount on several partitions. For example,

we can do this,

mount /dev/sda1 /
mount /dev/sdb1 /usr
mount /dev/sdb2 /usr/database
mount /dev/sdb3 /usr/programs
mount /dev/sdb4 /usr/other_programs
mount /dev/sdc8 /usr/programs/eddie
etc....

but we can not do following,

mount /dev/sda1 /
mount /dev/sda2 /

nor,

mount /dev/sdb2 /usr/database
mount /dev/sdb2 /usr/programs

You perhaps have allocated too much space to a partition, right? So you may have to re-partition the disk.:rolleyes:

Well I think its not easy as it seems I think you should umount filesystems you want to resize then use the "mkfs" command with several options for both filesystems and give the appropiate size each one, then use "newfs" to create as filesystem and finally modify the /etc/fstab to the new mount points and remount the filesystems.