2012/10/26

Open-iscsi initiator



This was done on ubuntu 12.04 . Something similar with work on Red Hat, Fedora, or CentOS, by replacing e.g. apt-get with yum install.  

Prep work

Ubuntu/Debian derivatives: apt-get install open-iscsi open-iscsi-utils
RedHat/CentOS derivatives: yum install iscsi-initiator-utils

Modify the initiator name if needed (e.g., if this was a cloned VM that already had open-iscsi installed), because each must be unique (e.g., if we cloned the VM, then we must change the IQN!)
vi /etc/iscsi/iscsid.conf (change “manual” to “automatic”, set CHAP parameters, etc., if needed)
vi /etc/iscsi/initiatorname.iscsi (put the correct initiator name)

(Probe the SAN so that this will show up as a valid initiator on the SAN)
 iscsiadm -m discovery -t sendtargets -p 10.10.10.27
 iscsiadm -m discovery -t sendtargets -p 10.10.10.29
(connect to the iSCSI SAN/target, allow this iSCSI initiator)

Our SAN has multiple iSCSI interfaces, so we'll use multipathing


restart iscsi-network-interface
/etc/init.d/open-iscsi restart

iscsiadm -m discovery -t sendtargets -p 10.10.10.27
iscsiadm -m discovery -t sendtargets -p 10.10.10.29
iscsiadm -m node -l

apt-get install multipath-tools
multipath -d -l  (the two scsi paths should show up and should be recognized as a single block target with multiple paths)
apt-get install sg3-utils
sg_map   (the new scsi devices should show up)

Prepare the filesystem for persistent mounting

ls -la /dev/disk/by-id  (get the /dev/disk/by-id/dm-uuid-mpath-… for this new multipath device)
mkdir /mnt/localscratch0
vi /etc/fstab
Add a line like this: 
/dev/disk/by-id/dm-uuid-mpath-360060f870104b72e004f3263600000001 /mnt/localscratch0 ext4    defaults,noatime        0 2

Format the filesystem (destroying all existing data; only do this if you do not want to keep your previous data on that LUN), then mount it
mkfs.ext4 -L localscratch0 /dev/disk/by-id/dm-uuid-mpath-360060f870104b72e004f3263600000001
mount -a

That's it, all done.  It should auto-mount on the next reboot.

2012/08/31

Ubuntu 12.04 tweaks

Install Some Useful Programs

sudo apt-get install byobu remmina gconf-editor

Dual displays don't come up with a single large virtual workspace.  

Run "sudo nvidia-settings" and change both monitors to "Twin view".  Save the config.  Then log out and back in.

Fix annoying dual-screen behaviors:


sudo gconf-editor
set /apps/compiz-1/plugins/unityshell/screen0/options/overcom_pressure=1 to make it possible to pass from one screen to another flawlessly and /apps/compiz-1/plugins/unityshell/screen0/options/stop_velocity=20 to still make it possible to access the hidden launcher on the left screen.

Setting /apps/compiz-1/plugins/unityshell/screen0/options/num_launchers=1 in gconf-editor causes the Unity launcher to be displayed on the primary desktop only.

Logitech Z-5 USB speakers don't workout of the box.

Here's one fix:
  1. "sudo vi /etc/modprobe.d/alsa-base.conf", and add these lines to the bottom:
    1. alias snd-card-0 snd-usb-audio
      alias snd-card-1 snd-hda-intel
      options snd-usb-audio index=0
      options snd-hda-intel index=1
  2. To fix the volume, find the line in /etc/pulse/default.pa with "load-module module-udev-detect" and change it to "load-module module-udev-detect ignore_dB=1d"
  3. apt-get install  paman paprefs pavucontrol pavumeter 
  4. http://ubuntuforums.org/showthread.php?t=922860
  5. Final settings:
    1. alsamixer: 
      1. Master: 5
      2. Headphone: --
      3. Speaker: 0<>0
      4. PCM: 0<>0
      5. Line: 87<>87
      6. Beep: 18<>18
      7. Aux: 70<>70
      8. Auto-mute: Speaker only
    2. sudo alsactl store
    3. pavucontrol
      1. Output devices: Built-in Audio Analog Stereo
        1. Port: Speakers
      2. Configuration
        1. Built-in Audio: Analog stereo duplex
        2. HD Webcam C910: Analog Stereo Input
        3. Z-5 Speakers: Analog Stereo Output
    4. System Sound Settings:
      1. Output: Play sound through: Speakers (built-in Audio)

Focus does not follow mouse, annoying that menus are not in the app window

  1. apt-get remove appmenu-gtk appmenu-gtk3 appmenu-qt firefox-globalmenu indicator-appmenu thunderbird-globalmenu
  2. gconf-editor
    1. /apps/metacity/general/focus-mode --> sloppy
    2. /apps/metacity/general/auto_raise_delay --> 800

Install Oracle JRE and Mozilla plugin

Download the Oracle JRE from here: http://java.com/en/download/linux_manual.jsp

sudo apt-get purge openjdk*
sudo mkdir -p /usr/lib/jvm
sudo tar -xvf Downloads/jre-7u7-linux-x64.tar.gz -C /usr/lib/jvm/
cd /usr/lib/jvm
sudo ln -s jre1.7.0_07/ jre1.7.0
sudo  update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 0
mkdir -p ~/.mozilla/plugins
ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/

Some Icons are hidden in the systray

 sudo apt-get install dconf-tools
dconf-editor
(go to desktop --> Unity --> Panel)
replace the value in systray-whitelist with 'all'

No more taskbar

sudo apt-get install xfce4-panel
Run it. Configure it.
run "Startup Applications", add this to it (/usr/bin/xfce4-panel)