Moving files command

jmala

New Member
Joined
Mar 24, 2020
Messages
5
Reaction score
0
Credits
0
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
 


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..
 
One partition can only be mounted to one directory. But one directory and its sub-dir can mount on several partitions.
 
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
 
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/
 
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.
 

Staff online

Members online


Latest posts

Top