Search This Blog

Sunday, January 20, 2013

About Centos and default kernel boot options

 We use Centos and KVM virtualization on my work place. After some time new kernel was released and the question arose "How do I set the default kernel parameters in CentOS for all existing and future kernels?"

 We found a solution for CentOS! yum uses grubby itself! (strace, thank you!) grubby has the option "--copy-default" and I think yum runs grubby with it. So only thing you should do is to add in grub.conf all kernel options you need to current default kernel and reboot. After reboot you can install new kernel!

serverfault

Wednesday, January 16, 2013

My Debian and USB memory stick

 Few days ago i bought Silicon Power USB memory stick 16Gb size.
Memory was formated to ntfs file system (mkfs.ntfs) for MS Windows compatability.
 I was very surprised when i try copy some big files (3.3 GB ) to it and my PC totaly freezed on 70-80%.

After some search in google i found solution: ehci_hcd module

#> modprobe ehci_hcd

#> rsync -av --progress /home/***/Downloads/xxx-720p.mkv /mnt/usb/
sending incremental file list
xxx-720p.mkv
  3519709784 100%   29.22MB/s    0:01:54 (xfer#1, to-check=0/1)

sent 3520139543 bytes  received 31 bytes  30477398.91 bytes/sec
total size is 3519709784  speedup is 1.00


awesome!

Monday, January 14, 2013

pic



Monday, January 7, 2013

Powersaving for Lenovo x220i

Tunes for power saving on my Lenovo x220i

You can find something usefull here: thinkwiki

Tunes from lesswatts.org

nmi_watchdog=0
pcie_aspm=force

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings

echo 5 > /proc/sys/vm/laptop_mode
# default 0

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# default 500

hdparm -B 1 -S 12 /dev/sda
# default -B 128

echo 10 > /sys/module/snd_hda_intel/parameters/power_save
# default 0

if your requirements for syslog are less strict than described above, you can
edit the /etc/syslog.conf file and add a "-" in front of this line:
   *.info;mail.none;authpriv.none;cron.none        /var/log/messages
like this:
   *.info;mail.none;authpriv.none;cron.none        -/var/log/messages

/sys/class/scsi_host/

echo auto > /sys/bus/pci/devices/0000:00:00.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:02.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:16.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:19.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1a.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1b.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1c.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1c.1/power/control
echo auto > /sys/bus/pci/devices/0000:00:1c.3/power/control
echo auto > /sys/bus/pci/devices/0000:00:1c.4/power/control
echo auto > /sys/bus/pci/devices/0000:00:1d.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1f.0/power/control
echo auto > /sys/bus/pci/devices/0000:00:1f.2/power/control
echo auto > /sys/bus/pci/devices/0000:00:1f.3/power/control
echo auto > /sys/bus/pci/devices/0000:00:1f.5/power/control
echo auto > /sys/bus/pci/devices/0000:03:00.0/power/control
echo auto > /sys/bus/pci/devices/0000:0d:00.0/power/control
# default on

echo 'min_power' > /sys/class/scsi_host/host0/link_power_management_policy
# default max_performance

#echo SATA_ALPM_ENABLE=true >> /etc/pm/config.d/sata_alpm


And from amarao-san livejournal
most important:

  pcie_aspm=force
  # in grub config
  # GRUB_CMDLINE_LINUX_DEFAULT add 'pcie_aspm=force' (delimiter space)
  # update-grub
  #
  # in sysfs
  # echo powersave > /sys/module/pcie_aspm/parameters/policy
  # default performance powersave

  i915_enable_rc6=true
  # to grub config same as pcie_aspm
  # check 'i915.lvds_downclock=1 i915.semaphores=1'

  SATA link power management
  # echo SATA_ALPM_ENABLE=true >> /etc/pm/config.d/sata_alpm


  xset +dpms
  xset dpms 0 0 300

  # dpms options to .xinitrc for screen powersave


source
= Tricks and Tips to Reduce Power Consumption =

Enable ALPM:
 echo SATA_ALPM_ENABLE=true | sudo tee /etc/pm/config.d/sata_alpm

 can save ~1-2W, may cause data corruption on some hardware

Change background to a lighter colour on laptop LCD
 can save ~1%

Enable i915 rc6:
 kernel parameter: i915.i915_enable_rc6=1
 can save 25-40% on Sandybridge
 known to lockup on some machines

Enable i915 Framebuffer Compression:
 kernel parameter: i915.i915_enable_fbc=1
 LessWatts believes it can save 0.6 Watts

DRM vblank off delay:
 kernel parameter: drm.vblankoffdelay=1
 Reduces wakeup events, possibly saves power

Disable any wireless you don't need (e.g. from desktop or blacklist bluetooth)
 E.g. bluetooth, saves ~1-2W

Disable webcam
 add "blacklist uvcvideo" to /etc/modprobe.d/blacklist.conf
 can save ~1-2W
 
Use PowerTop to put the following devices into a "Good" power saving state:
 * Webcam
 * Audio
 * DRAM
 * Ethernet
 * Wifi
 * Bluetooth
 * SATA link
 * MMC/SD

PCIe ASPM
 Use Ubuntu Precise kernel - has PCIe ASPM fix in.
 Or force to powersave using kernel parameter: pcie_aspm=powersave

Laptop Backlight
 Don't use at full brightness.
 Drop to 2/3 brightness level - will save ~1W

Disable flashing cursor on gnome-terminal:
 gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_blink_mode off
 can save a few wakeups/second