boot – How to make Ubuntu 18.04 and Visual Studios run faster?

I am new to Ubuntu Linux and just installed version 18.04 on my computer alongside Windows in dual-boot mode. However, after three weeks, Linux started to be very slow, and it will even crash a few times a day when it is not able to run my code efficiently enough. It will stop building a package completely when I run catkin build such that I am forced to switch off my laptop.

I have tried the following:

  • Looking at CPU specs with lspcu, which are good

  • Looking at the omputer make and model, gotten with the system information part of sudo dmidecode | less

  • Some of the solutions found on the following website: https://www.maketecheasier.com/linux-running-too-slow-heres-how-to-find-the-cause/. Such as: checking my CPU size (seems okay), examine CPU load with top (no process seems to be abusing my CPU usage) and check if my hard drive is overworking with iotop (it is not).

  • Examining the system with systemd-analyze blame:

            19.606s apt-daily.service
            6.913s NetworkManager-wait-online.service
            4.019s plymouth-quit-wait.service
            3.163s apt-daily-upgrade.service
            2.258s bolt.service
            1.391s snap-gnomex2d3x2d34x2d1804-66.mount
            1.354s snap-onenotex2ddesktop-13.mount
            1.352s snap-gnomex2dcalculator-826.mount
            1.337s dev-sda7.device
            1.332s snap-gnomex2dcharacters-570.mount
            1.241s snap-dub-53.mount
            1.206s snap-gtkx2dcommonx2dthemes-1514.mount
            1.172s snap-snapd-11107.mount
            1.100s snap-gnomex2dcalculator-884.mount
            1.031s snap-gnomex2dsystemx2dmonitor-148.mount
            1.013s snap-gnomex2dlogs-103.mount
             993ms snapd.service
             971ms snap-core-10958.mount
             912ms snap-code-59.mount
             911ms dev-loop4.device
             878ms dev-loop5.device
             857ms fwupd.service
             835ms dev-loop2.device
    

It seems like the upper lines are taken up a lot of time, so maybe this is a cause of the problem?

  • It should be noted that my Ubuntu running slow is mainly caused when I am using Visual Studio Code for too long – when my Ubuntu has just started, it runs fine, but after a while it gets slower and slower. I checked again with the top command the CPU usage when running a code in Visual Studio Code and it seems like maybe this causes a problem since cc1plus command runs at 99-100% CPU:

Result of top command: cc1plus running at 99-100% CPU

  • I have looked at /var/log/syslog errors as well with cat var/log/syslog | grep 'error' and the following error occurred multiple times:
Apr 16 13:48:06 jessie-HP-ZBook-Studio-G3 gnome-shell(1321): Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.bluez.Error.Blocked: Blocked through rfkill (g-io-error-quark, 36)

Other errors that occur (not as often, though) are:

Apr 16 13:48:07 jessie-HP-ZBook-Studio-G3 org.gnome.Shell.desktop(1957): (4212:4212:0416/134807.054559:ERROR:gpu_service_impl.cc(1177)) Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
Apr 16 15:11:04 jessie-HP-ZBook-Studio-G3 kernel: ( 6106.242652) traps: ocs2_controller(14048) general protection fault ip:7f96415d58da sp:7ffd54f40af8 error:0 in libocs2_centroidal_planner.so(7f96414fa000+258000)
Apr 16 15:18:21 jessie-HP-ZBook-Studio-G3 org.gnome.Shell.desktop(1957): Fontconfig error: Cannot load default config file: No such file: (null)
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    0.173308) ACPI Error: Aborting method _SB._OSC due to previous error (AE_AML_BUFFER_LIMIT) (20190816/psparse-531)
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    6.312196) EXT4-fs (sda7): re-mounted. Opts: errors=remount-ro
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    6.736341) hp_accel: probe of HPQ6007:00 failed with error -22
Apr 16 16:36:59 jessie-HP-ZBook-Studio-G3 snapd(1048): stateengine.go:150: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: dial tcp: lookup api.snapcraft.io: no such host
  • Finally, I went to the folder /var/crash and look for files there (ls -a), however, no files are found, the only thing my terminal displays are dots: . ..

Anyone who has any idea where to look for the cause of these crashes when running code, and if the main cause is my Ubuntu / dual boot or Visual Studio Code? I am sorry for stating such an unclear general question. If anything else is needed I’ll provide it.

linux – 2 /boot, 1 grub and EFI

I have two partitions that serve as /boot for their respective Linux distributions. Grub “runs” out of one /boot partition and I need a menuentry that enables boot from the the other /boot

Currently I have,

menuentry "Ubuntu (5.8.0-49-generic)" {
        search --no-floppy --fs-uuid --set=root afe5152a-56f5-4e13-b215-06533f3ba6d5
        linux /vmlinuz-5.8.0-49-generic root=UUID=a62e0718-10c6-4224-8097-3a3f6c780070 ro rd.luks.uuid=luks-03d97a82-4ec5-4824-8fc3-a3b5eb38d4f9 rhgb quiet
        initrd /initrd.img-5.8.0-49-generic
}

The partitions are,

  • afe5152a-56f5-4e13-b215-06533f3ba6d5 – The second /boot
  • 03d97a82-4ec5-4824-8fc3-a3b5eb38d4f9 – The second /

It complains that I must first load the kernel.

How to I get it to boot the appropriate /boot/ and kernel?

disk utility – How to use internal HDD as a file sharing drive if I boot from external SSD on mac mini?

I’m running Mojave 10.14.6 on mac mini late 2014.

It has internal hdd drive. I bought an external ssd to speed things up and run everything from it, and use internal hdd as a data storagetime machine

I installed OS on ssd and am running the mac from it, but I can’t seem to erase the internal hdd drive. When trying to partition it in Disk utility I’m getting an error

The volume “osx” on disk1s1 couldn’t be unmounted because it is in use by process 82 (securityd)

After this error happened, disk utility shows that hdd has two partitions, 500gb each (that’s how I set it up on ‘partitioning’ step), but I can see only the partition that was there before, no new partition that I added. Might sound confusing – please see the screenshots here.

Now, I’m very sure that I run OS from external SSD, so I don’t understand why any process would use internal hdd and what should I do from now on.

So the question is, how do I use internal hdd as a data storage drive, and erase the OS from it?

dual boot – GRUB multiboot more than one copy of windows (UEFI)

I’ve been running a UEFI boot configuration for a while using GRUB menu, Ubuntu and two copies of Windows 10.
To boot to Windows 10 I have to select Windows from the GRUB menu, and then I go to the Windows BCDEdit menu where upon I am asked to select which copy of Windows 10 OS I want.

If I select the first Windows 10 OS, it boots straight into the operating system. However if I select the second Windows OS, it reboots the PC, then I have to select Windows from the GRUB menu again, and then it boots straight into the second Windows OS just fine.

Now I understand this is perfectly normal behaviour with UEFI, but I wonder if there is a way to bypass the GRUB menu only in this second Windows 10 boot scenario nowadays?

Is it possible to make Ubuntu 18.04 boot faster (with dual-boot with Windows)?

I am new to Ubuntu Linux and just installed version 18.04 on my computer alongside Windows in dual-boot mode. However, after three weeks, Linux started to be very slow, and it will even crash a few times a day when it is not able to run my code efficiently enough.

CPU specs, gotten with lscpu are the following:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               94
Model name:          Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Stepping:            3
CPU MHz:             818.267
CPU max MHz:         3500,0000
CPU min MHz:         800,0000
BogoMIPS:            5199.98
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            6144K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d

Computer make and model, gotten with the system information part of sudo dmidecode | less:

        System Information
        Manufacturer: HP
        Product Name: HP ZBook Studio G3
        Version:  
        Serial Number: CND6485KZZ
        UUID: CD87AE8C-BAC1-11E6-83D4-42B2BE0C2079
        Wake-up Type: Power Switch
        SKU Number: T7V83ES#ABH
        Family: 103C_5336AN

Things I tried so far are some of the solutions found on the following website: https://www.maketecheasier.com/linux-running-too-slow-heres-how-to-find-the-cause/. Such as: checking my CPU size (seems okay), examine CPU load with top (no process seems to be abusing my CPU usage) and check if my hard drive is overworking with iotop (it is not). Someone also suggested checking my bios version, which is the following:

N82 Ver. 01.45

I have no idea if this is the newest version, but I have googled a bit on updating my Bios version and with a dual-boot it seems like something that can go wrong easily. Since I do not have a lot of knowledge on this, I didn’t want to take the risk not knowing if this is even causing the problem.

Another thing I found on this forum (Is it possible to make Ubuntu 20.04 boot faster?) is examining the system with systemd-analyze blame:

          19.606s apt-daily.service
          6.913s NetworkManager-wait-online.service
          4.019s plymouth-quit-wait.service
          3.163s apt-daily-upgrade.service
          2.258s bolt.service
          1.391s snap-gnomex2d3x2d34x2d1804-66.mount
          1.354s snap-onenotex2ddesktop-13.mount
          1.352s snap-gnomex2dcalculator-826.mount
          1.337s dev-sda7.device
          1.332s snap-gnomex2dcharacters-570.mount
          1.241s snap-dub-53.mount
          1.206s snap-gtkx2dcommonx2dthemes-1514.mount
          1.172s snap-snapd-11107.mount
          1.100s snap-gnomex2dcalculator-884.mount
          1.031s snap-gnomex2dsystemx2dmonitor-148.mount
          1.013s snap-gnomex2dlogs-103.mount
           993ms snapd.service
           971ms snap-core-10958.mount
           912ms snap-code-59.mount
           911ms dev-loop4.device
           878ms dev-loop5.device
           857ms fwupd.service
           835ms dev-loop2.device

It seems like the upper lines are taken up a lot of time, so maybe this is a cause of the problem. The final thing that should be noted is that my Ubuntu running slow is mainly caused when I am using Visual Studio Code for too long – when my Ubuntu has just started, it runs fine, but after a while it gets slower and slower. I checked again with the top command the CPU usage when running a code in Visual Studio Code and it seems like maybe this causes a problem since cc1plus command runs at 99-100% CPU:

Result of top command: cc1plus running at 99-100% CPU

I am sorry for not stating a clear question or problem cause, but I do not have any idea what might be the problem. If anything else is needed I’ll provide it.

system installation – Why does my freshly created on Windows bootable ubuntu USB stick not boot?

Feeling very frustrated after much effort failing to get a freshly (created on Windows) bootable ubuntu USB stick to boot. I hope you can help. I am new to ubuntu. I did install it once a long time ago on a USB stick on an old machine and had no problem that time. Then I did not use it. Now I am trying years later, to install ubuntu on a USB stick for the second time. At this early stage in my experience I prefer to have ubuntu installed on USB stick rather than disk.

This is a brand new (to me) Acer Aspire 3 laptop. I follow the procedure laid out in https://ubuntu.com/tutorials/create-a-usb-stick-on-windows. Downloaded file ubuntu-20.04.2.0-desktop-amd64.iso and rufus version 3.13.1730.

Tried all the permutations I could see of the settings rufus offered to make a bootable USB. There was no suggestion of error during that process. Each attempt appeared to have built a healthy USB with a meaningful population of files, etc. I could see this when I explored the USB file folders in Windows. When I restart the pc to boot from USB, it hangs somewhere during the loading process. The pattern of failure is the same in each case. Here is the scenario…

For each option set with (or without) secure boot disabled,
with USB drive as #1 in order for boot device,
with a freshly created bootable USB stick in USB 3.0 drive,
I click to Restart (or power on)

(I numbered the steps here to show sequence)

Screen says …
(1) “restarting” (if I clicked Restart)
(2) black screen
(3) “acer” logo
(4) black screen
(5) “GNU GRUB version 2.04” (and a menu of GRUB startup options)
(6) black screen
(7) “acer” logo and “ubuntu” logo
(8) ubuntu says “checking disks” (I let the disk check complete)
(9) ubuntu says “no errors found”
(10) the ubuntu spinner icon spins for about 43 seconds and then stops spinning
(11) (we seem to be hung at this point)
(12) while the spinner was active, the cpu fan was working (suggesting something was happening)
(13) a couple seconds after the spinner stopped, the cpu fan also stopped
(14) the screen is not black, it still has the frozen spinner icon
(15) wait a LONG time, just in case it comes to life, but it does not
(16) we are hung, get no response to Ctrl-C or Ctrl-Alt-Del or any other key
(17) only option now is to power off, remove USB stick, power on
(18) normal Windows restart

I looked at the options on the GNU Grub start menu. “c” and “e” seem to show some stuff that I could try, if only I knew what the parameter names mean. Is there something like a trace or debug option to give more info while the spinner is spinning? That would be great, but probably asking too much. At the Grub> prompt I can hit Esc to jump back to the menu and move forward to hang as before, or I can type exit and the screen will clear. What happens next depends… if I have secure boot enabled i will see a fancy logo with “Security Boot Fail” and if I recall correctly I can then use Ctrl-Alt-Del to go for another restart. When secure boot is disabled, Grub>exit takes me to a normal windows boot from disk.

These are the option sets I tried in Rufus to create the bootable USB:

  1. “MBR”, “BIOS or UEFI”, “FAT32”
  2. “GPT”, “UEFI (non CSM)”, “FAT32”
  3. “GPT”, “UEFI (non CSM)”, “NTFS”
    These were written as ISO file or as DD image.
    Exact same result every time.

With set 3. “GPT”, “UEFI (non CSM)”, “NTFS” rufus warned “you must disable secure boot”. None of the other permutations said that. I disabled secure boot in UEFI firmware settings but it made no difference.

Help please?

iMac 5k (2017) does not always boot when connected to UPS

Ill start by saying that this particular imac is mainly for music production so it only goes online for software updates if not its always offline. I’m currently on high sierra as it is very stable for all my music stuff.

I bought an EATON 5S 1500VA about 4 months ago and twice now out of nowhere the iMac did not boot when connected to the UPS unless i change in which socket it’s plugged (there are 8 sockets total..4 surge protected and 4 with battery).

It was connected to the battery socket number 1 and it worked fine until suddenly it did not boot anymore, so i plugged it in battery socket number 3 and it worked…then today it did not boot again on socket number 3 so i plugged it in socket number 2 and it booted. Both time this happened i immediately tried connecting directly bypassing the UPS and both time the mac started fine.

Now you would think its a problem with the UPS except that my old 2009 mac pro boots on all 4 sockets everytime i’ve had that problem.

I switched the UPS off, disconnected everything before connecting everything again but its still the same…i really don’t know what to do…

Hope someone here may have an idea of what the heck is going on and can guide me.

Thank you

boot – Ubuntu VirtualBox VM

Whenever I try to create a VM of ubuntu, I can always boot into the ubuntu installer. But as soon as I click install, no matter the option I end up with a black screen and a blinking cursor. No matter how long I wait, nothing will happen. It happens on every distro I have tried. Except for Kali Linux, then it just goes to a black screen with no blinking cursor. I am so lost and I just want to use ubuntu 🙁

usb – Boot Linux from stick in Termux

This question explains in detail why it’s basically impossible to boot Linux from a USB stick.

But I am still wondering: is it possible to load and “boot” a stick-bound Linux distro from a USB stick using the Termux terminal app? It can already access files from sticks and run other distros like Arch, so I’d imagine it to be quite possible.

I’m open about the specifics. I’ll take whatever distro works.

The idea is to setup a stick-bound persistent Linux instance for specific tasks. I want to run this Linux both on PC and android through the same USB-Stick, although I’d settle for an android-only solution at this point.