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.
This is the correct answer. A symlink is much easier than trying to resize a partition.
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.
That adds an unneccessary layer of complexity to thr situation. Resizing partitions isn't difficult or takes long.
Hard disagree. Resizing partitions is dangerous and difficult for most computer users.
(I'm a sysadmin who does this stuff multiple times a day, so this isn't negative bias)
Symlinking is quick, easy, totally safe. It's one of the best things about linux filesystems. Use it.
The question implies that the OP wants to create one giant filesystem with all of their data on it. This has its own issues, especially if it is in /home. For one, as someone else pointed out, it's fairly difficult to run your system without /home mounted, and that makes it difficult to resize. Sure, you can set up an admin account with it's home in the /root filesystem and then log into that - but that seems to be a lot of work in itself.
If it was me, I'd set up mount points for file systems that make sense. Maybe /data/Photos, or /data/Music, or data/AppData, or whatever. As much as possible, I'd just point whatever software I was using to those new directories to find the data. If that isn't feasible, for whatever reason, then a symbolic link from /home/Photos to /data/Photos will work seamlessly in most cases.
As far as I'm concerned, after administering enterprise systems using Unix going as far back as the early 90's, symbolic links are a key tool in managing disk space that you shouldn't just dismiss because it's "an unnecessary layer of complexity". Having smaller, purpose designed, file systems allows you to manage them better. Sticking everything into /home is probably not the right answer for anyone.
Theoretically it can be done without a Live USB Stick. However you will probably be altering the partition table of the partition that is currently booted. If you fuck up, you will be left with an unusable system. Don't do it.
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.
You don’t need to unmount anything to resize.
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.
! thank you, but maybe you can tell me, how can I do it on a live system, please?
Use a live image with gparted (most normal distros come with it) start it and the gui should be pretty self explanatory.
Don't do it on a live system.
Do it live, you’ll be fine, I do it literally once a week on production systems for over 20 years. The issue is yourself, make sure you’re well read.
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/
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.
If the nearby partition isn’t like root or something then yeah you can do that with frisk and parted and whatnot.
What’s your fdisk -l or lsblk output?
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 1 14.7G 0 disk
└─sda1 8:1 1 14.7G 0 part /run/media/someuser/T72ER3G
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot/efi
├─nvme0n1p2 259:2 0 50G 0 part /home
└─nvme0n1p3 259:3 0 425.9G 0 part /var/lib/containers/storage/overlay
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!
Gparted (Live)
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.
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.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0