Howto move /home directory to different drive

General support questions
Post Reply
User avatar
bluegroper
Posts: 266
Joined: 2005/09/07 23:04:21
Location: .au

Howto move /home directory to different drive

Post by bluegroper » 2017/06/18 22:44:06

Hi forum

In the past, I've usually configured my servers without any LVM. A personal preference or prejudice.
When using C6, it was easy to move a directory to a different drive.
Go single user (ie init 1), edit fstab to map the mount point to the physical partition, and then init 5.

Is there a similar process to do this in C7 ?
I'm not a complete idiot. There's still a few pieces missing.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Howto move /home directory to different drive

Post by TrevorH » 2017/06/18 23:11:34

Using LVM? Create a new LV using lvcreate on the drive you want it, make a filesystem on it, do what you used to do but use the new LV instead of the partition. You could also look at man pvmove and see if you can get LVM to do it all for you.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
bluegroper
Posts: 266
Joined: 2005/09/07 23:04:21
Location: .au

Re: Howto move /home directory to different drive

Post by bluegroper » 2017/06/18 23:14:36

TrevorH wrote:Using LVM?
Not using any LVM
I'm not a complete idiot. There's still a few pieces missing.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Howto move /home directory to different drive

Post by TrevorH » 2017/06/18 23:18:04

If not using LVM then why do you think the process is any different in CentOS 7 than it was in 6?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
bluegroper
Posts: 266
Joined: 2005/09/07 23:04:21
Location: .au

Re: Howto move /home directory to different drive

Post by bluegroper » 2017/06/20 11:23:34

In C7, is there a way to change between runlevels 1 and 5 without rebooting ?
I'm not a complete idiot. There's still a few pieces missing.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Howto move /home directory to different drive

Post by TrevorH » 2017/06/20 12:19:57

systemctl isolate <tab><tab> shows me

Code: Select all

ctrl-alt-del.target         initrd-switch-root.target   rescue.target               runlevel5.target
default.target              initrd.target               runlevel0.target            runlevel6.target
emergency.target            kexec.target                runlevel1.target            system-update.target
graphical.target            multi-user.target           runlevel2.target            
halt.target                 poweroff.target             runlevel3.target            
initrd-switch-root.service  reboot.target               runlevel4.target     
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
bluegroper
Posts: 266
Joined: 2005/09/07 23:04:21
Location: .au

Re: Howto move /home directory to different drive

Post by bluegroper » 2017/08/05 05:48:05

I understand howto change the default runlevel, BUT can C7 change runlevels on-the-fly ?
Like we used to in C6, using init 1 or init 3 or init whatever.
It seems the process to move the /home directory between physical drives in C7 using runlevel 1 is indeed very similar to C6, just that a reboot is required to change between runlevels.
I have no doubt there's good reason/s for this small extra step in C7. And we don't do it often !
I'm not a complete idiot. There's still a few pieces missing.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Howto move /home directory to different drive

Post by hunter86_bg » 2017/08/05 06:15:17

As Trevor already mentioned - use

Code: Select all

systemctl isolate rescue.target

Post Reply