• Ubuntu home Verzeichnis in Partition verschieben

    From Lothar Leidner@lothar.leidner@web.de to alt.os.linux.ubuntu on Wed Dec 3 15:41:57 2025
    From Newsgroup: alt.os.linux.ubuntu


    System: Dual Boot Windows 11 / Ubuntu 2204 LTS, installed on the same SSD.

    To create more space, I wanted to move the Ubuntu /home directory to its
    own partition on a second hard disk drive (HDD). I followed the Ubuntu Handbook
    https://ubuntuhandbook.org/index.php/2024/08/separate-home-ubuntu/
    #more-47038, copied the original directory to /home_backup, and modified / etc/fstab.

    The result: Ubuntu no longer boots.

    Now I wanted to undo everything, created a boot stick with live Ubuntu 24.04.3, was able to boot with it and access the hard drives, but only in read-only mode. My plan was to copy the backup home directory /home_backup back to /home and comment out the inserted line in /etc/fstab. Then, I thought, everything should work again as it did originally.
    My question: how can I access the partitions in write mode (from Live
    Ubuntu) and thus implement these changes? Moving the /home directory would
    be put on hold for the time being.

    Any help appreciated
    Lothar Leidner
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Paul@nospam@needed.invalid to alt.os.linux.ubuntu on Wed Dec 3 15:47:22 2025
    From Newsgroup: alt.os.linux.ubuntu

    On Wed, 12/3/2025 10:41 AM, Lothar Leidner wrote:

    System: Dual Boot Windows 11 / Ubuntu 2204 LTS, installed on the same SSD.

    To create more space, I wanted to move the Ubuntu /home directory to its
    own partition on a second hard disk drive (HDD). I followed the Ubuntu Handbook
    https://ubuntuhandbook.org/index.php/2024/08/separate-home-ubuntu/ #more-47038, copied the original directory to /home_backup, and modified / etc/fstab.

    The result: Ubuntu no longer boots.

    Now I wanted to undo everything, created a boot stick with live Ubuntu 24.04.3, was able to boot with it and access the hard drives, but only in read-only mode. My plan was to copy the backup home directory /home_backup back to /home and comment out the inserted line in /etc/fstab. Then, I thought, everything should work again as it did originally.
    My question: how can I access the partitions in write mode (from Live Ubuntu) and thus implement these changes? Moving the /home directory would be put on hold for the time being.

    Any help appreciated
    Lothar Leidner


    There is a remount option to change from ro to rw.

    https://unix.stackexchange.com/questions/507109/how-to-remount-a-device-in-read-write-mode-which-is-already-mounted-read-only

    sudo mount -o remount,rw /Mountedpartition

    But as the next message below that suggests, a partition
    would not go "ro" purely by chance. It implies the
    partition failed an fsck and you should check dmesg for "hints"
    while the live session is booted. The dmesg may note the problem
    with the initial probe of the filesystem in question.

    sudo dmesg

    I don't think the "simple" recipe to undo the changes is
    broken, but something has happened which has to be resolved
    first.

    *******

    When I do stuff like this, I just image the disk and make
    a safety backup before I start. I have about 3TB of safety
    backups on the 8TB drive right now.

    Paul


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jonathan N. Little@lws4art@gmail.com to alt.os.linux.ubuntu on Wed Dec 3 15:50:21 2025
    From Newsgroup: alt.os.linux.ubuntu

    Lothar Leidner wrote:

    System: Dual Boot Windows 11 / Ubuntu 2204 LTS, installed on the same SSD.

    To create more space, I wanted to move the Ubuntu /home directory to its
    own partition on a second hard disk drive (HDD). I followed the Ubuntu Handbook
    https://ubuntuhandbook.org/index.php/2024/08/separate-home-ubuntu/ #more-47038, copied the original directory to /home_backup, and modified / etc/fstab.

    The result: Ubuntu no longer boots.

    What was the error?

    I have done this countless times. Most often is the error is a typo in
    the UUID of the partition. I also modify and test not will a live
    session but actually while booted locally.

    1) Install drive and format and partition as you need. BTW install
    gparted makes this easy:

    sudo apt install gparted.

    Note: if you give the partition a label like "NewHome" it makes things
    ease because after leaving gparted it will auto mount with an easy path
    rather than the long UUID:

    /media/USERID/NewHome

    2) In gparted it is easy to get the UUID which I copy and paste to a
    text file for reference. You can also get the UUID from the command line
    with:

    sudo blkid

    3) Copy not move profiles to new drive:

    sudo cp -a /home/* /media/USERID/NewHome/

    4) rename existing /home:

    sudo mv /home /home.bak

    5) create new home mount point:

    sudo mkdir /home

    6) Backup /etc/fstab (always good practice) then add new home mount to fstab

    # example /dev/sdb1 is new home with
    # UUID f0f67bec-f1f3-483a-be8e-37b08711e7ac UUID=f0f67bec-f1f3-483a-be8e-37b08711e7ac /home ext4 defaults 0 2

    7) Now mount is and check that you have all your files. You do not have
    to reboot:

    sudo mount -a

    If you do that and all your files are there you should not have any
    issue when you reboot. If your files are missing fix it now. You can
    mount by device path to see if that works that way. For above example: /dev/sdb1 /home ext4 defaults 0 2

    try mounting again if that works then you made a mistake on the UUID

    After everything working then reboot. And then you can remove /home.bak
    when you are sure everything is okay.


    Now I wanted to undo everything, created a boot stick with live Ubuntu 24.04.3, was able to boot with it and access the hard drives, but only in read-only mode. My plan was to copy the backup home directory /home_backup back to /home and comment out the inserted line in /etc/fstab. Then, I thought, everything should work again as it did originally.
    My question: how can I access the partitions in write mode (from Live Ubuntu) and thus implement these changes? Moving the /home directory would be put on hold for the time being.

    Any help appreciated
    Lothar Leidner


    you have to use sudo in command line to move files use copy
    sudo cp -a

    But I would check so things first to see what you may have done wrong.

    1) is the UUID correct in fstab
    2) any errors in fstab?
    2) did you preserve ownership and permissions for profiles in home?
    This is an easy mistake, usually system boots but you cannot login. You
    have to recursively fix ownership and permissions
    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    --- Synchronet 3.21a-Linux NewsLink 1.2