Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, September 22, 2016

intel drm driver issue and disk slowness fix in ubuntu / xbuntu 16

If you are running xubuntu of ubuntu and have a intel graphics card then the drivers are a bit broken.. This causes general slowness and the apperance of constant disk accesses and it seems to show most often after suspension wakeup.

You can confirm the issue by tailing dmesg:
dmesg -w

Your watching for this kind of message:
[20474.916101] ------------[ cut here ]------------
[20474.916133] WARNING: CPU: 3 PID: 999 at /build/linux-a2WvEb/linux-4.4.0/drivers/gpu/drm/drm_irq.c:1326 drm_wait_one_vblank+0x1b5/0x1c0 [drm]()
[20474.916135] vblank wait timed out on crtc 0
[20474.916136] Modules linked in: uas usb_storage nls_iso8859_1 mmc_block udf crc_itu_t drbg ansi_cprng ctr ccm i2400m_usb i2400m wimax intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp arc4 iwldvm uvcvideo kvm_intel kvm videobuf2_vmalloc videobuf2_memops mac80211 videobuf2_v4l2 videobuf2_core irqbypass v4l2_common videodev crct10dif_pclmul crc32_pclmul iwlwifi aesni_intel media snd_hda_codec_hdmi aes_x86_64 snd_hda_codec_realtek lrw snd_hda_codec_generic gf128mul snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq joydev glue_helper ablk_helper cryptd input_leds serio_raw snd_seq_device toshiba_acpi snd_timer sparse_keymap cfg80211 snd soundcore toshiba_bluetooth wmi toshiba_haps mei_me mei lpc_ich shpchp mac_hid tpm_infineon ip6t_REJECT
[20474.916188]  nf_reject_ipv6 nf_log_ipv6 xt_hl ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ipt_REJECT nf_reject_ipv4 nf_log_ipv4 nf_log_common xt_LOG xt_limit xt_tcpudp xt_addrtype nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack ip6table_filter ip6_tables nf_conntrack_netbios_ns nf_conntrack_broadcast nf_nat_ftp nf_nat nf_conntrack_ftp nf_conntrack iptable_filter ip_tables x_tables parport_pc ppdev lp parport autofs4 i915 psmouse i2c_algo_bit drm_kms_helper ahci syscopyarea sysfillrect libahci sysimgblt fb_sys_fops drm sdhci_pci e1000e sdhci ptp pps_core video fjes
[20474.916224] CPU: 3 PID: 999 Comm: Xorg Not tainted 4.4.0-36-generic #55-Ubuntu
[20474.916226] Hardware name: TOSHIBA dynabook R731/36EB/Portable PC, BIOS Version 3.60   01/24/2012
[20474.916228]  0000000000000286 00000000aa071208 ffff8800a46dbb08 ffffffff813f13b3
[20474.916231]  ffff8800a46dbb50 ffffffffc00cfb38 ffff8800a46dbb40 ffffffff810810f2
[20474.916234]  ffff88014a605000 0000000000000000 0000000000000000 00000000000e0368
[20474.916237] Call Trace:
[20474.916245]  [] dump_stack+0x63/0x90
[20474.916251]  [] warn_slowpath_common+0x82/0xc0
[20474.916254]  [] warn_slowpath_fmt+0x5c/0x80
[20474.916259]  [] ? finish_wait+0x55/0x70
[20474.916272]  [] drm_wait_one_vblank+0x1b5/0x1c0 [drm]
[20474.916276]  [] ? wake_atomic_t_function+0x60/0x60
[20474.916311]  [] intel_atomic_commit+0x43a/0x6f0 [i915]
[20474.916329]  [] ? drm_atomic_set_crtc_for_connector+0x6f/0xe0 [drm]
[20474.916346]  [] drm_atomic_commit+0x37/0x60 [drm]
[20474.916359]  [] drm_atomic_helper_set_config+0x76/0xb0 [drm_kms_helper]
[20474.916374]  [] drm_mode_set_config_internal+0x62/0x100 [drm]
[20474.916389]  [] drm_mode_setcrtc+0x3cc/0x4f0 [drm]
[20474.916402]  [] drm_ioctl+0x152/0x540 [drm]
[20474.916417]  [] ? drm_mode_setplane+0x1b0/0x1b0 [drm]
[20474.916421]  [] do_vfs_ioctl+0x29f/0x490
[20474.916424]  [] ? __sb_end_write+0x21/0x30
[20474.916428]  [] ? vfs_write+0x15d/0x1a0
[20474.916430]  [] SyS_ioctl+0x79/0x90
[20474.916434]  [] entry_SYSCALL_64_fastpath+0x16/0x71
[20474.916437] ---[ end trace a5e017619a02b625 ]---

If your getting hung by it and dont what to shutdown you can get your system moving again by doing this:
sudo pm-suspend 

The full solution is the removal of the offending driver:
sudo apt-get remove xserver-xorg-video-intel

Sunday, April 15, 2012

Ubuntu 11.10 -- samba setup

Ok now that we have all the disk setup we need to setup samba shares that so they drives are available on the network

sudo apt-get install samba
sudo apt-get install libpam-smbpass

Then edit and update the settings
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.20120415
sudo vi /etc/samba/smb.conf

workgroup = WORKGROUP
   security = user

Then at the bottom add in your shares
[share200GB]
    comment = 200GB Share
    path = /media/biggy
    browsable = yes
    guest ok = no
    read only = no
    create mask = 0755

Keep in mind that if you give "guest ok = yes" then anyone can get in to the disk and read write etc...

Then reboot the samba server
sudo restart smbd
sudo restart nmbd

In the end I also had add an new user and force that user to be enabled as well with:
sudo useradd --home /home/remote --shell /bin/false remote      
sudo passwd remote
sudo smbpasswd -e remote

https://help.ubuntu.com/11.04/serverguide/C/samba-fileserver.html

ubuntu 11.10 -- wake on lan

After you setup the BIOS to allow wake up get the ethtool to setup the wake on lan;
sudo apt-get install ethtool

sudo ethtool eth0

Look for the Wake On settings then select one. The most common is "g"

sudo ethtool -s eth1 wol g

shutdown the machine and check that it can be woken from a wake up tool like "wakeonlan"

ubuntu 11.10 -- fixing missing mounted disks.

I have no clue why but if you put the desktop version of ubuntu in it insists on dynamically mounting and unmounting the disks as the user needs them. I want them shared in samba so I need to fix them disk mounting.

First discover all the disks that your system has with:
sudo fdisk -l
sudo blkid

It is best to use the blkid of the device this creates a more robust setup and allows for the disk to move around depending of scsi and apti booting.

One of these will be your system disk... DO NOT mess with this disk it its a sure fire way to brick the machine. The basic install partitions look like this:
Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    76068863    38033408   83  Linux
/dev/sdb2        76070910    78163967     1046529    5  Extended
/dev/sdb5        76070912    78163967     1046528   82  Linux swap / Solaris

Next rather that mess around with fstab and guess the whole thing fro scratch im going to use a GUI tool to mount the disks most of the way and clean up manually.

So to be safe we are backing up fstab first. if you brick it then boot from your install disk and copy the backup back over the top
sudo cp /etc/fstab /etc/fstab.20120412

Open the "Dash Home" (upper left) and search for "Storage Device Manager"..
Note that If you get nothing click the "More Apps" and then try the search again (the good the bad and then unity...) click it youll end up in the software center install it(the button is one the mid right). Then repeat the above step.

Now Storage Device Manager isn't bug free, the newer hard disks tend to confuse it. click each disk and confirm that the /dev/.. in the lower left corner matches to the tree layout if it does and it prompts you that your device is not mounted then go ahead and auto mount it.. it the text and display mismatch dont mess with it you can brick the machine. Also confirm that your not messing the the main system disk.

For example on my machine it confused sda1 with /dev/sbb5 ..

So once you run the tool or manually add the basic disk step you will want to mount each disk and confirm the they work. Then reboot and confirm that boot still works. Once your machine boots by that we can think about fixing permissions etc.

This page has an excellent listing of the basic options types to use to make the disk work well. https://help.ubuntu.com/community/AutomaticallyMountPartitions#Systemwide_Mounts


Ubuntu 11.10 -- fixing grub

Gezz can they screw the system up even worst.. now we have a graphical grub that is not 100% compatible with all monitors. To disable this mess.

 GRUB_TERMINAL=console
 GRUB_CMDLINE_LINUX_DEFAULT="text" 

Then run:
 update-grub

And reboot. Now we should have text and problems on boot will clearly visible.... amazing!

Ubuntu 11.10 -- renaming the machine

God knows why but the install appends a mess of crud to the end of the machine name to fix this in a GUI) edit the hostname and replay it with something saner

sudo vi /etc/hostname

Ubuntu 11.10 -- VNC screen not updating fixes


This time around im combining all my various servers into one. And i had the brilliant idea to update to Ubuntu 11.10 in the progress. This was a massive mistake. Unity is buggy as hell

First step setup VNC. This is simple (or should be)

1. First create a user that autologs in,
2. in that user hit the "Dash home" in the upper left of the unity menu.
3. Enter "desk" in the search box and find the "Desktop sharing" app and open it
4. check the "Allow other users to view", "Allow other users to control"
5. uncheck the "You must confirm..."
6. check the "Require the user to enter this password" and punch in a password
7. save it

Now that dead simple... but it doesn't work! The key issue is the stupid eye candy. So log out(from the upper right cog menu) and get to user login menu.

On select automatic login users account and click the cog select "unity 2D" to disable the pointless eye candy and then login. Now VNC will connect and the the screen will update.

On a side not you might what to disable more the crud like backgrounds etc. so that the connection is faster and lighter.


Saturday, November 13, 2010

sygnery - ubunutu mouse/keyboard sharing with a Mac-- bootup

Find, download and install the sygnery client(mAC) and server for the respective machine

Note that the machine names will need to be replace with whatever yours are mine are:
mac-mini.local
ubuntu-desktop

################### CLIENT (MAC OSX) #####################
For the mac client. (IE not using the mac mouse or keyboard)
mkdir ~/LoginItems
cat > ~/LoginItems/start_synergy.command 
/Applications/synergy/synergyc -f 

Then in Settings -> Accounts -> select the user -> login items
Add the .command file as a terminal shell script.


################### SERVER (UBUNTU) #####################

For the ubutu server. (IE not using the ubuntus mouse or keyboard, on a remote)

vi .synergy.conf

Add the lines
section: screens
ubuntu-desktop:
mac-mini.local:
super = alt
alt = super
end
section: links
ubuntu-desktop:
right = mac-mini.local
mac-mini.local:
left = ubuntu-desktop
end

Assuming your a bash user
vi .bashrc

Add the lines
sysergys_exec=`ps -A | grep synergys`
if [ "$sysergys_exec" = "" ]
then
synergys 
fi

Then restart(only really need to logout/login) and see what happens.

You could run the server globally from your xwindows config or even from start up but i prefer to have it in my bash where i can get at it and modify it easier.

Sunday, May 3, 2009

Ubuntu virtual screen size

Clearly since im a workaholic I have build my own home servers. I run ubuntu 8(hardy), basically because its the most easy linux flavour to admin. My high power systems are normally screenless and keyboardless. So manage them like every other sys admin does; with ssh -X and the builtin vnc (vino). The catch is at some point they normal are setup to use an cruddy old lcd that i have lying around and this results in screen size crunch when I vnc to it..

You dont want to shift the real size the display to cater for the bigger vnc size because if you brick the box then you might need physical access, which means dusting of that old cruddy lcd. So you make the vitural screen size bigger here is the hack...

$ cd /etc/X11
$ sudo cp xorg.conf.YYYYMMDD
$ sudo vi xorg.conf


Why use the date as YYMMDD.. basic its sortable.. forget the crazy US dates this is a computer, "ls -1" it with > 1000 files and you'll get the point....

Now Locate "Screen" section and add the Virtual line.. or the entire "Display" sections if you need to add "Display" SubSection double check existing display mode from System > Preferences > Screen Resolution

Section "Screen"
  Identifier      "Default Screen"
  Monitor         "Configured Monitor"
  Device          "Configured Video Device"
  SubSection "Display"
    Depth   24
    Modes   "960x600"
    Virtual 1280 1024
  EndSubSection
EndSection