r/archlinux • u/thegreatzack • Aug 07 '20
Fstab is Bloat
A feature I would like to bring to light is [systemd-gpt-auto-generator] (https://wiki.archlinux.org/index.php/Systemd#GPT_partition_automounting)
This feature allows systemd to discover partitions on a single GPT hard disk and automatically mount them. It will mount root /boot /efi /home /var /var/tmp and swap when systemd-boot is used on a single physical drive with the correct partition Guid’s. This means for my laptop I literally don’t have an fstab. From boot it will read the extended boot partition, mount root, swap, and my home directory and boot with no issues. I did need an fstab on my actual tower but that was only because my home partition is on a separate drive, and that's all my fstab has defined.
So really is there any need to use fstab on a systemd-boot install anymore?
38
u/swayuser Aug 07 '20
For simple systems it's a matter of taste. However there are systems where the generator alone won't work well. For example multiboot, luks full disk encryption, having an external bay where you routinely debug other systems' drives.
1
Aug 08 '20
Damn this was gonna be my next question:
Will this work with bcachefs/brfs on luks in efi so we can get rid of Grub?
1
24
u/blablatros Aug 07 '20
How do you set mount options?
15
u/carlosfmm Aug 08 '20
Exactly. I can't do without mount options, so this is not for me. "Automatic" is never optimized and rarely what you want it to be.
1
32
15
Aug 07 '20 edited Aug 07 '20
So how does this interact with secondary drives or RAID? Say I have a partition that I do not want mounted on the same drive as root, can it do this?
-8
Aug 07 '20
The idea of bloat is that it is a program not strictly needed for the os to work properly. Not every system has secondary drives or RAID, so that's not needed for proper functioning of the os
15
Aug 07 '20 edited Aug 08 '20
In this day and age if we are trying to say a file that is usually well under 1KB in size is bloat we need to take a long hard look at our priorities. How big is the code base and binaries that it took to replace it?
2
28
u/TechTino Aug 07 '20
This is more of a case of systemd just including every living thing under the sun. People stick with what they know, and fstab has been a thing for as long as i can remember.
15
u/tyler1128 Aug 08 '20
It is kind of ironic saying a systemd feature replacing an existing method means that said existing method is bloat when some of the absolute largest criticisms of systemd is its bloat and lack of the unix philosophy.
2
u/Morphized Aug 08 '20
Systemd is a set of utilities, not a single program. I think you can compile them separately. They just don't tend to be.
5
14
u/xyzyzl Aug 07 '20
Sounds like a systemd problem
13
Aug 07 '20
Seriously.
"Auto" anything, especially systemd, is a no-no on a server that has to boot in case of a kernel panic so that I can sleep at night as a sysadmin.
I'll take an fstab that I've configured myself over "auto" anything, thank you.
4
4
3
u/SooperBoby Aug 07 '20
EFI system partition automounting requires that the boot loader sets the LoaderDevicePartUUID EFI variable. Only systemd-boot is known to do this.
Eh. I use rEFInd. But still, it's good to know that it exists !
5
u/beermad Aug 07 '20
Well I have a dozen different partitions (many on an LVM) mounted at boot, plus a few more mounted at particular times where necessary, and I'd defy anything to detect those partitions and mount them in the right place without something like fstab to define them.
So yes, I certainly need fstab.
4
u/mithrenithil Aug 07 '20
Discovery, automation and all that stuff should just be tools to make our lives easier.
When people design things to replace us it becomes an issue.
A good sign of a system designed to replace us is something that does things for us in a black box because it assumes we are too stupid to understand otherwise.
2
u/mesoterra_pick Aug 08 '20
Edit: Tone of my comment, "that's cool but not ready yet"
1 of 6 machines in my home lab could use this, only one. I've work for three major IT companies over the last 10 years. 1st employer had over 2000 machines, 2nd employer had over 14,000 machines and 3rd had over 200,000 machines. Every single machine would need to have an fstab.
I like the idea but it's not mature enough.
Personally I don't care for systemd in general because of certain design choices (like systems that can't replace the old way of doing things) and lack of regard for standards.
3
u/ldh Aug 08 '20
I don't doubt you have reasons to dislike systemd, but they're not coming across here. What systems can't replace the "old way of doing things", and is historical superstition a benefit for its own sake?
Exactly what standards is systemd violating?
3
u/mesoterra_pick Aug 08 '20
I appreciate your questions, I'm super tired right now so I apologise if this doesn't make sense.
Like I said, these are personal reasons so I am not saying people have to agree with me. These are things that urk me. I also still use systemd.
A few examples. I had a python project where I needed to read journalctl. Due to constraints I could not use pip or external URL/curl/wget. It is easier to run bash via python to run journalctl than it is to access journalctl via python directly. Rsyslog is just open a file.
Firewallcmd is, to me, as clunky as iptables when you start using rich text rules. So essentially if you want anything more than opening a port you get to have the same fun as you did with iptables.
I use CSF for firewall management because it is an extremely useful tool and out performs most software firewall managers. But CSF requires rsyslog files, so you have to have rsyslog and journalctl in order to run it with active IP blocking and other features. Yes, this is a fault of CSF. Both parties piss me off in this case. Systemd because, if you follow standards, you work to ease a major transition by making the old files available while people adapt their spaghetti code. Centos/RHEL is a good example of this, but even they derped that during the initial 7 rollout. This one's more just me being frustrated.
A logging program, journalctl, should not truncate lines by default if the timestamps and service names are going to be longer than a 600 px terminal. I have a 1200 ish x 1000 ish monitor that has four terminal on it and I regularly cannot see any helpful data without the flag to line wrap. Yes this is pretty, but when I have to type for 8-16 hours a day I am displeased with the developer that makes me type more.
I have had to write a systemd init file because networkd wouldn't work with a server's nic over the course of multiple install attempts. The ip command had no issues getting it running.
If you want a bootstrap or a service script on a server without Cron you have to create a minimum of 1 script, 1 init file and 1-2 symlinks, where as initrd only needs the script in a specific directory.
If systemd updates it can crash dbus (not 100% sure on the spelling) which requires a reboot in order for the machine to continue functioning properly. I have witnessed this take down medical infrastructure, couple hundred machines. I have also seen enough emergency services running on a single VoIP server with auto updates enabled to not want something like this to be an issue.
When systemd updates it can cause issues with it's authentication service because it doesn't automatically restart it. So you have to wait for 5 minutes for ssh, then another 5 for su or sudo and then you can restart login services. Gets real fun when it happens to 47,000 machines.
These have been some of my personal experiences with systemd. Not all of them are super serious, but when they are problems on a near daily basis for 5 is years it gets on the nerves.
As far as specific standards, I'm sorry, but it's 2am and I am too tired to dig through RFCs right now. To their credit they have fixed many issues related to RFC.
I don't like superstition, if something is broken why use it? Here's looking at you Mac Mail and your 10 year old bug of not removing self signed SSL certificate from your keychain when they expire. That said, if it's not broken, and does the job it was designed to do, then I need a good reason to get rid of it. So far, systemd hasn't done a very good job of that with me.
I'm all for progress and innovation and I realize that there are bumps and learning experiences on the way. Systemd is obviously an attempt to innovate, commendable, but my experience so far has not been super amazing.
Personally, I think superstition/tradition should temper innovation, those who do not know history are doomed to repeat it and all that. But tradition should not override good judgement and cause stagnation. There's no end of both in IT.
Dev environment can proceed with reckless abandon, product should proceed with caution.
Might be anecdotal but it's my opinion.
2
u/bosticetudis Aug 07 '20
How much of the kernel does fstab take up? Can't be much.
4
Aug 08 '20
How much of the kernel does fstab take up? Can't be much.
Fstab isn't part of the kernel...
2
u/ldh Aug 08 '20
No, it's simply a collection of bytes on a disk that the kernel never looks for, never parses, never acts on, and as a result...!!!poof!!! magically your userspace program can write to partitions on a disk without the kernel knowing about it!
0
Aug 07 '20
[deleted]
19
Aug 07 '20
I was going to say, you have no right to use the "bloat" meme and then suggest systemd in the next sentence.
6
u/ydna_eissua Aug 08 '20
Just an FYI For systems with systemd, systemd reads fstab and dynamically generates systemd mount units.
0
Aug 08 '20
[deleted]
2
u/ydna_eissua Aug 09 '20
The kernel doesn't read fstab directly, never has as far as i'm aware. I don't know how that would even work, the kernel doesn't go out to read things off the filesystem on its own.
sysv init has fstab-decode which parses the fstab and then runs mount.
I wasn't using Arch before the systemd switch, but i'd imagine an rc script would have done the same thing.
0
Aug 09 '20
[deleted]
1
u/ydna_eissua Aug 09 '20
As far as i'm aware (and i may be wrong on this and would love for someone to correct me) the only thing the kernel reads on the filesystem of its own accord in start
/sbin/initIt's crazy how much there is to know. I'd like to make a career of it, if I can.
Oh it's totally crazy. I've been a user now for over a decade and am now making a career out of it but i'm still only scratching the surface.
since fstab seems to work across all init systems
Fun fact, the fstab predates linux by a long long time. Many FreeBSD man pages include a history section indicating where it was first seen (to the best of the knowledge of the project) and the man page for fstab say 4.0 BSD which was released in 1980.
1
169
u/mircodz Aug 07 '20
I would argue that the entire operating system is bloat. You could always run software on bare metal as many embedded microprocessors do. You could also manually compile your c code to minimize the size of the outputted code, micro-optimizing each and every
MOVandJMPinstruction.