Thursday, January 1, 2015

Shrink volume in Windows 7

In order to install Ubuntu on a new HP Probook 430 G2, with Windows 7 pre-installed, I wanted to shrink the C: volume in order to make more space for Ubuntu.

So I did the usual:
- in Start Menu search box, I typed "partition"
- click on "Create and format hard disk partitions"
- I right-clicked on the C: volume and chose "Shrink volume"
- in the following window I could shrink the C: volume to about half its size. But the problem was that I wanted to shrink my partition more than what was allowed.

To cut short to the solution, here's how I unblocked the remaining space:

In short:

  • I disabled virtual memory
  • I disabled file indexing and deleted the index files
  • I also deleted shadow copies
  • Restart, shrink partition as desired
  • As far as desired, re-enable virtual memory and/or file indexing and make a restore point.

In long and detailed:
  • I disabled virtual memory (first steps are copied from Microsoft site):
    • Open System by clicking the Start button Picture of the Start button, right-clicking Computer, and then clicking Properties.
    • In the left pane, click Advanced system settings.  Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
    • On the Advanced tab, under Performance, click Settings.
    • Click the Advanced tab, and then, under Virtual memory, click Change.
    • Clear the Automatically manage paging file size for all drives check box.
    • Click on "No paging file" (further down in the same window)
    • Restart
  • Note: It might be necessary to disable also the creation of Recovery Points, which in my case wasn't active to begin with, so I can't help you here.
  • Upon restart, I still had the same problem. So I tried manually shrinking the volume using Diskpart (to find info on this, start the partition manager as explained at the beginning of this article, right-click on C: volume, choose "Shrink partition", and in the following popup window click the link that says "See Shrink a basic volume" which brings you to a help page with all explanations). 
    • Diskpart didn't succeed in shrinking the volume more than the graphical interface did, of course, but it did write an event in the system logs. As explained in Windows help about shrinking volumes, in the Application logs you can search for event 259 which details the file that blocks further shrinking. So click on Start Menu, type "log" in the search box and choose "view event logs". There, under "Event viewer" -> "Summary page events" in the section "Information", look for event ID 259 and, at the right (in the "actions" pane, click on "view all instances of this event). Click on the last one, chronologically, and there you should see the file name of the file blocking the further shrinking.
    • So here I found out that the indexing service was involved. 
  • So I disabled the windows indexing and deleted the index files:
    • To disable the service:
      • in Start Menu, type "services" and click above on "services"
      • Look for "Windows Search", right-click on it, stop the service and and put "startup service" to "disabled" so on restart it doesn't start again.
    • Then I deleted the index files:
      • first find out where they are
        • in Start Menu type "regedit" in the search box and click on "regedit" above.
        • find HK_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows Search and click on it. To the right, next to DataDirectory, you'll find the right directory (in my case %ProgramData%\Microsoft\Search\Data).
      • Then delete them as administrator: I opened a Windows Explorer window as administrator (type "explorer" in Start menu search field, right-click on Windows Explorer and select "Run as administrator"). Then I typed in the directory box on top "%ProgramData%\Microsoft\" (without the quotation marks), right-clicked on the "Search" subdirectory and chose "delete".
  • I deleted shadow copies:
    • I opened a command prompt as administrator (Start Menu -> All Programs -> Accesories -> Command prompt -> right-click and select: "run as administrator")
    • Typde "vssadmin list shadows" in command prompt
    • Typed "wmic" in command prompt and pressed enter. Then typed "shadowcopy delete" and at the prompt, selected "'Y" for every shadow copy.
  • Then I restarted and was able to shrink the partition to the desired size.


If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)

Thursday, October 23, 2014

Dry, irritated eyes and puffed eyelids (CVS): try tea tree oil!

Since I started working about 8 hours a day before a computer screen, I have been suffering from dry, irritated eyes and especially sore and puffed upper eyelids. And now I have truly found a solution that works.

The keywords here are blepharitis; a microscopic mite called demodex; and, as far as the solution goes: tea tree essential oil, a natural (albeit very powerful - not to goof around with) extract of the tea tree plant.

I'll make this short. If you suffer, as I did, from red, itchy, irritated eyes and/or puffed and sore eyelids, the problem might be an excess population of demodex mites at the base of your eyelids. Everybody has them, you have too much of them (invisible to the naked eye). So you need to "weed them out" a bit.

Demodex-mite-scanning-electron-microscope-image-2
The problem: demodex parasitic mite (photo Alan R. Walker)
The remedy is extremely simple and cheap:
  • put a drop of tea tree oil (Camelia Sinensis) on your finger and rub it out a bit with another finger. Your fingertip should be moist with it, but there shouldn't be a real drop on it (otherwise the stuff might leak into your eyes and that really stings).
  • close your eye and rub the oil gently on the edges of your eyelids where your eyelashes begin. The idea is to get it on and around the base of your eyelids - but not into your eye. Repeat for the other eye.
  • the first weeks (I read a minimum of six) do this every morning on waking and every evening when going to bed. After that you need a regular hygiene (say once a day) just to keep the demodex at normal levels.
The solution: tea tree (source)
You'll find tea tree oil at your pharmacist's and at organic stores, amonst others.

Now be warned:
  1. Tea tree oil is strong and stings. Even when you don't get it into your eye but only on the eyelids, as you should, it will give a burning sensation. That's not harmful and it goes away within ten minutes (and gradually faster as you get used to it and better at applying it), but be prepared.
  2. If you do get it into your eyes, don't panic. It happened to me several times and has no lasting adverse effects to my knowledge. But it stings like hell for ten minutes or so.
  3. Apparently you shouldn't see this as a "disease" that the tea tree "cures". It's more like regular hygiene.
  4. I obviously urge you to consult a health care professional before doing this.
Here is some suggested reading:
To be complete, I should mention I also wear special computer glasses now. Mine are Prisma P1 Lite (lite because I work on AutoCAD and need to distinguish colors a lot). I am very pleased with them. Unlike Gunnar glasses, which I tried also, my Prisma computer glasses don't magnify which is perfect for me.
The glasses did ease my eye problems somewhat without solving them altogether (but I wear them foremost to protect my eyes from the too harsh computer screen light), it wasn't until the tea tree remedy that I really felt a true relief.

Good luck!

Sunday, August 3, 2014

Keyboard layout incorrect in unity

Problem: keyboard layout in Unity appears to be BE (azerty) (as shown in the icon in Unity panel top right), but when typing it turns out to be EN (querty). I just have to click on the BE-icon and "choose" BE again for the keyboard layout to be correct. But the problem returns after every reboot.
System: Ubuntu 14.04.1 (fresh install) on a HP Envy dv7 laptop

Solution:

  • as found in the comments on bug #1238346: 
    • delete the ~/.config/ibus folder with the command:
      rm -rf ~/.config/ibus
    • then type ibus-setup and in the window that appears, in the "Advanced" tab, tick "use sytem keyboard layout"
    • close all windows and reboot.

Saturday, August 2, 2014

Beats audio on HP envy dv7, Ubuntu 14.04.1

Problem: Only two speakers working on HP Envy dv7 7390eb laptop with Beats Audio
System: Ubuntu 14.04.1 fresh install
  • Everything I tried relating to changes in /etc/modprobe.d/alsa-base.conf, like adding the line options snd-hda-intel model=ref or variations on this, did not work
  • Following this thread I did
    gksudo gedit /etc/pulse/default.pa
    and added the line
    load-module module-combine channels=6 channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe
  • reboot
  • Click on volume control icon (top right of Unity) and choose Sound Settings (or click on the gear icon -> system settings -> Sound, which brings you to the same)
  • In the tab "Output' an entry "Simultaneaous output to Built-in Analog Stereo" has appeared. Click on this, then click on the "Test Sound" button to the right. In my case 6 speakers appear: front-left, front-center, front-right, rear-left, rear-right and subwoofer. Testing them 5 out of 6 work, only the subwoofer remains silent. Which is acceptable for me, for the time being, and a big step forward from only two speakers...

If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)


Wednesday, July 30, 2014

Install Ubuntu 14.04.1 LTS next to Windows 8 (dual-boot)

System:  HP Envy dv7 7390eb laptop with Windows 8 pre-installed (UEFI)
Problem: Install Ubuntu 14.04.1 alongside Windows and make dual-boot work

Caution: I am not an expert, I only share what worked for me on my particulat laptop and configuration. This is also very summary, you may have to investigate further if you're not familiar with certain aspects (like changing Boot order sequence in your BIOS etc).

Solution:

  • in BIOS, disable Secure Boot (sorry, can't give details here, Google is your friend)
  • From within Windows, create an empty partition for Ubuntu (not formatted): Control Center -> change partitions
  • download Boot Repair CD and install on a live USB (I used LinuxLive USB Creator but there are other options), you will need it afterwards
  • Start Ubuntu 14.04.1 Live USB, choose "Try without installing"
  • Launch "Install Ubuntu" and choose "Something else"
  • For a partition scheme, I followed the instructions on this page:
    • one of min. 20 Gb (I took 75Gb), ext4, primary partition, "/"
    • one of twice your RAM, swap
    • the rest as logical partition, ext4, "/home"
  • continue installation as usual
  • when I rebooted, Windows booted as if Ubuntu did not exist, so:
    • reboot with Boot Repair Live USB (you may have to enter BIOS by pressing the Esc key just after firing up your laptop and then choose F10 in order to change boot sequence)
    • choose Advanced options, leave all options as they are, only difference is to tick (activate) "Secure Boot" in one of the tabs
    • follow instructions (if you have a BE Azerty keyboard like me, you'll have difficulties in finding the right keys because Boot Repair is in Qwerty: for " type %; * is 8; - is ) and / is =).
    • on reboot everything should be in order
If you upgrade Windows to 8.1, you will have to do the Boot Repair thing again.


Tuesday, July 29, 2014

Inkscape and the Alt key in Unity (Ubuntu 14.04.1 LTS)

System: Ubuntu 14.04.1 LTS
Problem: Unity "steals" the Alt-key so that it doesn't function as it should in Inkscape.

Solution:

  • install dconf-tools
  • launch it
  • go to org -> gnome -> desktop -> wm -> preferences
  • set "mouse-button-modifier" to "<Super>" (without the quotation marks).
    DO NOT SET IT TO "none" or leave the field empty, or you won't be able to left-click normally anymore anywhere in Unity (I know because I made the mistake, had to log out and log in to Xfce to correct it, Unity was totally messed up).
(With thanks to this post but take caution not to set the value to "none"!)

Monday, July 28, 2014

[SOLVED] Brightness control broken on Ubuntu

OS: Ubuntu 12.04 LTS
Hardware:  HP Envy dv7 7390eb laptop
Problem: brightness control broken on kernel upgrade from "precise" to "trusty"

Explanation:

I received a notification in Update Manager that my "current Hardware Enablement Stack (HWE) is going out of support" so I did the proposed upgrade.

I had some problems with dependencies which I solved according to these instructions:

"Command:
amd64:
apt-get install -V libglapi-mesa-lts-trusty libgl1-mesa-glx-lts-trusty xserver-xorg-lts-trusty xserver-xorg-input-all-lts-trusty xserver-xorg-video-all-lts-trusty libgl1-mesa-dri-lts-trusty x11-xserver-utils-lts-trusty libglapi-mesa-lts-trusty:i386 libgl1-mesa-dri-lts-trusty:i386 libgl1-mesa-glx-lts-trusty:i386 libgles2-mesa-lts-trusty libglapi-mesa-lts-trusty mesa-vdpau-drivers-lts-trusty
i386:
apt-get install -V libglapi-mesa-lts-trusty libgl1-mesa-glx-lts-trusty xserver-xorg-lts-trusty xserver-xorg-input-all-lts-trusty xserver-xorg-video-all-lts-trusty libgl1-mesa-dri-lts-trusty x11-xserver-utils-lts-trusty mesa-vdpau-drivers-lts-trusty libgles2-mesa-lts-trusty libglapi-mesa-lts-trusty"
found in the comments on this bug report.

Everything seemed to be OK after reboot, apart from the fact that the brightness control on my HP Envy dv7 laptop was broken. The function keys for brightness did move the brightness slider that appears on screen, but brightness itself was not affected and stayed at 100%.

After testing some different workarounds that didn't work, I found a solution on this blog post (I copy it here for completeness):

"Open terminal ( Ctrl+Alt+T ) and type:
sudo gedit /etc/default/grub
You will find this line in the new opened window:
Change it to:
Save and close the window and type this in the terminal:
sudo update-grub
This will update your grub and while rebooting your PC, it will set an extra parameter on the grub menu during boot."

Happy Ubuntuing!