Results 1 to 7 of 7

Thread: How to moving a path to a different physical drive

Hybrid View

  1. #1

    Default How to moving a path to a different physical drive

    I set up the OS with both SSD's and HDDs.

    My initial thought was to have the HDDs anywhere I saw a need for high capacity and the SSDs where performance was more important.

    The basic setup is the that there are:
    • 2 SDDs with 3 partitions each partition setup up as a RAID 1
    • 3 HDDs with 2 partitions each partition setup up as a RAID 5


    The RAIDs are OS RAIDs, not hardware.


    So the disks, file paths and partitions are like this:
    • swap - SSD
    • / - SSD
    • /boot/efi - SDD
    • /svr - HDD
    • /home - HDD


    My thinking now is that I want to move /home onto an SSD partition. There will be directories that are too big to do this down in the directory structure under /home but to handle that I'll just move those huge directories to an HDD partition (maybe somewhere like /srv/home/myname/huge-files/) and then soft link to them.

    The problem is I don't know how to do that as I've always set up the partitioning on installation and then left it. Moving major paths between partitions on different disks on a working system I've never done.

    I would image it will be something like the following, in some magical tools you run that are not part of the OS:


    • Backup the whole system so if anything goes wrong I can roll it back
    • Resize the partitions on the SSDs so I have some space for the /home directory
    • Create a RAIDED partition out of the free space on the SSDs
    • Copy the /home dir to some where else there is a lot of space
    • Destroy the home directory partition on the HDDs
    • Resize the partitions on the HDDs to use up the freed space
    • Somehow tell suse that this new partition is the new home dir
    • Copy the critical files for the system in the home dir to the new partition


    Perhaps not in the exact order above but something close. Now start up suse hoping everything worked perfectly and copy whatever working files I can (the ones that make sense) to the new home dir and link to the rest back (the huge dirs) on an HDD partition.

    So... any chance it's easier than what I imagine needs to be done? Perhaps a magical tool that does all that for you and more in one click? (Asking too much?)

  2. #2
    Join Date
    Oct 2008
    Location
    Mojave desert
    Posts
    298

    Default Re: How to moving a path to a different physical drive

    It's not strictly necessary to have /home on a separate partition from / (although it certainly helps when you upgrade; leave /home intact while you install new OS on /).

    So really, it sounds like all you need to do is rename /home as /bigslow, create /home on SSD, copy config files and frequently referenced docs over to it, and hyperlink the rest as you said.

    -GEF

  3. #3

    Default Re: How to moving a path to a different physical drive

    Quote Originally Posted by gfagan View Post
    It's not strictly necessary to have /home on a separate partition from / (although it certainly helps when you upgrade; leave /home intact while you install new OS on /).

    So really, it sounds like all you need to do is rename /home as /bigslow, create /home on SSD, copy config files and frequently referenced docs over to it, and hyperlink the rest as you said.
    -GEF
    Very cool - thanks! ...so much easier than what I was thinking.

  4. #4
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,704

    Default Re: How to moving a path to a different physical drive

    Just so all know RAID 1 is a dangerous configuration if anything goes wrong with either drive all data is lost with no hope of recovery. So you trade reliability for speed when you use RAID 1

    Just a warning for those that may not understand these things.

  5. #5
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,879

    Default Re: How to moving a path to a different physical drive

    Quote Originally Posted by gfagan View Post
    So really, it sounds like all you need to do is rename /home as /bigslow, create /home on SSD, copy config files and frequently referenced docs over to it, and hyperlink the rest as you said.
    This may be problematic.

    First check your fstab, as if /home is in a different partition from / (root), it will probably be linked to the drive by UUID, and just creating a new /home won't work, as the system will try to mount the partition set in fstab.

    For example, in my fstab /home is
    Code:
    UUID=c449ab65-7fbf-4c03-8c5d-9b81e92ddbb8 /home                ext4       noatime,data=writeback,acl 1 2
    and another drive/partition will have a completely different UUID.

    Also IINM your /home directory has some special files that you can't copy (at least easily), like sockets and stuff.

    What I'd do is install the new SDD and partition and set /home using Yast's partitioner, it will probably create the skeleton structure you need in your new /home for your user (if not, create a new user after changing /home), then log in as this new user and copy the usual files/directories from your old /home (which you set as another mount point in the partitioner too, of course). The old /home probably should be mounted under the new /home (f.e. /home/<user>/old), so you can deal with permissions more easily.

    Note that I've done this before without any problems, but it's been some time, so YMMV.

  6. #6
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,879

    Default Re: How to moving a path to a different physical drive

    On further thought, I think that what I did to move my /home was:

    1) create a new partition and mount it as something under the original /home;
    2) copy all files under /home to the new partition. This will copy all the users home folders. Don't forget to include hidden files.
    3) note the new partition UUID in fstab.
    4) reboot to a liveCD or USB stick with a working system, like a rescue disk - I like parted magic, but there are lots of good ones.
    5) mount the installed system / partition, make a backup of and then edit /etc/fstab, changing the UUID of the /home partition. Careful not to edit /etc/fstab of the running system, this only affect the liveCD environment.
    6) you can also rename the old /home entry in fstab to, say, /home/old, keeping the same old UUID, of course, so it will be available after reboot.
    7) reboot to the installed system.

    I think this would work. Also check on the fstab parameters that you may want to ajust due to the move from HDD to SSD - things like noatime, nodiratime, trim, etc.

  7. #7
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,879

    Default Re: How to moving a path to a different physical drive

    Quote Originally Posted by brunomcl View Post
    if not, create a new user after changing /home
    However this user will have a different UID than the original one, so you may want to skip that.

Posting Permissions

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