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?

upd: gparted just worked(through a live usb stick)! Sometimes I try to use symlinks, but not this time :) Thanks everyone!

  • Zak@lemmy.world
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    4 months 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.

  • HamsterRage@lemmy.ca
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    4 months 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.

      • twack@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months 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.

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 months 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.

  • ClipperDefiance@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    4 months 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.

  • monovergent@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    4 months 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.

  • Jestzer@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    4 months 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!

  • db2@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    4 months 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.