Basically what I want to achieve is the following. I have two disks and have enabled software raid on these. The df shows the following:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc2             457G  205G  230G  71% /
devtmpfs              5.9G  300K  5.9G   1% /dev
tmpfs                 5.9G  4.0K  5.9G   1% /dev/shm
/dev/md0              230G   21G  198G  10% /vcs

As you see there are 198GB of space on /vcs, but what I want is to mount /dev/md0 to /data instead. The data currently stored under /vcs will be moved to /data/vcs/

Should I repartition the disk with fdisk and copy back the data on /vcs once finished or is it sufficient to change the fstab to mount to /data? I will still need the data on /vcs

Thanks in advance.


Two steps.
First create a directory /vcs/vcs and copy everything from /vcs into it.

cd /vcs
mkdir vcs
mv * vcs

Secondly, remount /vcs as /data.

mkdir /data
umount /vcs
mount /dev/md0 /data

Third (optional) step. Symlink /data/vcs to /vcs to keep the path if needed.

ln -s /data/vcs /vcs

Make sure you update your /etc/fstab to reflect the mountpoint change.
Before moving the data and unmounting the filesystem, make sure no applications are running or using the files to avoid data corruption or locked files.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.