Fresh install, partitioning, and preventing bloat

My currently Linux Mint install has devolved into a disaster. My biggest issue is the Unifi AP controller failed to update, and do to, what I have to conclude, is some crap programming (definitely not excusing Ubiquiti’s programmers either) in Linux I cannot remove it from the list of updates and so I can no longer do any updates, and everything I have tried to fix this has only made things worse. It’s so bad that the Linux Mint “Update Manager” doesn’t even work any more. To top that off my root (/) partition, of 30GB, is very close to full (I get regular notifications). And I would like to update to Linux Mint 19. So all this combined means its time to format and start over.

Just for reference my current partitioning (according to GParted [I think its off by a bit]);

285MB - /boot
3.73GB - /swap ( probably not needed as I have 32 GB of RAM and only have SSD’s)
27.94GB - /
433.82GB - /home

What shocks me is that the /home partition has 95GB used, what with, who knows, as everything I download, create, or install (like windows games/software via Lutris or wine) I try to place on a second SSD. I did it this way so I wouildn’t have to worry about crashing the OS and/or wiping the primary drive. Now I need to go digging through an infinite tree of folders to see if I need to save something, very aggravating. Stuff like this is why I left Windows.

I find Linux entire file structure to be an aggravating mess, so what I am hoping to accomplish is to shove the whole mess into a corner (like I did with Windows), and very very seldom have to look at it.

So first does that partitioning work, barring the fact that the /home partition will be a lot smaller, something closer to 85 GB (so i can use a smaller SSD and free up the 500GB SSD)? If that does work I guess I need some information on how to seriously lock down all those partitions, including /home, to keep ANYTHING new from being put on them without very explicit permission from me. Also maybe along side that last point, when installing software on linux is there a way to override the “default” install location? Or set a default install location?

Man, why do I suddenly feel like I am using Windows???

You left Windows for Linux expecting things to get easier? The fact that the number of home owned computers have it installed instead of Linux tells you it is easier to use. Windows is packaged with prebuilt pcs because it is the OS of choice as it is easy to use. Anyway good luck in your attempt to get what you want done in Linux. Also did you think of having dual boot with Windows and Linux so when you have trouble with Linux you have Windows to fall back on?

  1. Think of it as a learning experience. You now know what you tried didn’t work. Don’t repeat the same mistakes. Your next install will last longer.

  2. Don’t try to shift the blame to some anonymous programmers somewhere. It’s almost certain that you screwed up — probably multiple times. We’ve all been there. Own it.

  3. The directory structure may seem like an aggravating mess because you haven’t spent 20 minutes teaching yourself how it works. Spend the 20 minutes.

  4. Unless you have some rather unusual use cases, you are right — 32GB of RAM means that having a swap partition is a complete waste of time. Don’t bother with a swap partition or swap file — just watch your usage. Maybe install an extension that displays RAM usage to make it easy to monitor.

  5. If you are already installing software to a different drive, you can probably skip having a separate /home partition as well. EXT4 is usually a robust and resilient filesystem. There is no need for ‘regular’ users to have convoluted partitioning schemes.

  6. That you feel the need to reinstall and start from scratch suggests that either you don’t have a backup/recovery plan, or aren’t actually bothering to use it. If either of those are true, then rectify that as well.

1 Like

Use tools like du and df to analyze what’s eating up the space and work forward from there.

http://en.citizendium.org/wiki/Unix_directory_structure

Disk Usage Analyzer provides a really quick, graphical way to see what’s taking up space.

https://wiki.gnome.org/Apps/DiskUsageAnalyzer

3 Likes

On your point 5, let me double check I understand you correctly. You’re suggesting that I can skip making a /home partition? From what I know of Linux and its partition needs, that seems like it should work but I just want to be sure I am not misunderstanding you and causing myself some other headach. And if I can do that should I plan for more space in root? How much?

Next as to your second post about the “Disk Usage Analyzer”, you inadvertently gave me a tool I didn’t know was there, with that picture. While I knew about it I did not realize I could hover over sections and see the directory names and some sub-directories. I found things installed that should not be there. In the root partition I found; 0AD (a game), AMPPS, Firefox, Thunderbird, Chrome, Open Office, Android Studio (don’t know what that is), Eclipse, Geany, Minecraft (I have never played that), GIMP, and 2 installs of mongoDB both taking 3.5GB each (7GB total) and that is just with a quick scan of some of the directories. As for /home, Steam is using 75GB.

Between everything there probably over 90GB of stuff installed were I do not want it. And preventing this is my only concern at this point. I fix this and the partition issue fixes itself. So how do I fix this???

I would comment it seem a bit random where stuff gets installed. Some things are in root some things in /home; then under root I found stuff in /var /opt and /usr; and then in the /usr stuff is in /share /lib or /local. Things are all over the place, this is why I said its a mess. With only a quick scan of those folders that is 7 different places, so far, that programs could be install at, and you wonder why I don’t want to figure out the file system. Basic answer, it is completely illogical.

Yep.

If you really want, you can later copy your entire /home partition to a different disk, and mount that (assuming you want your user data on a different disk to your system data).

I’m not sure how Mint’s installer works, but Ubuntu lets you just allocate all of the free space on a drive to a single partition (for “/”) and then it creates a minimal /boot partition behind the scenes that — under normal circumstances — is perfectly adequate for regular use.

So an ext4 would just end up with a small /boot partition and everything else in /.

Yep, command line is nice, but sometimes GUI applications are just so, so much better. Glad you found it useful.

My reading of your original post gave me the opinion that you had given up on the current state of things and were going to format and start from scratch. That sounds like an entirely reasonable course of action to me.

I’ve gotten myself into binds over the years that made things messy. When I bit the bullet and just started from scratch things got better every single time. Sure, it takes an afternoon or so to get your system back to pretty-much the state it was (or should have been) in, but you can easily spend more time than that trying to troubleshoot obscure problems.

Start from scratch, reinstall a clean OS, install/configure the software that you had problems with first (so that if you keep having problems, another wipe and attempt can be done painlessly), then install what you didn’t have problems with, then bring back any user data that you need to. That would be my suggestion. Fail forward fast.

It’s completely illogical until you learn why those directories exist and what sorts of files should go into each of them. Grab a cup of tea and perform a web search for “linux directory structure” and spend 20 minutes or so going through pages like this:

https://www.thegeekstuff.com/2010/09/linux-file-system-structure

…and “illogical” will quickly become “logical”.

Thanks to “history”, where things have been stored have changed over time, so the age of a program often dictates where it will get installed. Different base distributions also have different preferred locations — if you take software initially developed on RedHat (for example) it may end up being installed in an “odd/deprecated/non-standard” place on Debian/Ubuntu/Mint.

At the end of the day, though, there’s less than a dozen directories a typical user really needs to be aware of and understand. Once you know what/where they are, and appreciate what they are for, you’re golden. The clouds part and a ray of sunshine beams down on you.

Have fun!

Well then, well then, well then …

[big long protracted sigh]

I did read your last post, but it doesn’t really address my core problem. Not that there is a solution for my problem.

Having typed out these posts and getting some feedback has allowed me to quantify the source of my problem and then go looking for a solution, and what follows is to say it is not looking good.

I am baffled at how it is some 10 or more tutorials on Linux partitioning or installing Linux, consistently recommend an INSANELY SMALL root partition (10-30 GB). They must be absolutely clueless to suggest that. Further, I can see why Linux, as it sits now, will always be struggling to get into the mainstream. Just about every program must be installed in the root partition. So if I have a 500GB drive and the entire drive is dedicated to the root partition, How many 30-50GB games can one install before you brick Linux??? Are you seeing the problem yet??? Yes, symbolic links can be made (I have used them excessively to fix Windows), but that is not something your average user is ever going to attempt. And really why should they need to, there is a package manager/installer. Would it be so hard if it placed the software were “I” direct it to, and then made those symbolic links. In Windows if I needed a symbolic link I could make it and be done forever. In this case I have to install the software first, then find it (possibly in more than one place), then move it, and then create the symbolic link(s) and I will have to do that every time I install something, in infinitum. Definately not user friendly .

At this junction I want to respond to the later part of point 2. I have been programing for over 25 years, I am, at minimum, competent in 13+ programming languages. On top of this I have done quite a bit in the IT field. And I have had to deal with bad programming a lot. And as a programmer I have had to fix some bad programming, so I think I have earned the right to give programmers some sharp criticism when its deserved. If I can’t give it, then there is a very small list of people who can.

And this issue is incomprehensibly dumb. I have worked with Linux going back into the 90’s (with Redhat) most of what I did was setup file, database, and web servers. Didn’t start using Linux as my daily OS till about 3 or 4 years ago, and really till the last year or so didn’t try gaming. I never had partition issues with those servers (of course some had obscene amounts of storage), so having to post about it, I felt like an idiot, in that I couldn’t figure it out or find the solution. Here I figured I was proficient in Linux and now looking back I guess just doing basically the same thing over and over, on systems that ran very reliably, meant I didn’t need to get into the nuts and bolts of Linux.

And a thought just hit me, I am suddenly realizing how much I have disassociated what I was doing then with what I am doing now. You saw some of the databases in that list I gave, and what I didn’t include was some web server software. All of them are configured to use my larger drive for storage, even though they are installed on root. Now I am feeling even dumber. I knew why I had to configure those that way, but some how I was not associating that with this issue. (still working out why 2 Mongo databases)

1 Like

No, it just means more people buy computers with windows and don’t/can’t manually migrate off it.

99.9% of Windows users have no idea how to administer windows either. This is not a problem unique to linux, its just that if you buy a PC, you tend to get Windows preinstalled.

If your assertion was true (and popularity was a true measure of ease of use), everybody would be running Macs instead of either Windows OR Linux, but they aren’t.

Windows is the “OS of choice” for PCs due to long-term predatory licensing agreements between Microsoft and hardware OEMs (essentially boiling down to “you pay us a windows license for every PC sold, or we do not supply Windows to you at all”), not technical or ease-of-use superiority.

If you think that is “oh he’s just a blind linux zealot” or whatever, just google the history of Microsoft’s business practices regarding PC operating systems.

1 Like

If I had to recommend a root partition size to a new user who is setting up a separate /home partition, I’d probably tell them to set it at 30gb. I hadn’t exceeded 30gb pretty much until I started toying around with snapcraft. I typically set my root partition at 50gb so I don’t have to think about it again, and I don’t tend to jam my disks full.

Many of the programs that go into your root partition are very small, and they are shared across other programs instead of being installed multiple times. The bigger applications(games, IDE’s, etc.) usually give you a choice of where you want to install them.

I’m not sure that

is really relevant if you’re talking about your specific case. At this point, it’s more interesting to see what you are going to attempt to resolve your issue.

I know that this can be seen as a limitation, but I generally consider this to be a thing that linux does right.

When I get back from work I can show you how I did my partitions.

Too long; didn’t wait, symlinks in home dir :wink:

And you are correct, linux fs tree is an archaic mess of historic shit, half-baked standards, and all the distros who don’t follow it. Oh and software devs who don’t care about that all and make their own dir in your home.

Still better than Windows IMO :joy:

1 Like

It’s probably more likely that the tutorials were written by people who administer servers. Servers — with few programs installed — typically don’t need big root partitions. None of that is relevant to a “typical” desktop user in 2019, however. Desktop users, who install more and larger applications, are a different use case that benefits from the flexibility that a single, large root partition provides.

On my Ubuntu 18.04, Steam installs games (by default) in /home/me/.local/share/Steam/. Since that’s on the root partition, I’ll run out of space at exactly the same time as a Windows or Mac user would run out of space — when the drive fills up.

However, if I know I’m running out of space, and I’m not willing to uninstall any games, I can just install a dedicated “games” drive, copy my entire Steam directory to it, then delete the contents of my Steam directory and mount the games drive at exactly the same mount point (/home/me/.local/share/Steam). No symlinks required. That would free up a bunch of space on the root partition, and as far as the Steam launcher and the individual games are concerned, absolutely nothing has changed.

There is no need to move everything to another drive — just the directory that is getting too large for comfort. There’s also no need to chase all the data related to an application and move it all to the same drive — Linux doesn’t care how many drives the data is spread across (as long as those drives are mounted correctly).

If you need to grow a Linux filesystem, you just add a drive, copy data, then mount the drive at the same part of the filesystem that the data came from in the first place.

If you want to avoid all of that ‘hassle’, consider installing Mint onto a Logical Volume Manager (LVM) partition instead.

A LVM partition is like an abstraction layer. You grab a bunch of physical disks, and LVM lets you group them all together and present a single, logical, interface for the entire collection. You can then treat it as one big partition. Afterwards you can add drives, remove drives, and so-on, and the (rest of the) operating system will be oblivious to what is going on.

If you want an infinitely and invisibly scalable pool of physical storage, and want to put minimal effort into managing this pool, then maybe LVM is what you are after?

$ man lvm

Last time I checked, grub wasn’t ‘lvm aware’ and thus you still need a physical /boot partition to boot from. But, apart from that, lvm gives you the flexibility to take an arbitrary number of physical disks/partitions, manipulate them as you please, and present them as one (or more) logical partition(s) to the OS. Learn lvm and you’ll probably be set for the next 20 years.

3 Likes

If you use logical volume management or ZFS this is not an issue as partitions can be expanded or otherwise resized as necessary.

But you can relocate with symlinks or whatever anyway.

Windows is no different in this respect.

Drive letters anyone? File types based on filename extension (half/half)? Some applications saving state in their install directory? “System32” for 64 bit files on a 64 bit system?

For a typical home user i would suggest a swap partition, maybe a partition for /boot and everything else in one chunk.

Unless you know what you are doing and want different mount options for different partitions (e.g., a read only /usr for example for a hardened system) it’s largely pointless on a modern end user system. Keep it simple…

Oh yeah, speaking of devs putting their own application directory in your home folder… steam on windows anyone?

1 Like

Dotfiles and dirs randomly being created in my home dir pisses me the most

2 Likes

At least they’re all in one place and easily backed up/nuked…

It would be much better if all would follow the .config “standard”

I’m sorry, but from what i’ve read, OP doesn’t seem to have a basic Understanding of how the Linux Filesystem works. Complaining about how everything has to be installed under “/” is a bit pointless really.

OP ( @ShaneH ) :

for less hassle.

/boot of say 50 GB
/swap of 16 GB
the rest mounted under /

What would you need a 50G /boot partition for? Typically that should be 500MB or so…

Because disk space is cheap, and kernel sizes/driver stacks get bigger over time.

I’ve dealt with servers with excessively stingy /boot and having to rebuild/otherwise fuck around because some idiot decided 5 years ago that they’d trim /boot down too much is no fun.

That was based on my assumption of a roughly 1 TB disk (in that context, 50 GB is “insignificant”). Shrink down to 10 GB if you like, but IMHO 500 mb is being excessively stingy and will bite you in the ass down the line.

2c.

2 Likes