Announcement

Collapse
No announcement yet.

Move Home from SSD to HDD; Guide? What happened to etc/fstab?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Move Home from SSD to HDD; Guide? What happened to etc/fstab?

    I have Kubuntu 14:04 LTS
    I want to move my home directory from the SSD drive to the HDD in my box.

    I have been looking at results of Google searches.
    Mostly I get Ubuntu items so I try to think of possible differences with kubuntu.

    They usually say at some point update the etc/fstab
    In my Kubuntu there is no etc/fstab, only an empty etc/fstab.d

    Is there an up-to-date guide somewhere for the whole process?

    Thanks.

    P.S. I could not see how to change my signature... in my Profile. How do it?
    Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

    #2
    The empty /etc/fstab.d you can ignore. It's not even in the latest version. I think it was a plan for future use.

    However, you do and must have an fstab or you can't boot. Try again this look for /etc/fstab rather than etc/fstab.

    Please Read Me

    Comment


      #3
      Originally posted by oshunluvr View Post
      The empty /etc/fstab.d you can ignore. It's not even in the latest version. I think it was a plan for future use.

      However, you do and must have an fstab or you can't boot. Try again this look for /etc/fstab rather than etc/fstab.
      I did not check close enough for files and stopped at the directory names.
      I see it now.

      It references the SSD but not the HDD.
      Dolphin has no trouble finding the Win7 partition on the SSD and the Win7 extension on the HDD. It also finds a backup copy of an old 32 bit version of Kubuntu on the HDD.
      But the HDD is not in the fstab file.
      Here's my related questions:
      How does Dolphin find those partitions without entries in fstab?
      I am thinking of first reformatting the old ext3 partition with ext4 and using that HDD partition for the new home.
      Any advice on that?

      Any suggestions for finding a guide to step-by-step moving?
      Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

      Comment


        #4
        Try this link, it is not totally up to date but should work to let you set up a separate /home partition:

        https://help.ubuntu.com/community/Pa...ng/Home/Moving

        what works for Ubuntu will also work for Kubuntu in this respect.

        Warning: When doing this type of work always make backups first. There is a danger of data loss if you perform some of the stages involved incorrectly.

        Having said that, knowing how to use these methods is very useful and well worth the effort of learning.

        Please, bring any questions you have back to this thread.


        *addition*

        At the above link there is a line of code that is Ubuntu specific:
        Code:
        gksu gedit /etc/fstab
        it crops up a couple of times,
        use this line instead, to produce the same result in Kubuntu:
        Code:
        kdesudo kate /etc/fstab
        Last edited by bobbicat; May 29, 2015, 09:59 PM.

        Comment


          #5
          If you would prefer me to walk you through it, so we could discus each stage, open a terminal (the console) and run the following:

          Code:
          sudo blkid
          Code:
          sudo fdisk -l
          and post the output here in this thread..

          Comment


            #6
            Thanks, bobbicat!

            I will start on the process and get back to it while doing chores during the day.

            I will begin making a backup of the current 14.04 LTS Kubuntu /home onto a portable drive, then continue with KDE Partition Mgr to reformat the old HDD Kubuntu 32 bit space as the future location of the new /home.

            I will take the steps that could lead to walking through with your help, but I think I may go ahead on my own. We shall see.
            Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

            Comment


              #7
              You are welcome to ask again here if anything is unclear, but as long as your data is safely backed up a little experimentation is always a good thing.
              You will probably need to edit your /etc/fstab to enable the mounting of your new /home partition. Remember to back up fstab before you start then you can backtrack if anything goes astray.
              I hope all goes well for you.
              Last edited by bobbicat; May 30, 2015, 03:48 PM.

              Comment


                #8
                An update:
                I will crash and come back sometime on Sunday.

                With KDE Partition Mgr I formatted the HDD partition for the new /home formatted as ext4

                Using sudo blkid I got for it:
                UUID="83427977-6185-489c-ae11-e7ea1544b809" TYPE="ext4"
                Using sudo fdisk -l I got:
                /dev/sdb2 102414375 163862999 30724312+ 83 Linux

                I backed up fstab to fstab.bak

                When I come back I need to edit fstab and continue.
                Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                Comment


                  #9
                  Hello, bobbicat,

                  I edited the fstab file but for now commented out the new HDD /media home line in:
                  # (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
                  # UUID=83427977-6185-489c-ae11-e7ea1544b809 /media/home ext4 defaults 0 2
                  because I am unsure about a next step:

                  I wonder: how do I make sure the
                  sudo mkdir /media/home
                  creates the directory on the newly formated HDD and not in my existing /home on the SSD?

                  I have to go out a couple hours....
                  Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                  Comment


                    #10
                    the /media folder has started behaving in slightly different fashion recently, it usually creates a folder /media/user in which your stuff will be found

                    can I suggest that instead you create your temporary folder under /mnt thus giving you /mnt/tmp
                    so:

                    In the Terminal enter this:
                    Code:
                    sudo mkdir /mnt/tmp
                    then:
                    Code:
                    sudo mount /dev/sdb2/ mnt/tmp
                    which will allow you to temporarily mount the new partition, assuming /sdb2 is the new partition for /home.
                    Code:
                    sudo rsync -avx /home/ /mnt/tmp
                    This will copy /home to the new location.

                    then:
                    Code:
                    sudo mount /dev/sdb2 /home
                    This will mount the new partition as /home and makes sure all data is present.

                    followed by:
                    Code:
                    sudo umount /home
                    next:
                    Code:
                    sudo rm -rf /home/*
                    This deletes the old /home and its contents.

                    Open fstab (making sure you have that backup)
                    Code:
                    kdesudo kate /etc/fstab
                    Now add the following at the end.
                    Code:
                    # new home partition on /dev/sdb2 ext4 made after installation
                    UUID=83427977-6185-489c-ae11-e7ea1544b809    /home    ext4    defaults   0   2
                    make sure you have a free empty line at the end


                    Now you can Restart your computer to see the new /home.

                    Finally you can tidy up and remove that temp file:

                    Code:
                    sudo umount /mnt/tmp
                    and
                    Code:
                    sudo -rf /mnt/tmp
                    you could also remove these two lines from your /etc/fstab as they are now redundant.

                    Code:
                    # (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings) 
                    # UUID=83427977-6185-489c-ae11-e7ea1544b809 /media/home ext4 defaults 0 2
                    Last edited by bobbicat; May 31, 2015, 03:53 PM.

                    Comment


                      #11
                      Hello, bobbicat,

                      When I gave command:
                      sudo umount /home
                      I got the message
                      umount: /home: device is busy.
                      (In some cases useful info about processes that use
                      the device is found by lsof(8) or fuser(1))
                      (Also, earlier there were directories in .kde that could not be removed. Maybe I am biting my tail?)

                      I did not attempt to rm the old home yet.
                      I have not edited fstab yet.

                      I have to go away for several hours.
                      I will leave my system running and hope....
                      Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                      Comment


                        #12
                        Hey, bobbicat,

                        I seem to have disaster.... Any way to recover what I lost?

                        I had downloaded a podcast and it had landed in my new /home on the HDD.
                        by that time the old /home on the SSD only had a few remnants I could not delete.

                        I tried umount /home again with same message.
                        I edited and saved /etc/fstab

                        Then I gave the command
                        sudo umount /mnt/tmp
                        and all the saved old home contents in the new /home vanished

                        I found no undo so far.

                        I will leave the system running and crash and check back during the night....
                        Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                        Comment


                          #13
                          can you make a copy of your fstab as it now stands and post it here?

                          (the data which disappeared when you performed umount on /mnt/tmp is still there but not visible, you unmounted it - which is what we wanted - remounting it would make it appear again, but at this stage we do not want it mounted.
                          Also if you have entered the lines correctly in fstab it would reappear permanently on restarting your computer.)

                          Please do not try to undo. Just post the full contents of your fstab here.
                          Last edited by bobbicat; May 31, 2015, 11:26 PM.

                          Comment


                            #14
                            Here is the edited fstab:

                            # /etc/fstab: static file system information.
                            #
                            # Use 'blkid' to print the universally unique identifier for a
                            # device; this may be used with UUID= as a more robust way to name devices
                            # that works even if disks are added and removed. See fstab(5).
                            #
                            # <file system> <mount point> <type> <options> <dump> <pass>
                            # / was on /dev/sda2 during installation
                            ################################################## ###################
                            # use these flags to reduce SSD writes: noatime,nodiratime,discard
                            # noatime and nodiratime flags turns off writing "last access time"
                            # discard enables TRIM as long as kernel >= 2.6.33
                            # UUID=5004f103-f1b3-4169-b29a-b6a74bc89151 / ext4 errors=remount-ro 0 1
                            UUID=5004f103-f1b3-4169-b29a-b6a74bc89151 / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1
                            ################################################## #################
                            # Added 4 lines to use RAM instead of SSD for temp and log files until
                            # set up to use /dev/sdb? to save on HDD for various lengths of time
                            tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
                            tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
                            tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0
                            tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
                            #
                            # new home partition on /dev/sdb2 ext4 made after installation
                            UUID=83427977-6185-489c-ae11-e7ea1544b809 /home ext4 defaults 0 2
                            Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                            Comment


                              #15
                              please don't make any alterations for now
                              Last edited by bobbicat; Jun 01, 2015, 01:49 AM.

                              Comment

                              Working...
                              X