• Rob's side project: I recently started Gun-Forums.com and we currently have a $100 raffle - if you're into guns, join up and enter the raffle to win $100.00. Gun Forums

Moving files command

jmala

New Member
hi everyone . Can anyone help me with a step by step instructions and linux syntax on moving directories from one partition to another to make space on one partition. Thank you
 


warlockk

Member
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..
 

warlockk

Member
One partition can only be mounted to one directory. But one directory and its sub-dir can mount on several partitions.
 

jmala

New Member
thank you for the response.

On the other hand if i would like to copy folders from one partition to another ,could you help on how to do that..help with syntax also and step by step on how to perform this actions
 

Rob

Administrator
Staff member
Do these folders continue to get something written to them? If so, you'll obviously want to update that application to write to the new location..

Anyways.. you can move them to an existing partion just by using the mv command like:

Code:
mv /path/to/folder /new/path/to/

# Example - moving /var/test folder to /home/test destination:

mv /var/test /home/
 

jmala

New Member
Image 1.jpg


so i would like to move files in a folder in /dev/sdb1 to dev/sdb2 ..
please how do i do that..and yes the folders have continue to have data written to them.
 


Members online


Top