I need to move my /var (dev/sdc1) back to the / (dev/sda2) from a different file system. I've resized the / partition and want to move /var back to / partition and resize /dev/sdc1 filesystem to mount another directory /data002
Currently, df -h and lsblk details Can someone guide me on this please.
I will suggest two options :
1- No downtime is tolerated (Use it at your own risk) :
2- Downtime is tolerated, make sure you have access to the server console directly because network will be down in single user mode and note that /var will not be mounted also :
SYSTEM V based Debian:
Reboot the server
Choose you kernel and then press e to edit the grub entry.
Append init=/bin/bash to the end of the grub line which begins with linux.
Now press ctrl-x or F10 to boot into single user mode.
Enter the following commands :
SYSTEMD based Debian :
P.S : Try to use LVMs in future they are flexible and can deal more efficiently with this kind of situation using just vgsplit & pvmove OR using lvm mirroring & lvm mirror discarding