AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-5758

Chris Conway's questions

Martin Hope
Chris Conway
Asked: 2011-02-19 17:42:04 +0800 CST

全新电池已充电 100%,但容量为 0%

  • 8

我刚买了一块全新的电池来更换似乎已经死掉的电池。我按照电池随附的说明进行了整夜充电,然后用电池运行我的计算机,直到它处于临界状态并再次充电一整夜。现在电池似乎已充电 100%,同时容量为 0%——插入时不充电,拔出时计算机立即进入低功耗模式。

我已经取出电池并检查了触点。我已经在有电池和没有电池的情况下重新启动了系统。似乎没有任何帮助。

我不确定是否应该将这种状况归咎于电池、笔记本电脑、充电器或电源管理软件。显而易见的答案是电池,但我买了这块电池,因为另一块使用了一年的电池表现出类似的行为——我认为它已经死了,戴尔的技术人员也得出了同样的结论。我不愿意在不先探索其他解释的情况下订购另一个新电池。

我可以做些什么来诊断这个问题?

这是/proc信息:

$ cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          critical
charging state:          charged
present rate:            1 mA
remaining capacity:      0 mAh
present voltage:         9754 mV

$ cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         6600 mAh
last full capacity:      6789 mAh
battery technology:      rechargeable
design voltage:          11100 mV
design capacity warning: 660 mAh
design capacity low:     200 mAh
cycle count:          0
capacity granularity 1:  66 mAh
capacity granularity 2:  66 mAh
model number:            DELL WK
serial number:           4043
battery type:            LION
OEM info:                SMP

[更新]原来是交流适配器。我觉得很奇怪,有故障的适配器会导致充电状态在空电池上“充电”。

对于这种情况,我仍然会投票给出很好的调试策略的答案——换掉电池和适配器是显而易见的,但人们并不总是有备用电池或适配器可供使用。如下所述,戴尔实际上准备派一名技术人员到我家更换主板,这将是浪费时间和金钱。

laptop
  • 3 个回答
  • 20200 Views
Martin Hope
Chris Conway
Asked: 2010-12-13 19:19:11 +0800 CST

为什么我的 shell 脚本在没有 .sh 扩展名的情况下挂起?

  • 6

我创建了一个/usr/local/bin/suspend包含以下内容的 shell 脚本:

#! /bin/sh

# Take an optional delay parameter
if [ "$#" -gt "0" ]; then
  sleep "$1"
fi

# Put the system to sleep
dbus-send --system --print-reply --dest="org.freedesktop.Hal" \
    /org/freedesktop/Hal/devices/computer \
    org.freedesktop.Hal.Device.SystemPowerManagement.Suspend \
    int32:0

如果我chmod +x通过直接调用它来运行脚本(例如,只需键入suspend或/usr/local/bin/suspend在命令行上),什么都不会发生,并且 shell 挂起——它甚至不响应 Ctrl-C;我必须切换到一个新的 shell 并终止该bash进程(它没有明显的孩子)。

如果我通过以下任何一种方式调用它,该脚本就可以正常工作:

  • 使用sh /usr/local/bin/suspend.
  • 使用. /usr/local/bin/suspend.
  • 将其重命名为suspend.sh并调用/usr/local/bin/suspend.sh(或只是suspend.sh,因为它在 中PATH)。

最后一个选项很好,但我仍然想知道:不使用.sh扩展到底有什么问题?

scripts bash
  • 3 个回答
  • 4133 Views
Martin Hope
Chris Conway
Asked: 2010-11-19 21:37:02 +0800 CST

系统因有关硬盘的可疑消息而锁定

  • 6

我的系统开始出现异常,间歇性锁定。我在中看到如下消息syslog:

Nov 18 22:22:00 claypool kernel: [ 3428.078156] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
Nov 18 22:22:00 claypool kernel: [ 3428.078163] ata3.00: irq_stat 0x40000000
Nov 18 22:22:00 claypool kernel: [ 3428.078167] sr 2:0:0:0: CDB: Test Unit Ready: 00 00 00 00 00 00
Nov 18 22:22:00 claypool kernel: [ 3428.078182] ata3.00: cmd a0/00:00:00:00:00/00:00:00:00:00/a0 tag 0
Nov 18 22:22:00 claypool kernel: [ 3428.078184]          res 50/00:03:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
Nov 18 22:22:00 claypool kernel: [ 3428.078188] ata3.00: status: { DRDY }
Nov 18 22:22:00 claypool kernel: [ 3428.080887] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
Nov 18 22:22:00 claypool kernel: [ 3428.080890] ata3.00: irq_stat 0x40000000
Nov 18 22:22:00 claypool kernel: [ 3428.080893] sr 2:0:0:0: CDB: Test Unit Ready: 00 00 00 00 00 00
Nov 18 22:22:00 claypool kernel: [ 3428.080905] ata3.00: cmd a0/00:00:00:00:00/00:00:00:00:00/a0 tag 0
Nov 18 22:22:00 claypool kernel: [ 3428.080906]          res 50/00:03:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)
Nov 18 22:22:00 claypool kernel: [ 3428.080910] ata3.00: status: { DRDY }

然后这个:

Nov 18 23:13:56 claypool kernel: [ 6544.000798] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Nov 18 23:13:56 claypool kernel: [ 6544.000804] ata1.00: failed command: FLUSH CACHE EXT
Nov 18 23:13:56 claypool kernel: [ 6544.000814] ata1.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0
Nov 18 23:13:56 claypool kernel: [ 6544.000815]          res 40/00:00:00:4f:c2/00:00:00:00:00/40 Emask 0x4 (timeout)
Nov 18 23:13:56 claypool kernel: [ 6544.000819] ata1.00: status: { DRDY }
Nov 18 23:13:56 claypool kernel: [ 6544.000825] ata1: hard resetting link
Nov 18 23:14:01 claypool kernel: [ 6549.360324] ata1: link is slow to respond, please be patient (ready=0)
Nov 18 23:14:06 claypool kernel: [ 6554.008091] ata1: COMRESET failed (errno=-16)
Nov 18 23:14:06 claypool kernel: [ 6554.008103] ata1: hard resetting link
Nov 18 23:14:11 claypool kernel: [ 6559.372246] ata1: link is slow to respond, please be patient (ready=0)
Nov 18 23:14:16 claypool kernel: [ 6564.020228] ata1: COMRESET failed (errno=-16)
Nov 18 23:14:16 claypool kernel: [ 6564.020235] ata1: hard resetting link
Nov 18 23:14:21 claypool kernel: [ 6569.380109] ata1: link is slow to respond, please be patient (ready=0)
Nov 18 23:14:31 claypool kernel: [ 6579.460243] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Nov 18 23:14:31 claypool kernel: [ 6579.486595] ata1.00: configured for UDMA/133
Nov 18 23:14:31 claypool kernel: [ 6579.486601] ata1.00: retrying FLUSH 0xea Emask 0x4
Nov 18 23:14:31 claypool kernel: [ 6579.486939] ata1.00: device reported invalid CHS sector 0
Nov 18 23:14:31 claypool kernel: [ 6579.486952] ata1: EH complete
Nov 18 23:17:01 claypool CRON[3910]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Nov 18 23:17:01 claypool CRON[3908]: (CRON) error (grandchild #3910 failed with exit status 1)
Nov 18 23:17:01 claypool postfix/sendmail[3925]: fatal: open /etc/postfix/main.cf: No such file or directory
Nov 18 23:17:01 claypool CRON[3908]: (root) MAIL (mailed 1 byte of output; but got status 0x004b, #012)
Nov 18 23:39:01 claypool CRON[4200]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm)

23:39 之后没有任何消息被标记。当我下次尝试使用这台机器时,它不会从屏幕保护程序(空白屏幕)返回,也不会切换到另一个终端,我不得不硬重启它。

[更新] 的输出smartctl在这里。我很难得到这个,因为/它被安装为只读(?!),这会阻止大多数应用程序运行。

此外,它可能不相关,但我有以下令人担忧的消息dmesg:

[   10.084596] k8temp 0000:00:18.3: Temperature readouts might be wrong - check erratum #141
[   10.098477] i2c i2c-0: nForce2 SMBus adapter at 0x600
[   10.098483] ACPI: resource nForce2_smbus [io  0x0700-0x073f] conflicts with ACPI region SM00 [??? 0x00000700-0x0000073f flags 0x30]
[   10.098486] ACPI: This conflict may cause random problems and system instability
[   10.098487] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[   10.098509] i2c i2c-1: nForce2 SMBus adapter at 0x700
[   10.112570] Linux agpgart interface v0.103
[   10.155329] atk: Resources not safely usable due to acpi_enforce_resources kernel parameter
[   10.161506] it87: Found IT8712F chip at 0x290, revision 8
[   10.161517] it87: VID is disabled (pins used for GPIO)
[   10.161527] it87: in3 is VCC (+5V)
[   10.161528] it87: in7 is VCCH (+5V Stand-By)
[   10.161560] ACPI: resource it87 [io  0x0295-0x0296] conflicts with ACPI region ECRE [??? 0x00000290-0x000002af flags 0x45]
[   10.161562] ACPI: This conflict may cause random problems and system instability
[   10.161564] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver

[更新 2] 根据 Phil 的建议,我更换了新的 SATA 电缆。smartctl 的当前输出在这里,如果它有帮助的话。

[更新 3] 我认为电缆没有修复它。系统尚未锁定,但我的媒体播放器在几分钟前崩溃了,我在以下内容中有以下内容syslog:

Nov 20 16:07:17 claypool kernel: [ 2294.400033] ata1: link is slow to respond, please be patient (ready=0)
Nov 20 16:07:47 claypool kernel: [ 2324.084581] ata1: COMRESET failed (errno=-16)
Nov 20 16:07:47 claypool kernel: [ 2324.084588] ata1: limiting SATA link speed to 1.5 Gbps
Nov 20 16:07:47 claypool kernel: [ 2324.084592] ata1: hard resetting link

我收到以下回复smartctl:

$ sudo smartctl -a /dev/sda
[sudo] password for chris: 
sudo: Can't open /var/lib/sudo/chris/0: Read-only file system
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Device: /0:0:0:0  Version: 
scsiModePageOffset: response length too short, resp_len=47 offset=50 bd_len=46
>> Terminate command early due to bad response to IEC mode page
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
hard-drive smart
  • 3 个回答
  • 15119 Views
Martin Hope
Chris Conway
Asked: 2010-11-08 15:00:40 +0800 CST

如何在从 Gnome 面板启动的 Emacs 会话中设置环境变量?

  • 6

我的.bash_env文件设置了几个环境变量,包括PATHand EMAIL,但是在从 Gnome 面板(命令:“ /usr/bin/emacs23 %F”)启动的 Emacs 会话中,这些变量没有预期值。我以前遇到过这个问题(请参阅此博客文章)。.bash_env然后我通过在我的.xsession文件中采购来修复它。显然,这不再有效。

如果我从终端手动启动 Emacs,则变量设置正确。奇怪的是,如果我将面板启动器更改为在终端中执行 Emacs(我认为这会在启动 Emacs 之前启动 Bash),它们并没有设置。

如何确保为 Emacs 会话设置了常规 Bash 环境?

gnome-panel bash emacs
  • 3 个回答
  • 2047 Views
Martin Hope
Chris Conway
Asked: 2010-11-08 14:15:28 +0800 CST

如何在网络管理器中禁止 wifi 网络?

  • 7

我的 wifi 连接有时会掉线,出于某种原因,网络管理器会尝试连接到我邻居的网络,这需要我不知道的密码。有问题的网络没有在“编辑连接...”对话框中列出,我在任何配置文件中都找不到对它的引用,但每次我的主连接断开时,密码对话框仍然会弹出。有没有办法将无线网络列入黑名单,以便网络管理器永远不会尝试连接到它?或者,等效地,如何删除导致网络管理器尝试连接到此特定网络的配置数据?

wireless network-manager
  • 2 个回答
  • 3121 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve