Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Can I move /home to another hard disk?

  1. #1
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Can I move /home to another hard disk?

    I have 2 hard disk in my computer, one much larger than the other. I have been trying to get to a stable system, requiring me to rebuild the system quite a few times in the last 2 weeks. As a result of the install working in a counter-intuitive way, the system has been built with my /home folder on the same device as / - very much what I didn't want and didn't specify. I only just notcied that /home is on the wrong drive after I filled it up.

    Is there some way I can move /home to the intended hard disk - or have I got to rebuild my system again?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  2. #2

    Default Re: Can I move /home to another hard disk?

    You don't even have to reboot the system. Create a partition where you'd like to have /home (don't mount it yet). Adjust /etc/fstab and create a line with /home in it but don't do anything yet (it should be fine if you just copy root mount line and change it accordingly to the disk and /home mount point). open terminal and go to runlevel 1. From there mount the newly create partition as something like /mnt/home, copy everything from your home to this one with cp /home/* -R /mnt/home/. After that umount the /mnt/home. Then type mount -a and after that confirm with df that it is mounted. After that you can safely go to init 3 and type /etc/init.d/xdm start

    P.S. Of course you can copy everything while still being at the GUI but i prefer to be on the safe side and do it that way.

    P.S.2 I'm not sure but if someone could shed some light on it, if you copy something as root even if this is /home then that copied content will have root permissions right?
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: Can I move /home to another hard disk?

    You mustcopy as root and use options that leave all ownership and access dates as they are.

    That is -p
    Why do I have to read the man page, and why not you?
    Henk van Velden

  4. #4

    Default Re: Can I move /home to another hard disk?

    Right. You can cp with -p option to preserve attributes.

    [edit]
    Oh, hcvv beat me
    [/edit]
    It is abhorrent the spiritual greed of those that knowing something, do not seek the transfer of such knowledge.

    Miguel de Unamuno - Writer (1864-1936)

  5. #5

    Default Re: Can I move /home to another hard disk?

    Quote Originally Posted by hcvv View Post
    You mustcopy as root and use options that leave all ownership and access dates as they are.

    That is -p
    Why do I have to read the man page, and why not you?
    Because i'm a noob that can't read
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: Can I move /home to another hard disk?

    Quote Originally Posted by BenderBendingRodriguez View Post
    Because i'm a noob that can't read
    Dum-ti-dum-ti-dum.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: Can I move /home to another hard disk?

    OK, thanks guys. This doesn't look quite so straightforward as it is written. I'll post back here when (if ?) it's done. If not it means I'm outside somewhere beating my head against a suitably hard wall.

    btw the reason I'm in this mess is because when I started this current install the partitioning step in installation showed that there was already a /home partition on the right disk. So I decided to just leave it there - it was exactly what I wanted. But the install seems to have deleted it.
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  8. #8
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Can I move /home to another hard disk?

    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  9. #9
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: Can I move /home to another hard disk?

    Thanks for the tip - but I dson't thjink it's going to help me now:

    Now I'm really in deep Second Hand Information Technology:

    Can somebody rescue this for me or do I have to start all over again ( sob ) ?


    I used Yast and found that the partition I needed was already there (as I expected). Not being able to parse the English of the instruction "(don't mount it yet)" that's exactly what I did - mounted it to /home in Yast.

    Neeedless to say the mount /mnt/home command failed and now that I'm back at runlevel5 my files in /home/user are no longer visible - and there's hours of work in the last 2 days putting them there. Are they gone now?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  10. #10
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Can I move /home to another hard disk?

    Reboot and log on as root. Use Yast to unmount the partition that you put as the new home. If the old folder that you had as the old home still exists with name unchanged, just reboot and log on as your normal user. But if the old folder that you had as the old home now exists with a different name, e.g. newname, then rename it back to home with this command:
    Code:
    mv /newname /home
    Then reboot and log on as your normal user.

    Then try the sequence in the tutorial.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •