Announcement

Collapse
No announcement yet.

Mislabeled (mismounted?) /home

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

    Mislabeled (mismounted?) /home

    I had to reinstall 22.04, but I didn’t want to lose my existing /home setup. Jglen had a post in 2020 that explained how to do that, and I’ve used it before. This time I did something wrong in setting up the partitions. Apart from the required UEFI and other stuff, I installed the OS on p1, which is about 50Gb. My old /home was (and is) on p2, which is 1.8Tb.

    After the reinstall, I find I have created new Desktop, Documents, . . . in a home drive that is part of p1. None of those folders have anything in them, nor will p1 hold the contents of my old home directory.

    My old home directory still exists and is quite usable, but it is in p2, accessible as a separate device in Dolphin called Data. What I want to do is get rid of the p1/home directory and have the OS regard the p2/old home directory as “home.” I suspect there is a way to do this without doing another reinstall, but I don’t know the steps.

    Many thanks.

    #2
    Hiya - yeah, you needed to set the home directory when installing, which appears to want to create a new partition, not simply reassign an existing one. To fix it you need to modify your FSTAB. To start do the following:

    open a terminal and type (highlight the line here with mouse to copy then in the terminal use the middle mouse button to paste):

    sudo lsblk -o name,mountpoint,size,type,ro,label,uuid

    This will give you a listing of your partitions along with their UUID value that looks something like this:


    ******************************
    sda 0B disk 0
    sdb 465.8G disk 0
    └─sdb1 /home/shad/Media 465.8G part 0 Media 181b8772-a94a-4e07-a676-5dfc3c6b0fe7
    sdc 465.8G disk 0
    └─sdc1 /home/shad/Games 465.8G part 0 Games 368e5afe-9b18-43db-8833-fa4c979283f3
    sdd 111.8G disk 0
    └─sdd1 /home/shad/Small 111.8G part 0 Small 15a99f89-160f-4bf0-8aee-6872206a66b0
    sde 3.6T disk 0
    ├─sde1 16M part 0
    └─sde2 /home/shad/Storage 3.6T part 0 Storage DCD08FA2D08F820E
    nvme0n1 465.8G disk 0
    ├─nvme0n1p2 /boot/efi 513M part 0 E515-D236
    ├─nvme0n1p3 16M part 0 HxqcfI-dzew-9y5s-R2F3-kseo-dCwQ-1YbN2m
    ├─nvme0n1p4 [SWAP] 3.7G part 0 939606bc-dddc-415d-9586-4d4de83e704b
    ├─nvme0n1p5 /home/shad 354G part 0 Home aee4dff0-7605-4fd4-8d4b-498b0b21bbff
    └─nvme0n1p6 / 107.5G part 0 Root 46beabda-02fe-4a40-9614-25a0d1a32cb6

    *****************************

    You can see my existing (old) home folder resides on partition 5 labeled "Home" on my nvme with a UUID of aee4dff0-7605-4fd4-8d4b-498b0b21bbff

    So, identify which partition is your old home folder and note its UUID. In the file manager (Dolphin) navigate to /etc/ and click on "fstab" which will open in Kate.

    Add the following line at the bottom:

    UUID=<the UUID you noted> /home/<username> ext4(or whatever FS you use) defaults 0 0

    So in my case it is:

    UUID=aee4dff0-7605-4fd4-8d4b-498b0b21bbff​ /home/shad ext4 defaults 0 0 (do not use my UUID number or mount point and make sure there is a space between the two zeros at the end).

    The line means the following:

    "UUID=" is the unique identifier for the partition
    "home/shad" is the mount point
    "ext4" is the file system type
    "Defaults" are settable options
    "0 0" are the settings for fsck that tell it "order" and "check or not"

    The entry is space separated so you can add spaces (IE space bar on keyboard) to clean up the line a bit.

    Save the file (Kate will prompt you for your password) and reboot the computer.

    Do the same for any other partitions you want mounted in specific directories. Do not use "/dev/sda1" style over UUID, you will break automounting of removable storage and cause your computer to not boot (don't ask me how I know this *cough*).

    If this should cause your computer to not boot, do not panic. It will drop you to the emergency console after a minute once timed out. Hit "enter" to continue and you will be at a ROOT prompt. Type

    pico /etc/fstab

    it will open the fstab file. Find the line you added and add a pound sign (#) in front of it... this will cause the system to ignore it. Save <contol o>, exit <control x> and reboot. Then when back on your desktop, look for the error you made, correct and try again.
    Last edited by ShadYoung; Sep 17, 2022, 11:10 AM.

    Comment


      #3
      Shad,
      I really appreciate the thoroughness of your response. Among other things, it reminded me of how I screwed up this installation and persuades me to reinstall. I've had to do this once before on a different box, and it went fine. What I forgot about that prior experience (of which your first line reminded me) is that the way I got Home to work properly was first to copy all of its contents onto an external drive. Then I did the reinstall, creating a new Home directory of proper size as part of the installation. Then I could load the externally saved contents of the old Home directory into the new Home.
      Life works better when you remember how you did it last time. (This is simply another manifestation of "it works better if you plug it in.)
      Thanks again for alerting me to my folly.

      Comment


        #4
        Originally posted by ShadYoung View Post
        "home/shad" is the mount point
        Actually, the mount point would be just /home, not including the username.
        Of course, you can do it using any location you wish, but using standard directory conventions will make everything work better together, and remain the same through potential reinstalls, and if you ever have more than one user account.
        Particularly, as I will guess that you already have that partition with /your-username as the topmost directory, it will simply just make things easier

        But, once you have the partition information it is actually quite easy to edit your /etc/fstab to add the new info using Kate or kwrite:

        Code:
        #  Adding my new partition for /home
        UUID=<some-long-a**-string> /home ext4 defaults 0 0

        Comment


          #5
          You shouldn't have to do that. The problem is the installer being a bit vague about what its doing. Back in the day, when you would partition the drive, you could just tell it to create a new partition in the empty space, then tell it to simply mount the other partitions where you told it to. The modern installer seems not to want to do that. When you click on the old "home" partition it says "creating a new partition table"... which... we do not want... sort of. The problem is, I am not sure if it actually does or simply recreated the table without touching the actual existing partition.

          I am going to find out. I am going to create 2 new partitions on a spare empty SSD, put some data on it, then put it in my laptop (Toughbook that has a tray for easy swaps) and install KDE, telling it to delete the first partition and use the second as home. If it preserves the data, then the issue is simply the installer not clearly or correctly explaining what it is doing. If it deletes the data and creates a new partition, then I am damn glad I didn't test my theory on a live system.

          I will let you know.

          Comment


            #6
            Originally posted by claydoh View Post
            Actually, the mount point would be just /home, not including the username.
            Of course, you can do it using any location you wish, but using standard directory conventions will make everything work better together, and remain the same through potential reinstalls, and if you ever have more than one user account.
            Particularly, as I will guess that you already have that partition with /your-username as the topmost directory, it will simply just make things easier

            But, once you have the partition information it is actually quite easy to edit your /etc/fstab to add the new info using Kate or kwrite:

            Code:
            # Adding my new partition for /home
            UUID=<some-long-a**-string> /home ext4 defaults 0 0
            Right! Sorry just /home

            Comment


              #7
              OK, well, I just tested the manual partition way during install and it is destructive. The data that was in the existing partition is gone, even though it was told not to format. Kubuntu needs to fix this.

              Comment


                #8
                I have never had that happen with a Kubuntu install, ever, where it wasn't my own fault. We are talking since 2005. I have been doing separate homes since well before Kubuntu existed.
                if you select an existing partition, set it as /home, un-check the 'format' box, and don't change anything regarding that partition, it won't touch it.

                if it did, you either selected or labeled the wrong partitions, or you need to report a bug, No one will ever know about it here.
                Try again, if you can, and record your steps to reproduce it, and report the bug on launchpad.

                Comment


                  #9
                  Originally posted by claydoh View Post
                  I have never had that happen with a Kubuntu install, ever, where it wasn't my own fault. We are talking since 2005. I have been doing separate homes since well before Kubuntu existed.
                  if you select an existing partition, set it as /home, un-check the 'format' box, and don't change anything regarding that partition, it won't touch it.

                  if it did, you either selected or labeled the wrong partitions, or you need to report a bug, No one will ever know about it here.
                  Try again, if you can, and record your steps to reproduce it, and report the bug on launchpad.
                  You are again correct. It was my own faux pas. The test files are still there and intact. The installer could be a bit more clear about what its doing though. It used to be.

                  Comment

                  Working...
                  X