On 24/01/2019 18.24, stakanov wrote:
Hi. I have long time ago on my TW system moved /var to a separate disc. This mainly because I have my virtualised disks on it, with kvm/quemu and I needed a lot of space. I also wanted to avoid them, exactly in the current scenario were I did brake the system and reinstalled.
Now the situation: I am referring to what I did to https://linuxconfig.org/how-to-move-var-directory-to-another-partition I have /dev/sda1 (for boot/efi) /dev/sda2 (2 GB swap) /dev/sda3 (root) on a ssd (sda) then /dev/sdb1 (for old var - this disc shows in smart prefailure and old age, read errors and had to be changed urgently). It was worth 500 GB data and was mounted as /var (currently it is NOT mounted as var, as the installation was not possible to a problem with the partition) I have a former /home that was already migrated on /dev/sdc1 (with 2 TB of space now) and that will be attributed to /var I have a new /dev/sd1 drive with 4 TB of data for /home (the old went straight anyway...). The system on sda and with sdd1 as /home works perfectly. Now I want to save my kvm data. I did mkdir /mnt/oldvar mkdir /mnt/newvar then mount /dev/sdb1 /mnt/oldvar mount /dev/sdc1 /mnt/newvar I then issued # rsync -aqx --progress /mnt/oldvar/* /mnt/newvar and copied all the old unused var to the new location. So at least the kvm data is now save.
Now, I would like of course to mount the /mnt/newvar as regular /var and I wanted to ask: can I do this, or is it necessary to rsync the /var of now to the /mnt/newvar
yes
and if so, how can I be sure that data that is not there (my old kvm) is not erased and that my content of /var of the current system is actually taken. Or can I simply to what is in the howto and mount the old var (as logs I would only loose the successful installation... but temp system files etc?
As I have not experience to migrate /var in these conditions, I would be grateful for some insight.
Why not mount /dev/sdc1 /var/virtualmachines or whatever is the exact directory? If not, use 'mc' to graft /mnt/newvar to /var/virtualmachines, then # rsync -aqx --progress /var/* /mnt/newvar preferable on a rescue system. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)