move /home to new partition

Forum Forums Official Releases antiX-21/22 “Grup Yorum” move /home to new partition

  • This topic has 5 replies, 4 voices, and was last updated Mar 31-12:12 pm by Dave.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #138189
    Member
    nestorgbl

      Hi! Forum:
      I have antiX 22 running and installed in small 7200 rpm disk. All going fine til now!
      But a friend gave a 1T SSD he removed from his PS4, but it is bigger but slower (5400? RPM).
      I would like to keep / in the small disk and move the /home partition to the new disk already partitioned and ext4 formated.
      How can I safelly do that?

      Comes to my idea to start the machine with a Live usb, copy the actual /home to the new one including hiden files and then modify fstab as it shoul be (UUID ?).
      After cheking I can delete the old /home and expand the / partition…

      Maybe I am wrong! That is why I am asking before touching a single bit…
      Thanks!

      • This topic was modified 3 weeks, 3 days ago by nestorgbl.
      • This topic was modified 3 weeks, 3 days ago by nestorgbl.
      #138193
      Member
      Robin

        How can I safelly do that?

        A super simple method would be:

        1.) Copy all content of original /home to the new location on the new drive (e.g. to /media/sda3/data/home ), keep all permissions and ownership.
        2.) Rename original /home to /home_original
        3.) Create a symlink /home pointing to the new location of the new home folder (e.g. to /media/sda3/data/home or whatever).

        All these steps must be done from a live environment, while this home folder is not in use, just as you have intended.

        That should do the trick already. Make sure /media/sda3 is mounted at boot time.

        (That’s the way I do this in antiX Live environments usually, but I have never tried that on an installed antiX. Nevertheless, I’m pretty sure this easy path should work for you. And since the original home folder is not touched before you are sure it works, you can undo it easily by removing the symlink and rename the /home/original folder back to /home in case that something fails to work.)

        Once you are sure the new /home folder works fine, you may either delete the original or keep it as backup.

        Windows is like a submarine. Open a window and serious problems will start.

        #138196
        Member
        nestorgbl

          And not using simlinks?
          Those are partitions on 2 different disks…

          • This reply was modified 3 weeks, 3 days ago by nestorgbl.
          #138198
          Member
          Robin

            And not using simlinks?

            Step 3 above explicitly reads: Create a symlink.

            Those are partitions on 2 different disks…

            So what? The symlink placed in the position of the original /home folder points to the home folder somewhere on the second drive. Where is the problem? Just make sure the drives are always mounted at boot time, otherwise the symlink will point to nowhere…

            Windows is like a submarine. Open a window and serious problems will start.

            #138210
            Forum Admin
            rokytnji

              I’ve run my chromebook when I had 22 on it that way.

              Was symlinking to 54 gig sd card flashdrive. When the data routed there. No drive space taken up on internal / 16 gig ssd drive.

              It starts filling the symlinked destination spot. My 54 GIG SD card. No need to mess with /etc/fstab or anything else. Auto mount took care of that.

              I even remember rox filer was my friend when I did this. Only delay I had was conky weather not loading all info. Easy enough to turn conky on
              and off to reload it.

              • This reply was modified 3 weeks, 3 days ago by rokytnji.

              Sometimes I drive a crooked road to get my mind straight.
              I don't suffer from insanity. I enjoy every minute off it.
              Motorcycle racing is rocket science.

              Linux Registered User # 475019
              How to Search for AntiX solutions to your problems

              #138235
              Forum Admin
              Dave

                I boot the system as normal, but at the login screen press CTRL + ALT + F1.
                Log into the text environment as root.
                Mount the new drive in /mnt where sdb1 in the first partition of the second disk. (your drive may be different) (mkdir -p /mnt/newdrive && mount /dev/sdb1 /mnt/newdrive)
                If this is a fresh disk (as yours is) I copy all the files over (cp -aR /home/* /mnt/newdrive/). If it is a reused disk / out of date I use rsync.
                Rename /home to /home.bk (mv /home /home.bk)
                Make a new /home (mkdir -p /home)
                Unmount the new drive and remount to /home (umount /dev/sdb1 && mount /dev/sdb1 /home)

                At this point you can probably logout of the text environment (CTRL + D or type exit) and back into the graphical environment (CTRL + ALT + F7) but the mount of /home will not survive a reboot.

                For this: add an entry to /etc/fstab to mount the new drive as /home on startup.
                I use blkid to get the UUID of the new drive, then paste it into /etc/fstab like.
                UUID=MY_DRIVE_UUID_STRING_HERE /home ext4 defaults 1 2
                and save.

                Then the setup will survive a reboot and be the same structure as when installing with a separate /home.
                You may want to clean up later by removing your home.bk and /mnt/newdrive directory.

                Another note:
                You may consider leaving /home in the root partition but keeping your data the new drive. This is more work but arguably better if you are running multiple versions of antiX or using another distribution. For this you would make your fstab entry to keep the new drive mounted on /mnt/newdrive. Copy your data files (~/Documents, ~/Downloads, ~/Pictures, etc) to the new drive. Then make symlinks to the documents within your users home folder to the new drive. This way you can have all your data accessible from the various installations without worrying about incompatible / corrupted configuration files. I also copy some hidden files and configs (EX: ~/.mozilla, ~/.steam, ~/.thunderbird, ~/.config/geany, etc) but do not use them for every install and make certain they are compatible if I use them on multiple installs (EX: has the same firefox version).

                Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.