Fixing Debian 10 on a desktop

Fixing the desktop Debain 10

I have this office provided desktop with me. And it has a version of Debian thats upgraded from Debina 7 to Debian 10. Frankly it's terrible at booting. Takes anywhere from a minute and half to 2-3 minutes sometimes. So I know a lot many things are broken inside. But I did not have time to take a look at the software side and just let it be. And another ting to note is, it has 16GB of RAM so once booted things run smooth.

So with quarterly release done, the workload decreased and I got some time to take a look at this thing on weekends. First thing always is to note how bad things are, get hold of some logs and just list whatever broken thngs you can see around in first glance and then go about cleaning and fixing things one by one. So like I mentioned above it takes anywhere from 1.5 minute to 3 minutes just to boot up. My goal is to get it to boot in less than a minute, since this has a HDD. I have Linux Mint and a SSD in my 7Yr old laptop and it boots in about 15-20 seconds. Really SSD's are a boon since the speed bump they provie the system is tremendous. And ideally if you have a slow system, with limited amount of RAM and a HDD, you can bump up the RAM and put in a SSD and you can see a sizeable bump in performance even with all the remaining old hardware. E.g. my old laptop comes with a Pentium B950 dual core 2.1GHz processor and still it flies around really well with 6GB RAM and this SSD.
Anyway coming back to the desktop, whats broken?
1. There's some unneeded software which I need to weed out.
2. There's a waiting for suspend/resume error.
3. There's a driver related error for rtl_nic/rtl_8169 something.
4. Systemd startup and services need to be optimized.
5. Any unneeded mounts need to be removed.

Okay. Lets start.

I installed Synaptic which is THE best package manager for Debian based Linux's. But it's not in much use these days because the distro builders want someting resembling Apple AppStore or Google Play Store. I mean yeah, they look good. But functionally, synaptic is still king of the hill. So I used synaptic and looking in Installed packages section I could see 10-15 softwares which I don't use and can be removed. A few of these has heavy startup services like PostgreSQL.
I removed all these and saved about 600MB of space and possibly few seconds of startup time.

Next waiting for suspend resume. This I learned is because of incorrect SWAP file configuration. So I opened /etc/fstab and found some unwanted entries, and incorrect SWAP entry. Fixing everything and rebooting should have solved this error. But not!! Something else is still broken. Turns out you also need to update initramfs. So edit "/etc/initramfs-tools/conf.d/resume" and remove the swapid there if you are not going to use suspend-resume or don't have swap like I do. Or put correct Swap UUID in case you have and want to use it.
And then run "update-initramfs -u"  and reboot. Yey!! That fixed this.

Next I wanted to tackle driver error but my internet went down so could not get the required driver.

So I went looking into Systemd analyse command for offending commands and critical path to check what's most broken in startup. Found a few usual things like NetworkManager.WaitOnline. Disabled few services and rebooted. Huh seems faster.

Then I again went into /etc/fstab and found some mounts for /dev/sdb1/2 but I don't have dev/sdb so removed these. And rebooted. Then I checked things with timer in my android phone, and voilla!! We are booting in ~55-60 seconds. Good.

Then I did not get any more time but till next weekend to look at the realtek driver issue. And when I got time it turned out that you need below repo:
#realtek firmware
deb http://ftp.de.debian.org/debian stretch main non-free
deb-src  http://ftp.de.debian.org/debian stretch main non-free

So I added this and then sudo apt update
and sudo apt install firmware-realtek

And reboot.

And yes, the rtl_firmware related error is gone. But I also realized that dmesg gives some permissions error. And I have never seen anything like this on Ubuntu or Linux Mint. Actually dmesg is great to quickly check out system startup and notice broken startup. In fact I swa this below line:
/lib/systemd/system/winbind.service:8: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/winbindd.pid → /run/samba/winbindd.pid; please update the unit file accordingly.

Which means samba config probably has some issue.

Anyway, first fix dmesg permission issue. Solution is :
% sudo sysctl kernel.dmesg_restrict=0
kernel.dmesg_restrict = 0

And put this in a file below to make it permenant:
$ sudo su
# echo "kernel.dmesg_restrict = 0" > /etc/sysctl.d/10-local.conf
# Ctrl + D

$ cat /etc/sysctl.d/10-local.conf
kernel.dmesg_restrict = 0
 

Done! Next thing is this samba issue! But a quick google search told me it's just a warning and should be fixed in any coming Samba updates. Okay then.

Cheers!!!

Comments

Popular posts from this blog

Morning Quotes

QCalendarWidget CSS Stylesheeting

Selecting new phone plan