Find the power supply hardware information for a PC using Ubuntu's command-line
Solution 1
You can't. The plug between the power supply and the mainboard follows the ATX specification, which regulates which signals and which voltages shall be present.
Com
is common, or ground. The rest of the pins are used for voltages, or simple binary signals, like PS_ON
and PWR_OK
. There is no bus data transfer pins. The operating system simply has no way of knowing anything about the power supply.
Some server systems come with sensors in the power supply. Such sensors should show up in lmsensors
. For instance it's quite common that they will report power consumption, fan speed and temperature. But in this case, you should specify which system you have - as this is typically not seen in normal PC's.
Other power supplies may include a monitoring interface over USB. What data they will provide will differ from power supply to power supply. To check if the PSU in question provides this, run lsusb
and look for something that resembles a power supply. This may include model, or simply be generic for an entire class of different power supplies.
Solution 2
To find the power supply information, use following command:
sudo dmidecode --type 39
The below command outputs a lot status and statistical information about the battery. The /org/... path can be found with the command upower -e (--enumerate).
upower -i /org/freedesktop/UPower/devices/battery_BAT0
The one I use mostly is this one :
sudo apt-get install lm-sensors
sudo sensors-detect
Choose YES to all.
sudo service kmod start
Use :
sensors
or
watch sensors
Solution 3
Software interface to Power Supply
As mentioned in the top voted answer a special communication channel to the Power Supply is required. On my laptop there is a USB 3 self powered hub connected to the UPS (Interruptible Power Supply). Although you don't have this type of power supply the communication concept would be similar:
$ sudo pwrstat -status
The UPS information shows as following:
Properties:
Model Name................... CP550HGa
Firmware Number.............. BFBB104#BI1.g
Rating Voltage............... 120 V
Rating Power................. 330 Watt
Current UPS status:
State........................ Normal
Power Supply by.............. Utility Power
Utility Voltage.............. 121 V
Output Voltage............... 121 V
Battery Capacity............. 100 %
Remaining Runtime............ 33 min.
Load......................... 72 Watt(22 %)
Test Result.................. Unknown
Last Power Event............. None
The current load is 72 Watts and the maximum load is 330 watts.
Installing pwrstat
To install pwrstat
go to the Cyber Power Systems website Linux Software page. You will find 32-bit and 64-bit downloads available for all Linux distro's but make sure you select the one for Debian (.deb
) which Ubuntu is based on.
After downloading install it using:
sudo dpkg -i powerpanel_132_amd64.deb
To learn more about using pwrstat
use:
man pwrstat # to learn more about the terminal interface
man pwrstatd # to learn about background daemon with alarms, auto shutdown, etc.
What to do when there is no software
The old tried and true method is to look at the safety label on your power supply. By law in most countries this label must exist. For my old laptop it is as easy as looking at the power brick. For your desktop PC it may be on the back or you might have to open it up and look inside:
The label shows:
- Output 130 Watts (Watt=Volt x Amp)
- Input 100-240 VAC ~ 2.5 Amps, 50-60 HZ
- Output 19.5 Volts ~ 6.7 Amps
What to do when you can't look at the hardware
You could get someone who is on site to take the picture for you. If that isn't viable get the make and model of the computer and google the power supply specs. From this article the generic specs for PCs are:
- Small Form Factor - 15A (250W)
- Mini-Tower - 25A (300-350W)
- Mid-Tower - 35A (400-500W)
- Full Tower - 40A (600-650W)
- Dual Video Card (SLI) - 50A (750W+)
Note the amperage is specified for 12 Volt rail output. So 15A = 180 watts and 50A (For dual video cards) = 600 watts. Wattage = Amperage * Voltage.
Solution 4
The one I know is lshw
, the class you're interested in is most certainly power
. On my system it outputs the battery's specs only though:
$ sudo lshw -c power
*-battery
product: 45N1111
vendor: SONY
physical id: 1
slot: Front
capacity: 23200mWh
configuration: voltage=11.1V
As the answer to Get information about my PSU suggests mains units usually don't have a data bus to deliver such information, so sadly this may very well be the best one can do. To my knowledge, /sys/class/power_supply/AC
contains all information about your mains unit that is available to the system.
Further reading:
Solution 5
As indicated by the other good answers here, your issue is situation dependant. You would need more information than you appear to have. At the very least I would think you would need a picture of the existing power supply specification label (or some other reliable reference to make and model. The only way I have ever been able to successfully upgrade a PSU required the following:
1) Physical access to the system in question.
2) A screwdriver
3) A qualified replacement power supply. (A decent Power Supply calculater is useful in determining requirements.)
Edit: if this comment accurately reflects your problem, then Step 3 and the output from sudo lshw
should be all you need to determine if your PSU meets specifications (Assuming you know exactly what you installed and have or can obtain it's specifications). Of course you could also manually add up the power draw of the individual components, but I think using the PS calculator will be easier. As a rule of thumb I like my power supplies output to exceed requirements by 10% or better in order to allow for the possibility of a component drawing more than specified, but erring on the side of caution is a personal choice.
Amir
Updated on September 18, 2022Comments
-
Amir over 1 year
Is there a tool to print the power supply information, such as brand/model name and maximum (supported) output voltage? I need to add a second GPU and I would like to make sure it does support the extra voltage.
P.s: I already installed a secondary GPU when I had the access and I rushed outside the server room. When I later checked, the second GPU was not recognized (now that I don't have the access anymore!! :P) I wanted to make sure if the problem was the lack of power voltage as the GPU was working on another machine and is not faulty.
Currently, I don't have physical access to the PC currently (ssh only).
I have tried to see other posts, also the other exisiting tools, i.e.,
sudo dmidecode -t 39
,sensors
, andipmitool
, but none of them show the information I'm looking for.-
Elder Geek about 6 yearsYou have my apologies, but I'm having trouble understanding how on earth you are going to install a second GPU in a system that you don't have physical access to.
-
Amir about 6 years@ElderGeek, I already installed that when I had the access and it is not recognized (now that I don't have the access anymore!! :P) I wanted to make sure if the problem was the lack of power voltage.
-
-
dessert about 6 yearsThe only information I get from
dmidecode --type 39
isSMBIOS 2.7 present.
, which doesn't really help here, but that may be system-specific.upower
is great! -
Amir about 6 years@An0n, None of them is useful to get the information for the PC.
dmidecode --type 39
is equal todmidecode --t 39
and I tested it before. -
WinEunuuchs2Unix about 6 years
upower -i /org/freedesktop/UPower/devices/battery_BAT0
is about a laptop's battery. PC's don't have batteries (other than watch battery for real time clock). I believe the OP's question is about a PC and the Power Supply it has. Not about a battery. -
An0n about 6 yearsIt does show other info then battery.
-
dessert about 6 yearsWow, so much confusion! On my system
upower -e
also listsline_power_AC
, which is probably the right thing. However,upower -i /org/freedesktop/UPower/devices/line_power_AC
again shows nothing really useful:has statistics: no
-
WinEunuuchs2Unix about 6 years+1 for picture but I'm curious why red isn't always
+
and black isn't always-
ofcom
??? -
vidarlo about 6 years@WinEunuuchs2Unix It denotes the notched pins. Some of the pins have square shrouds, others have chamfered shrouds. upload.wikimedia.org/wikipedia/commons/e/ee/… shows this.
-
Elder Geek about 6 years@Amir Updated answer based on this comment. Cheers!
-
Elder Geek about 6 yearsI guess you'd have to define "Normal PC's" for me as I always build my own, however dmidecode has always provided as least some information for me. Even with inexpensive off-the-rack power supplies. See my answer
-
muru about 6 yearsFWIW, neither 26 nor 29 give me anything on an Alienware Aurora R7.
-
Elder Geek about 6 years@muru My best guess regarding that would be that dell chose not to implement over-current and over-voltage protection probes in their (or at least your specific) power supplies. My newest power supplies have both. It would seem that it depends on the manufacturers implementation (perhaps which design specification they followed)
-
vidarlo about 6 years@ElderGeek This is a specific case. My answer is the general answer: The ATX standard does not include any communication between the PSU and the system. In certain cases, you may be able to get more information from more specific interfaces.
-
vidarlo about 6 years@ElderGeek Selfbuilt machine with Asus mainboard and some standard 150$ 500W PSU:
dmidecode -t 39
returnsSMBIOS 2.6 present.
I also note that your system doesn't really return much useful information. -
Elder Geek about 6 years@Vidarlo That's true. You'd get far more useful information by looking at the specifications of the power supply you purchased and the requirements of the components, which brings us full circle back to the screwdriver.. ;-) Reversed edit based on numerous reports of power supplies that don't provide the info I get.
-
WinEunuuchs2Unix about 6 years
sudo dmidecode --type 39
doesn't say much. Only three lines: 1)# dmidecode 3.0
2)Getting SMBIOS data from sysfs.
and 3)SMBIOS 2.8 present.
Can you update your answer with what should be expected instead of what I and others are getting? -
Xerz over 2 yearsThis just blew my mind. I thought at this point this sort of stuff would be commonplace, but hey, I guess it wasn't very useful to most.
-
rbaleksandar about 2 yearsThis applies only to consumer-grade PSU. Enterprise hardware (servers) is a whole different story. You can check current power consumption, detailed health stats of the PSU as well as create power plans to adjust your costs.