Hello! I have a /home partition that is almost full, and there is another partition nearby with a lot of free space. I would like to reduce the size of this neighboring partition and add the freed space to /home. I would like to do this safely, without using a Live USB or bootable flash drive. Is this possible?

  • HamsterRage@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    55 minutes ago

    Resizing partitons is often not necessary. Use a symbolic link to relocate a subdirectory to another file system. For 99% of use cases this is indistinguishable from expanding the partition.

    • illusionist@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      6 minutes ago

      That adds an unneccessary layer of complexity to thr situation. Resizing partitions isn’t difficult or takes long.

      • twack@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        12 minutes ago

        I think this might be the right solution for OP, especially since they don’t seem to have had the “experience” I’m sure many of us have had with this “simple” operation. If you are going to do it, them it should be done using a live OS and a full offline system backup, otherwise its very easy to lose a lot of data this way.

        However, symlinks like that can make things confusing really quickly. I would encourage anyone using them in this way to establish some easily checked rules and abide by them. For example, maybe you only use symlinks like this in a specific folder such as /home/expanded. You can still have multiple links there like /home/expanded/on5TBdrive or /home/expanded/onPrimarySSD, but it makes it easier to remember, find, and check those locations later.

        When you need to know exactly where something is stored, verify a backup, or find data without the symlink, then you will appreciate a set of rules that helps you.

  • Zak@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    7 hours ago

    Safely is always a bit iffy when you’re resizing partitions with data on them. Parted and various GUI tools built on top of it can resize partitions without losing data in most cases, but there is always a risk. I wouldn’t like doing this without fresh backups.

    You can unmount the home partition for resizing when you’re not using it, e.g. if you log in as root, which typically has its home directory in /root. This would allow resizing it while running from your installed OS rather than a flash drive.

  • ClipperDefiance@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    7 hours ago

    I’m pretty sure you’re going to have to use a live USB. You can’t modify a partition while it’s mounted and you can’t unmount a partition that’s in use.

      • HelloRoot@lemy.lol
        link
        fedilink
        English
        arrow-up
        3
        ·
        6 hours ago

        Use a live image with gparted (most normal distros come with it) start it and the gui should be pretty self explanatory.

      • frongt@lemmy.zip
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        6 hours ago

        Use cfdisk and just edit the partitions.

        Please note that if you do this without first resizing the filesystems on the partitions, you are very likely to lose data. You cannot safely shrink a mounted partition.

        Edit: oh you mean booted from external media, not an online system. Use gparted. https://gparted.org/

  • Jestzer@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    5 hours ago

    I use GParted on a live CD/ISO for similar situations. I personally have never put my home directory on a separate partition, so I don’t know if this would somehow not work for you and I suggest backing up your data!

  • monovergent 🛠️@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    6 hours ago

    Doing anything with partitions safely means having a current backup of your disk.

    What you want to do might be possible if your disk was set up with LVM, but I don’t have too much experience with it. If you have a more traditional partitioning scheme, the problem is that you can’t really shave off the front of the next partition if you want to expand /home to the right, and you can’t tack free space to the front of a partition, if say, you shrink the partition to the left of /home.

    If, for example, you want to expand /home into a partition on the right, you’d have to shrink that partition, back it up, delete the original, expand /home to the desired size, and copy the backed-up partition into its new, smaller place. If that other partition is not mounted, you could do the procedure without a live USB, if you insist.

  • db2@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    6 hours ago

    This is one of the reasons I put /home on a separate ssd. If I want to upgrade, which has happened, I can just format the new one and copy my /home contents over preserving ownership and permissions, then it’s as easy as changing fstab and rebooting. No headache, but keep your old drive around for a while unaltered just in case you find out the new one is faulty.

    / is also ssd (same drive as /boot/efi) and includes the rest of the standard locations. Anything beyond that can be ssd or hdd as speed isn’t critical for longer storage.

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    7 hours ago

    To do it on a live system, /home and the partition shrinking have to be neighbors, and the shrinking partition needs to be unmounted. I think it might be possible with resize2fs, but I don’t have a guide.