I have a CentOS 7.4 and I followed this guide to mount the new disk on my system.
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/add-disk
At first I made a symbolic link but can't achieve what I want because /home already exists, how can I mount safely /home in the new disk without losing the current data?
My objective is to easily migrate this disk in the future to another VM, should I need to know anything else before mounting this disk in another VM?
Best Answer
I assume you already have the partition setup and working. What you need to do first is to copy the home dir from root partition to the new partition. Let's say its mounted on /mnt/disk1
1) Copy /Home (Replace variables accordingly)
2) Find uuid of new partition
3) Update fstab /home path
4) Move old home
5) Reboot
After that, you should have your home working as intended but located in a different partition.