Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

pm-utils?

Started by poohduck, November 20, 2017, 11:55:54 AM

Previous topic - Next topic

poohduck

I have an ssd. I don't know whether it was enabled or not, but I used systemctl to prevent suspend and hibernate from running. My questions are:

1. can I uninstall pm-utils?

2. is there a way to modify the shut down menu to get rid of hibernate and suspend?

Kind regards :)

penguin

Read this post :

[codehttps://sparkylinux.org/forum/index.php/topic,4164.msg10296.html#msg10296

also this

[ocde]https://forum.manjaro.org/t/fstab-okay-for-ssd/894/6

poohduck

Thanks Penguin. I'm ok with trim, I think :) Part of the whole ssd thing was to disable hibernate and suspend, which I've done even though I don't know whether it was enabled or not. So, I'd like to uninstall pm-utils, and if possible modify wm-logout so that suspend and hibernate no longer show, or just get rid of wm-logout and use openbox alternative? (I'm using the minimal install)

poohduck

I have modified the shutdown menu now. The only thing I'm aware of that may not be elegant is my reboot command. I have the minimal install, so using openbox as windows manager (if I understand correctly). In the shutdown menu I replaced wm-logout with the command "openbox --exit". So now when I click on computer icon I get a meu that shows Logout, Reboot and Shutdown. My concern is that if I have programs open and run the openbox --exit command, what happens to those programs? Are they shut down correctly?

I did all the above in Advanced Settings, Panel.

poohduck

I think I'm all good re the logout command I have used. I continued trying to find how to modify wm-logout and in the process it looks as though wm-logout uses this same command (openbox --exit) :) So, I have removed wm-logout :)

poohduck

Nothing is simple with this. I can search and read and try and nothing works. There isn't much info on sparky, so I look for instruction for debian. Even something that I would have though would be really simple - create a script to run trim on 2 different partitions; something I can just click on manually. Nothing works in sparky. For example, I've spent a couple of hours just trying to follow this: https://joao.machado-family.com/2014/04/01/linux-ssd-trim-setup/ to get a script to run on shutdown by putting it in /etc/rc0.d. It looks simple but just won't work. Very frustrating. How do you guys get stuff done?

penguin

I use xcfe desktop. I have modified my logout dialog that shows only LogOUT, Restart and ShutDown.

https://www.linuxquestions.org/questions/linux-desktop-74/change-logout-layout-from-xfce-871357/

I use ssd and from Power Manager or Settings Editor I can disable/change hibernate or suspend and so on.

Maybe OpenBox ,LXQT or LXDE are lighter than XCFE but I can find things easily on it.   

poohduck

#7
openbox is a windows manager as opposed to a desktop environment. From what I understand it's a lot lighter - definitely not as user friendly

penguin

Much lighter much not user friendly. You must to be a Pro :).
Try XCFE. A good balance of memory resources and what offer.Install XCFE, do not uninstall. Next time you boot in XCFE.
When you will be ready for OpenBox return back and use it.

poohduck

just trying to maximise this ancient netbook. It has atom n450 processor and originally 1gb ram new for $200 about 8 years ago. I've upped the ram to 2gb (max) and put in the ssd, which was cheap. Traditionally on windows machines I'd get rid of everything I could, minimise running processes, services etc to maximise performance AND minimise problems. I'm just carrying over that ethos to linux :) I do it on my phones too. I see a friend's new laptops and think - this shit heap would drive me nuts; it's like wading through treacle.

penguin

#10
Hi poohduck ! For You and any other that want to migrate to Linux.

Hmmmm... If you find a a cheap lenovo x201(this is great because boot natively from SD Card) , x220, x230 or T410,T420,T430 or Hp 8470p, Hp 2570p (Look at Elite hp laptops Wiki https://en.wikipedia.org/wiki/HP_EliteBook - for more info). 
But for a very good performance you should replace your hdd with ssd. For this you need :
Find/install cheap 64GB/128GB SSD and mount your hhd in a caddy as second hdd.
or
If Laptop can boot from Micro SATA SSD (read catalog/user manual book of your machine),install Micro SATA SSD intead of SSD ( Lenovo T430 maybe X230 can boot from Micro SATA SSD and you can install it on Ericson wireless slot,backside your laptop,near memory slots or on a free reserved wireless slot device - read manuals or see on Internet forums ).
or
If your Machine/Laptops that can boot from SD Card (find a cheap 16-32GB SD Card,install Linux on it, boot and Run Linux from SD Card).
Install Sparky on them and you really  amaze your friend :)

About fstrim

look here :

https://sparkylinux.org/forum/index.php/topic,4164.msg10296.html#msg10296

shortly :

https://blog.liw.fi/posts/2017/08/05/enabling_trim_discard_on_debian_ext4_luks_and_lvm/

your fstab should be changed as suggested in this forum:

https://forum.manjaro.org/t/fstab-okay-for-ssd/894/6

to see if fstrim service  is enabled use in terminal these commands

// to see what timers are active
systemctl list-timers

// to see if a service is active or enabled
systemctl is-active fstrim.service     (or just fstrim - I am farway Linux machine to verify this )
systemctl is-enabled fstrim.service  (or just fstrim - I am farway Linux machine to verify this )

//to see journal of fstrim , log activity of fstrim
journactl - U fstrim


Some tricks from my arch and debian linux distros

+++++++++++++++++++++++
Some trciks that I grabed from my text file.

// journalctl related
journalctl --boot=-0 last boot
journalctl --since "20 min ago"
journalctl --vacuum-size=500M 
journalctl -u *some service


// list timers
systemctl list-timers

//check if service is active or enabled
systemctl is-active *service
systemctl is-enabled *service


//choose a service to start or stop
sudo systemctl enabled *service
sudo systemctl start *service
sudo systemctl stop *service
sudo systemctl disable *service


// list of failed services
systemctl #failed
systemctl status systemd-modules-load # failed  to start kernel modules

find more here :

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

// list all packages and output to a file under user directory
dpkg --list >~/packages_till_$(date +%F_%T:%3N)

// simple bash file saved under /usr/local/bin  > shortcut to desktop > speedtest of your internet ine
#!/bin/sh
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
read -n 1 -s -r -p
"Press any key to continue"

or simply in terminal
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

// simple bash file saved under /usr/local/bin  > shortcut to desktop > test uour download internet speed
#!/bin/sh
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
read -n 1 -s -r -p "Press any key to continue"

or simply in Terminal
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip

++++++++++++++++++++++++++++++++++++++

How to make a file executable  and create a launcher in your desktop?

Example
+++++++++++++++++++
#!/bin/sh
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
read -n 1 -s -r -p
"Press any key to continue"
+++++++++++++++++++
1-Save all rows in a file. Lets say save file names MySpeedTest in your desktop.
2- Cope (somewhere) let's say under your file under directory /usr/local/bin by command
sudo cp MySpeedTest /usr/local/bin
3- Make it executable
sudo chmod 755 /usr/local/bin/mySpeedTest

Now create launcher in your desktop to this file.

How to run a sh (script file) file in Linux?

https://askubuntu.com/questions/38661/how-do-i-run-sh-files

For additional info for about commands just make a google search.

Hope that this helps !

poohduck

Dear Penguin, you're an awesome mentor.

Thankyou for your comprehensive answer. I didn't want to rebuild everything; pride I suppose, learning how to fix things and keep them going rather than starting from scratch again, which can go on forever because there is usually some issue.

I'm all good. Var and Home are on their own partitions. Not only that, but my original home was really /home/basil - it still is that. I copied all to a folder in sda3 named basil. Then mounted sda3 to /home - so I still have /home/basil :)

With the

trim command:

*sda1
fstrim -v /

*sda3
fstrim -v /home

*sda4
fstrim -v /var. I tested these individually then put them (as you have suggested) into fstrim.sh along with output to a log file - all looks good. There is a symbolic link to etc/init.d/fstrim.sh in rc0.d so that the commands are run on shutdown. I think this is pretty elegant, cleaning up any deletions after a session seems better than a cron job which might run when you're busy, or might not run because the system isn't on - all a bit hit / miss.

At this point, I'm happy with everything. I consider the netbook finished :) I did get rid of firefox and installed opera - I really like this browser. Have also installed opera on phones. You can actually disable ads playing videos which you can't quite do in firefox - other better options for security, tracking etc, that firefox doesn't quite stop anything really. And it's faster.

poohduck

actually, just checked out my fstrim.sh script, it hasn't been working. I came up with a more concise script that does work on the 3 different partitions and outputs the log file:

#!/bin/sh
#
#
#
#Run "fstrim" command on sda1, sda3 and sda4
LOG=/var/log/trim.log
fstrim -a -v / >>$LOG
echo "Time: $(date)" >>$LOG
exit 0

The trick is in the -a option: trim all mounted filesystems on devices that support the discard operation. Sure enough, it trims the 3 partitions (the only other partition is swap). And again, it runs on shutdown or reboot (rc0.d)

penguin

#13
I do not know how you activated your trim service. Read links I gave in the previous post, because is the faster way to activate services. Tried and by me and I confirm as successful way. Remember Unix philosophy. KISS - Keep It Simple Stupid.

poohduck

thanks penguin. I actually like my implementation of trim at shutdown or reboot. It seems more elegant to clean up anything at the END of the session rather than trying to pick a time to run it which seems a bit hit and miss (will the netbook be on at that time? Will the netbook be busy at that time? Will thers be any need to run trim at that time (you might delete heaps of stuff after the command runs).

I have refined the command again (refining), learning as I go along. I noticed that I still had a mistake in there with / (root). This is what it should be:
#!/bin/sh
#
#
#
#Run "fstrim" command on sda1, sda3 and sda4
LOG=/var/log/trim.log
fstrim -a -v >>$LOG                  (no / after the -v like I had in previous post)
echo "Time: $(date)" >>$LOG
exit 0

So basically the above just says find all file systems eligible for trim command (that's the -a). Display all the details (that's the -v). Output the results to a log file with date and time. I found the info to do this from an article - https://joao.machado-family.com/2014/04/01/linux-ssd-trim-setup/

I modified the instruction in the link. In the link the guy has the script running hourly, on start up, on shut down and on reboot. I just wanted to run it at shutdown but by putting the script in the one place (rc0.d) it runs at shutdown and reboot. This seems ideal. I have a symlink in documents to the log file so that I can check on it next time I boot in. I'm only really using the log file to confirm whether it has run or not while I was playing around with the script. It is solid now.



View the most recent posts on the forum