First Laptop Installation

Picked up a new HP Laptop with Ryzen 4700u that has AMD graphics onboard. So i installed KDE and with just a swap file. Now I’m wondering if i should have gone with Hibernation and swap. The reason i ask is because laptops typically when you close the lid want to hibernate or suspend or whatever. Not being a big laptop user and the fact that a lot of laptops don’t come out of suspend or hibernation well and you either get graphic anomalies, or black screen or garbled. This happens especially with onboard graphics due to power settings i guess. So i set the close lid setting to shutdown on KDE which works fine. Everything works including the touchpad and wifi. I only had to add acpi_backlight=vendor for the backlight control.

My swapfile shows size 524284 which i think is the hard drive size? (500GB)
I just did erase disc with swap file? What does this mean then?

Tlp is installed but i haven’t touched it as it boots fine and works fine. Starts right up, reboots, shuts down.

Just wondering if i should have done something different? I suppose hibernation can be added now? Should i leave it the way it is? Add hibernation? Reinstall with a different set up?

Just asking for some feed back. This laptop is like an ultrabook. Very thin very light, 14" full HD screen. The fan does speed up a bit when you push it.

[ricklinux@eos-kde ~]$ inxi -Fxxxa --no-host
System:    Kernel: 5.9.14-arch1-1 x86_64 bits: 64 compiler: gcc v: 10.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=df7f4bc6-98b4-4161-838c-c1b4d887eb43 rw quiet 
           acpi_backlight=vendor loglevel=3 nowatchdog 
           Desktop: KDE Plasma 5.20.4 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM Distro: EndeavourOS 
Machine:   Type: Laptop System: HP product: HP Laptop 14-fq0xxx v: N/A serial: <superuser required> Chassis: type: 10 
           serial: <superuser required> 
           Mobo: HP model: 87B8 v: 37.18 serial: <superuser required> UEFI: AMI v: F.12 date: 07/03/2020 
Battery:   ID-1: BAT0 charge: 40.7 Wh condition: 40.7/40.7 Wh (100%) volts: 13.1/11.6 model: Hewlett-Packard Primary 
           type: Li-ion serial: N/A status: Full cycles: 365 
CPU:       Info: 8-Core model: AMD Ryzen 7 4700U with Radeon Graphics bits: 64 type: MCP arch: Zen 2 family: 17 (23) 
           model-id: 60 (96) stepping: 1 microcode: 8600104 L2 cache: 4 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 31959 
           Speed: 1397 MHz min/max: 1400/2000 MHz boost: enabled Core speeds (MHz): 1: 1397 2: 1397 3: 1397 4: 1397 5: 1397 
           6: 1397 7: 1397 8: 1397 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB filling 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Renoir vendor: Hewlett-Packard driver: amdgpu v: kernel bus ID: 03:00.0 
           chip ID: 1002:1636 
           Device-2: Chicony HP TrueVision HD Camera type: USB driver: uvcvideo bus ID: 1-3:2 chip ID: 04f2:b6f1 serial: 0001 
           Display: x11 server: X.org 1.20.10 compositor: kwin_x11 driver: amdgpu,ati unloaded: fbdev,modesetting,vesa 
           resolution: <missing: xdpyinfo> 
           Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 03:00.1 
           chip ID: 1002:1637 
           Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Hewlett-Packard 
           driver: snd_rn_pci_acp3x v: kernel alternate: snd_pci_acp3x bus ID: 03:00.5 chip ID: 1022:15e2 
           Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 03:00.6 chip ID: 1022:15e3 
           Sound Server: ALSA v: k5.9.14-arch1-1 
Network:   Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter vendor: Hewlett-Packard driver: rtw_8822ce 
           v: N/A modules: rtw88_8822ce port: f000 bus ID: 01:00.0 chip ID: 10ec:c822 
           IF: wlan0 state: up mac: 20:4e:f6:1a:40:db 
Drives:    Local Storage: total: 476.94 GiB used: 10.62 GiB (2.2%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Toshiba model: KBG40ZNV512G KIOXIA size: 476.94 GiB block size: 
           physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: 80RPH7RRQ9D2 rev: HP00AE00 temp: 27.9 C 
Partition: ID-1: / raw size: 476.64 GiB size: 468.16 GiB (98.22%) used: 10.62 GiB (2.3%) fs: ext4 dev: /dev/nvme0n1p2 
           maj-min: 259:2 
           ID-2: /boot/efi raw size: 300 MiB size: 299.4 MiB (99.80%) used: 280 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 
           maj-min: 259:1 
Swap:      Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
           ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) priority: -2 file: /swapfile 
Sensors:   System Temperatures: cpu: 51.1 C mobo: N/A gpu: amdgpu temp: 41.0 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 225 Uptime: 43m wakeups: 798 Memory: 7.2 GiB used: 1.46 GiB (20.3%) Init: systemd v: 247 Compilers: 
           gcc: 10.2.0 Packages: pacman: 1092 lib: 261 Shell: Bash v: 5.1.4 running in: konsole inxi: 3.2.00 
[ricklinux@eos-kde ~]$ 

I ONLY have laptops. And I install normally without a swap partition. I just did an install with KDE, and I use hibernator from the AUR. It works fantastic, and it’s super simple. Install, and then just

sudo hibernator 16G

It does all the hooks, updates everything else accordingly, and you’re all set with a 16G swapfile. Change 16G to whatever size swapfile you’d like. And that’s it, you’re all done.

Nice and simple:

https://aur.archlinux.org/packages/hibernator/

1 Like

Do i have to reinstall to change what i have? Or can i fix it some how?

Saw that you have a NVMe SSD.
A swap file is more recommended rather than a swap partition.
Speaking of partitions, did you leave a 10% unformatted space at the end of the drive ?
You should, because that unused space is important for the SSD controller for maintaining speed and cells longevity.

No i didn’t! I just used the erase disc with swap file from the installer.

I. . . have no idea actually. I’ve never tried to undo a swapfile. I would assume you could fix it. I do’nt know how far into the install and customization process you are, it may be easier to just re-install. But from the Arch wiki, it looks pretty stupid simple.

https://wiki.archlinux.org/index.php/swap#Remove_swap_file

You can always shrink the partition from a live medium and solve this easily

That’s quite a bit 50GB?

Isn’t over-provisioning already taken care of by the manufacturer, as explained in this article for example

?

1 Like

I also thought i had read this before somewhere? :thinking:

1 Like

Yes, overprovisioning (for file level wear) is built into the controller automatically and will be handled as you use it. Leaving 10% at the end of the drive is good (although I don’t do it) for SLC cache performance. Keeping 10% of the drive GUARANTEED empty means you’ll never get to the point where more modern drives that use “fake” SLC cache will be without room to have cache, and thus have performance tank. Of course, you can also just make sure you never exceed 90% usage, it equates to the same thing, but 1 way you don’t have to look at it if you start getting a lot of usage since it’s already built into your partition design.

3 Likes

By whom? Never heard that before.

1 Like

I am using mostly now swap files. I just reinstalled again xfce this time using erase disk with hibernate & swap. Everything is working pretty good. Bluetooth came up automatically, wireless works, the touchpad works with tap and everything. My main concern is how the suspend or hibernate works because if there are issues with graphics not resuming then that’s a deal breaker for me. I got this laptop because i didn’t want Intel or Hybrid graphics. Radeon is known to have had some of these graphic anomalies in the early days. I have set v-blank to off and i have tried hibernate a few times and also suspend and also hybrid sleep. It wasn’t bad so i’m going to run with this and see. It’s all about getting too know the hardware. :grin:

I actually stopped using swap for the most part a few years ago on most of my systems. I also have no desire to use hibernate. Hibernate saves 1-2 seconds over powering off, powering on IMO with modern drives, so the hassle of having to have swap to use it isn’t worth it to me when most of my systems have 32GB ram.
I do have a couple systems that don’t sleep properly though, and yes, that is a HUGE hassle. Unsurprisingly, my Latitutes and Thinkpads sleep properly…my Inspiron (despite being nearly the exact same parts as the Thinkpad T495)…nope.

Not sure if I came across the following article in this very forum or elsewhere. The author arguments in favour of having at least some GB swap. Not that I understand all the technicalities, but I put it here for those interested in the question of to have or not to have swap:

2 Likes

I agree with you, except the part of not using swap at all. I’ve read some articles (one being posted by @pebcak above) that recommend not to disable swap completely as it affects system performance, even on systems with ample RAM. So I use dynamic swapfile (systemd-swap).
Shortly after system startup this is how the swap allocation looks like:
sc-201227-123559
After some heavy usage (VMs, programming IDEs), the swap file can get to around 0.7GB-2GB (most of it not getting to be used though, just being provisioned - I see sometimes 200MB-300MB used swap), even if the total RAM capacity is never hit. Apparently the system uses swap also for other purposes than to extend RAM capacity.

systemd-swap is just another of those install and forget it things, that gives you peace of mind. Mind you, it cannot be used to hibernate, but as I started this post, I agree with you that hibernation is not really a necessary thing now that nvme drives are so fast that cold boot and resume from hibernation take almost the same time. I sometimes put the system to sleep, but never need hibernation.

4 Likes

Interesting, must try systemd-swap some day.

So far I’ve been doing the same as @tlmiller76 because I have lots of RAM, and no problem has occurred because of no swap.
I also use lots of VMs simultaneously, and IDEs, but not that much multiple tabs on firefox…

3 Likes

At this interesting article from @pebcak up that redefines exactly which tool is Swap for, they said:

For laptop/desktop users who want to hibernate to swap, this also needs to be taken into account – in this case your swap file should be at least your physical RAM size.

3 Likes

swapfile is 500MB per default, you can change the size if needed:
2020-12-27_13-03

sudo swapoff /swapfile
sudo rm -f /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=512 status=progress

//change 512 to wanted size in MB//

sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
1 Like

I’ve read the same, but been (mostly) swap-free for 3+ years, and haven’t had an issue with performance yet. On my little system that has only 8GB ram, I have swap.

image