[SOLVED] Is the space set up during partitioning smart/correct
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is the space set up during partitioning smart/correct
Trying to learn the basics still and after figuring out how to start from scratch by partitioning my drive, now wondering if I did it correctly with space allocated, tagging partitions and so forth. Kicking around learning a bit of command line lingo I discovered df, and it's presented me with this.
It now has me questioning the space I allocated and after an opinion as to whether I made a smart move or a daft one when setting up? My /home drive is half used, does this mean I only have 8G odd for space with potential users created? If I create several users and each used a few gig of "personal" files saved, am I going to run in to trouble... Should I have setup the /home with the space / has for example? Or is it a case that generally users will save things directly under / and space is not an issue.
As a first reaction, I'd say you have too many partitions.
I use one for /, one for /home, and one for /opt if I have big packages onboard. Maybe another for VMs. The difficulty with all those tiny partitions is that one will overfill and trip you up, while you have free space in another.
You only have 3 partitions, the EFI partition as well as one for / and /home and yes, the / partition is much larger than the /home partition which is the reverse of what people usually do. A standard currently would be 20-30GB for / and the rest for /home or data partitions as well as your EFI.
Your home is only 8G, which is in my opinion small. A lot of this will be used by cache files (such as the browser cache), which you can minimize by changing the setting of programs such as browsers to use a smaller disk cache. Your e-mails may be stored here too if you hold them locally. Either way, if you have multiple users, you're going to run low on space and have to resort to making it bigger, or symlink hacks.
You could create a folder on your / partition, called /shared, with permissions set for others users to access. You could put photos, shared music, etc there, that is, all the big stuff, and leave the home directory for config files, maybe your own personal documents. But even then, 8G will be tight.
It is better to have /home larger, with your / only for software and the OS. That can be hard to predict, especially if you're going to install games, like Steam games. That allows you to store your own files on the roomy /home partition, which has an advantage when you come to reinstall your distro, in that you can leave /home untouched. Personal data on the / partition would have to be backed up and restored. That being said, I've very, very seldom have had to reinstall Linux, and even then, it was only by choice.
If you're unsure how to get it right, you can simply forgo having a separate /home partition, or use LVM. LVM will allow you to resize them later. The other way to have "partitions" where you don't have to worry about size is to use BTRFS.
For reference, this is my laptops partition setup with non-disk partitions not listed. I keep /var separate, though it probably wasn't the best idea. Note that I'm the only user, and I find /home too small, but this is not my main computer.
Pretty much what I thought I was seeing, had intended to go that way, bugger. Thought I'd set roughly 20G boot, 16G swap, and the rest /. Apparently not, could have sworn I had until I looked at this *sigh.
Adjustable without having to re-do an install with Gparted or something safely?
The most important thing that you should do when setting up your system is to enable LVM = Logical Volume Management.
What this does is to break the traditional correspondence between "a drive or partition" and a "mount point." Instead, partitions are added to storage pools, which can include space from more than one of these, and to which new partitions can be added or removed at any time. Logical volumes ("mount points") are carved out of a storage pool. More than one logical volume can draw from the same pool. Application programs never perceive any of this magick. All of this happens without rebooting.
Now, questions about "how to partition" simply become moot. You have one set of commands to manage the storage pools, and another set of commands to manage the logical drives. You can issue these commands while the system continues to operate.
Let's say that "/" fills up. You add a new drive (partition) to the storage pool. Then, you expand the filesystem to recognize the newly added space. If your hardware is such that you can add a drive without shutting down the system, you can do all of this on-the-fly.
There are other very nice benefits, too. If one drive starts "making ominous clicking noises," you can withdraw it from the storage pool. Its contents will be migrated somewhere else, automatically! Once this process is finished, you can remove and junk the failing drive.
Yes, it is possible to enable LVM "after the fact," but it's an option that – so far as I am aware – every distro offers you at installation time. "Say 'yes.'"
Last edited by sundialsvcs; 06-22-2021 at 10:42 AM.
Pretty much what I thought I was seeing, had intended to go that way, bugger. Thought I'd set roughly 20G boot, 16G swap, and the rest /. Apparently not, could have sworn I had until I looked at this *sigh.
Adjustable without having to re-do an install with Gparted or something safely?
Yes, I have resized and moved partitions around with GParted Live on many occasions and never had data loss - just think carefully about what you want to do before you do it. Your results will usually be about as good as your planning, so think it through before you begin.
I have also recently begun to use LVM. I do not (yet) think it is the most desirable option for every partitioning case, but it is very useful for managing data partitions (/home included) with storage requirements which are not yet known or which may change drastically over time. Well worth learning how-to even if you don't want to use it for all partitions at this time.
Last edited by astrogeek; 06-22-2021 at 12:35 PM.
Reason: tyops
Quite honestly, Geek, I find no good reason not to use LVM. It simply "makes the partition issue go away entirely." Partitions simply "provide available space," which you can carve up and re-carve up, any way you like and anytime you want to.
The ability to gracefully take down a questionable drive – which I have availed myself of on more than one occasion now – is alone "well worth the price of admission!" It's a thorough, elegant solution to a matter that faces every system administrator.
Last edited by sundialsvcs; 06-22-2021 at 01:42 PM.
LVM is certainly flexible, but that implies (and delivers) an extra level of complexity. Should be manageable by the average home user so long as they don't use XFS.
Still, messing with partitions is generally do-able with gparted. On occasions can be extremely educational. Teaches things like good backups f'instance ...
syg00: In my opinion, the complexity doesn't exist. Unless and until you actually need to take advantage of it, you forget that it is even there. The dirty-work was done automagically when you first installed Linux, and "it just works.™"
Last edited by sundialsvcs; 06-23-2021 at 08:24 AM.
Looking at the df listing I would suggest booting to the live USB, use gparted to shrink the / partition (nvme0n1p5) to a reasonable size (I think 50G would be more than adequate), then expand /home (nvme0n1p2) to fill the unused space. It may involve moving partitions right or left to make sure the unused space is all contiguous, but that is easily handled by gparted.
The numbering scheme for the partitions implies there are 2 additional partitions between /home and / so that also will require handling. Are you by chance also dual booting? Using gparted in this way may break the windows boot manager if you do this and you would then need to recover from windows booting problems.
LVM is certainly flexible, but that implies (and delivers) an extra level of complexity. Should be manageable by the average home user so long as they don't use XFS.
Still, messing with partitions is generally do-able with gparted. On occasions can be extremely educational. Teaches things like good backups f'instance ...
I love LVM where you are using EXT3 or EXT4 format, it is simply redundant (a waste) when using BTRFS.
We would need more information before we could intelligently advise the OP on which would be superior for his specific case.
Thanks for all of your input, this such a great forum and a great help.
When I initially installed I setup LVM, but it caused me a bit of confusion... clearly I was not completely understanding it and was unable to perform the install like that for some reason. I ended up using FAT32 for my /boot sector and ext4 on the /home and extended portions, just to get the job done with the thought it was not going to be detrimental to anything that I was going to be doing. At this point, my understanding is that I would need to gutt the system completely to setup LVM and if that's the case I would rather just stick with traditional partitions. I think somehow when setting it up I thought I had set a swap tag as 16G reading from recommendations which turned into /home!? and the rest (extended) would be available system space (didn't quite understand what may have been said hahaha).
Right now however, there seems to be an issue trying to alter the space allocation with Gparted, and also some questions have arisen out of this. If I am to maneuver the space on the drive it will need to be unmounted, will this mean the GUI I am using to perform the task is unable to operate or is everything at this point run in memory/RAM or from the /boot/efi location for example, and can safely unmount the extended portion / and /home to adjust on the fly? I thought seeing as I was using the profile attached to /home this might cause issues, do I need to be in a tty using root#? Still deciding on making 50G available as extended and the remaining space (400G odd) as /home. The reality is I don't really need extended, so could equally just have my 20G /boot/efi, and delete the extended partition leaving /home with the remaining space.
The issue I am having atm is: I have tried to unmount the extended partition to start there, but I cannot unmount using Gparted it seems (locked).
The file system on partition ‘/dev/nvme0n1p5’ could not be unmounted.
DETAIL = Command: umount --verbose --all-targets /dev/nvme0n1p5
As mentioned above, to do this work you need to be booted from a liveUSB - the install medium will do; boot that up and connect to your router and install gparted in need. This will all run in RAM and disappear when shutdown.
Given the above notes, you will not easily be able to move the space- some shuffling is involved; think of a sliding block game. Let's see the output of this
Code:
sudo parted /dev/nvme0n1 "print free"
You certainly cannot run if you delete p5 (the root partition) entirely.
And yes, retro-fitting LVM will be beyond you at this point - it can be done, but re-install is cleaner.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.