Page 1 of 1
Laptop MX Linux
Posted: Wed Sep 30, 2020 7:40 am
by tone2
Hi,
I just wanted to chat about MX Linux on laptop. No real reason. To kick things off I noticed that there is no real good 'Hibernate' feature on MX linux (or is there?)
When I 'Suspend' its just like 'sleep', it's still on, like the light on my mouse is still on and if the battery runs out I lose the volatile memory, do we think MX Linux will ever add a feature or is there a specific reason why this is not the case; or is there just some additional programme you can add to fulfill this feature?
Also, side question, I made it autologin, so I don't have to enter my password on startup. However, after I come back from 'suspend' it still asks me for password to login. Is there a way to rectify this?
Cheers,
Re: Laptop MX Linux
Posted: Wed Sep 30, 2020 7:55 am
by kc1di
I'm not using xfce but kde in KDE under power management Hibernate is there and works.
I would assume that something similar would be available in XFCE. Good Luck.
(Note for Hibernations to work you need to have either a swap file or partition.
Re: Laptop MX Linux
Posted: Wed Sep 30, 2020 7:57 am
by Huckleberry Finn
Just open the Power Manager (security tab) and uncheck to lock screen after sleep.
Also those suspend / hibernate etc. are not directly MX-specific in fact, but those software like Xfce , lightdm etc ..
Re: Laptop MX Linux
Posted: Wed Sep 30, 2020 7:59 am
by tone2
Thanks for the replies on the battery aspect; I'll look into power management for XFCE.
p.s. I think I also need to research swap files.
Cheers,
Re: Laptop MX Linux
Posted: Wed Sep 30, 2020 8:01 am
by Huckleberry Finn
Meanwhile, don't worry about suspend & battery. It doesn't draw a big amount of energy. Even with this "dead" 15 y.o. battery I can leave it from night to afternoon or even longer :) (ok, maybe the mouse or external things like that.. I use touchpad only)..
Re: Laptop MX Linux
Posted: Wed Sep 30, 2020 8:32 am
by Stevo
I have hibernation working well on two 2016 and 2018 Intel-based laptops, as well as "hybrid sleep", but I think it works better with more recent kernels if MX is booted with systemd.
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 3:42 am
by tone2
Huckleberry Finn wrote: Wed Sep 30, 2020 7:57 am
Just open the Power Manager (security tab) and uncheck to lock screen after sleep.
Also those suspend / hibernate etc. are not directly MX-specific in fact, but those software like Xfce , lightdm etc ..
Hi, I have an update; and for the record I am using XFCE.
I typed: free -h and I for some reason I had 2G of Swap. Yet I have 5.7G of RAM (I assume 2G + 4G sticks)
So I typed: fallocate -l 6G /swapfile
then: chmod 600 /swapfile
then: mkswap /swapfile
then: swapon /swapfile
then in /etc/fstab I added the line: /swapfile none swap sw 0 0
then I typed: dpkg-reconfigure uswsusp
and I saw it had my /swapfile and I clicked 'Next'.
Then I rebooted and it wouldn't get passed the login screen. So I Ctrl + Alt+ F2'd in as root and removed the line from /etc/fstab
and I also deleted all the swap files. I say all because I accidentally created another just called 'swap'.
Also, just to note, when I did log back in my Konky clock was gone and the time was only displayed in the task bar, which I thought was strange.
To add confusion, I noticed that Transmission had totally filled up my SSD and there was no space left, not sure if this could have also caused the problem.
Does anyone see any glaring issue with what I did? It all seemed to go according to plan until it didn't work. Remember, not only am I new, but I'm also an idiot ;-)
I do want to try again but scared I'll destroy my OS install and lose all my browser sessions and saved tabs (I know you can back them up but I haven't had a chance how to figure out how to do it on waterfox). I do have another linux PC I can plug my SSD into, so I'm not really worried about being able to get the data off the drive.
Also note, there was already mention of a swap in the unmodified fstab file:
"UUID=6e92d1d9-ca30-42d9-9e14-c749d0f349b5 / ext4 defaults 1 1
UUID=f6fa5d86-ca03-41b8-b59e-ce427520787a swap swap defaults 0 0"
I assume this is normal though or did it also need to be modified to say 'swapfile'?
P.S. even if it did all work, would the 'Hibernate' button magically appear when I clicked the power button? Because even after the swap file is established I'm not sure how to Hibernate the system.
Thanks,
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 5:29 am
by JayM
tone2 wrote: Sun Oct 04, 2020 3:42 am
even after the swap file is established I'm not sure how to Hibernate the system.
See
viewtopic.php?f=108&t=60091&p=594725
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 7:00 am
by MXtones
As @Stevo suggested, try suspend/hibernation with systemd. If you choose the second boot option of a given kernel from the advanced boot (grub) menu (you reach grub by pressing ESC or F2 or sometimes another F-key during boot after the splash screen), the system will boot with systemd.
By the way, I don't think you're an idiot - you seem to have the right attitude to try out stuff, and in linux there's a lot of stuff to play with. As long as you keep backups of your most important data, you're bound to have a lot of fun with (MX) Linux.
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 7:06 am
by tone2
Thanks for the reply Jay/MXtones.
Actually I think I already saw that, and in fact I think it's where I got the 'sudo dpkg-reconfigure uswsusp' line from.
So all I have to do is type 'sudo hibernate'?
Did you have any opinion as to if there was anything intrinsically wrong with the approach I described in my previous post? Do you think it all actually worked as it should, but there is some grub thing I need to do
I know nothing about using systemd. I vaguely know it's an init system, but I don't know where to start reading for the appropriate information on this topic.
Thanks again!
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 7:23 am
by MXtones
Well, the linux community is somewhat divided regarding systemd. MX Linux is "systemd-ready", but utilizes sysvinit by default. If you want to know more, this is a good place to start:
https://wiki.archlinux.org/index.php/Systemd
Cheers
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 10:18 am
by tone2
MXtones wrote: Sun Oct 04, 2020 7:23 am
Well, the linux community is somewhat divided regarding systemd. MX Linux is "systemd-ready", but utilizes sysvinit by default.
Hi MXtones,
Yes I had noticed that!
Well I prefer simplicity of comprehension, I'm sure systemd is great, but I'm not after any bells and whistles, so if I can avoid it I suppose I will...until I'm more proficient at least.
If no one sees any issue then I guess I'll just re-try what I described earlier in making a new swapfile and see what happens now I've cleared 15G space on my SSD.
Cheers,
Re: Laptop MX Linux
Posted: Sun Oct 04, 2020 10:54 am
by MXtones
I've never tried to create a swapfile manually. If in doubt about the commands, manpages are your friend, which exist for a lot of commands/programs - simply type "man APPNAME", e.g.:
Gparted is the gui for "parted" which is a partition manager that you could use to create a swapfile.
The fstab entry for your swap looks correct, assuming that the UUID is correct as well.
Re: Laptop MX Linux
Posted: Mon Oct 05, 2020 7:23 am
by MXtones
So I went and set up a swapfile following this tutorial:
https://www.howtogeek.com/455981/how-to ... -on-linux/
The author advises not to use 'fallocate' for that, but 'dd' instead.
Another thing I realized is that the swapfile is just that: a file - as opposed to a partition, so one doesn't have to add an UUID in fstab (technically everything's a file in linux).
I'm still testing, but so far everything is working as expected.
You might also wanna look into this:
https://mxlinux.org/wiki/other/zram/
Re: Laptop MX Linux
Posted: Mon Oct 05, 2020 10:45 pm
by Stevo
If you do want to mess around with your system's guts, it's a good idea to make restore points with Timeshift.
In fact, it's never a bad idea to have restore points, period.
Re: Laptop MX Linux
Posted: Wed Oct 07, 2020 6:57 am
by tone2
Stevo wrote: Mon Oct 05, 2020 10:45 pm
If you do want to mess around with your system's guts, it's a good idea to make restore points with Timeshift.
In fact, it's never a bad idea to have restore points, period.
I haven't lost interest in this thread, I just haven't had a chance to get back to working it out. But I should on the weekend.
And yes, I take your point, I really need to learn how to use Timeshift.
Cheers,
Re: Laptop MX Linux
Posted: Wed Oct 07, 2020 3:59 pm
by Stevo
Timeshift has a firstrun setup wizard, so really is pretty dead simple to use. By default, it only backs up your system, not any data you have in your home or other data partitions, and it doesn't compress the files.
Re: Laptop MX Linux
Posted: Sat Oct 10, 2020 9:08 am
by tone2
I have an update....
So following the approach I previously outlined, I tried using 'sudo s2disk'. And I thought it all seemed to work however I realised every time the system started up the same things were open (folders and programmes) irrespective of what was open when I shut down. It was like it kept loading the same snapshot in time.
Then after trying a variety of things like I noticed that in /etc/uswsusp.conf the "resume device" kept changing to be set as: /dev/sda2. It is currently = dev/disk/by-uuid/f6fa5d86-ca03-41b8-b59e-ce427520787a
For some reason, which it change to itself to be.
Similarly when I type: sudo swapon --show, then it shows: /dev/sda2 partition 2G 0B -2
is still present.
But the strangest thing is that even though I've removed the modification line I previously added in the /etc/fstab file and I've sudo rm /swapfile, (so I've removed the swapfile I created) NOW EVERYTIME I RESET OR SHUTDOWN and Boot normally, it restores the system as it was when I shutdown!! That is to say what is currently open, ironically just like you would expect from a Hibernation. Its the strangest thing, I have no idea how/why it's doing it.
So I'm pretty baffled lol. Can anyone explain maybe why this is so?
Cheers,
Re: Laptop MX Linux
Posted: Sat Oct 10, 2020 10:01 am
by MXtones
Please compare the steps you've taken with the explanation given here:
https://wiki.debian.org/Hibernation/Hib ... _Partition
Re: Laptop MX Linux
Posted: Sat Oct 10, 2020 9:13 pm
by tone2
Hi MXtones, thanks for the reply.
I think it's functionally the same with the following exceptions:
(Note, this is not an exception but please note in following them I changed suwsusp.conf line back to: resume device = /dev/sda1)
I modified the resume device = /dev/sda1 into the suwsusp.conf as it was previously like SSID or something automatically (which I defined from typing:
swap-offset /swap)
Then I ran:
update-initramfs -u
And I think those are the only differences.
I will say I think running
sudo s2disk worked much better this time. However, whenever I Shutdown or Restart it still saves my session like a hibernate. Do you have any idea how or why it's doing this, and how I can turn that off? (admittedly not the worst problem in the world, kind of 'be careful what you wish for' lol).
Thanks in advance,
Re: Laptop MX Linux
Posted: Sun Oct 11, 2020 3:08 am
by MXtones
Maybe could you open a separate topic for this with your Quick System Info formatted as code, so that others can chime in on this specific issue?
Could you please also post the output of:
Code: Select all
cat /etc/default/grub /etc/uswsusp.conf
Re: Laptop MX Linux
Posted: Sun Oct 11, 2020 4:30 am
by tone2
MXtones wrote: Sun Oct 11, 2020 3:08 am
Maybe could you open a separate topic for this with your Quick System Info formatted as code, so that others can chime in on this specific issue?
Could you please also post the output of:
Code: Select all
cat /etc/default/grub /etc/uswsusp.conf
Hey MX,
No worries, the output from cat /etc/default/grub /etc/uswsusp.conf can be seen on the following forum post:
viewtopic.php?f=104&t=60923
Cheers,
Re: Laptop MX Linux
Posted: Tue Oct 27, 2020 11:04 pm
by Dugrath
I use hybrid suspend on KDE and when I was at 100% battery, it drained only 3% after I went to bed. (9ish hours) So I mean if you dont even plan on opening it for weeks it should be fine.