08/05/2013

Alekto - dual booting a Zenbook

After Tisiphone, an Asus Bamboo U43JC, bowed out after 2 1/2 years with FUBAR hinges, a 3/4 working LCD panel and a dead battery, the natural choice was to stick to Asus, of course. In fairness, finding something ultraportable with a full metal body and decent screen resolution that's not a Macbook Air and doesn't break the bank doesn't leave you many options beyond a Zenbook. I went for the UX31A DB71 with a 256 GB SSD and i7 3517U processor.


Windows issues:
256 gig dual-boot isn't a lot nowadays, so the first thing was to cut Windows 8 back to size. Even after removing the bloatware and defragmenting, the original 100 GB system partition didn't resize to under 51 GB, probably due to immovable files. Windows 8 comes with an utility to back up the recovery partition to a dedicated USB drive (16 GB will do fine) which also gives you the option to delete the partition - you can't do it from the Windows partitioner. I was left with another 4 GB partition labelled Recovery I decided to keep. I used the USB drive for a system reset which resolved the immovable files issue, so I could eventually cut back Windows to 35GB.

Another thing to be done right away is disabling fast startup in the Windows power settings, else all shared drives will be blocked in Linux. As with everything Win 8 related, it's wonderfully intuitive, so I'll refer to a how-to.

To get the screen brightness keys to work in Kubuntu, I needed to update the BIOS to 2.18. I got WinFlash (under 'BIOS-Utilities') and the newest BIOS file from the Asus suppport page.

Purely Windows-related: The first system update made my headphone jack go silent (speakers still worked). This is a known problem, I was able to fix it by installing the Realtek drivers, again from the Asus support page

Kubuntu issues:
Booting from a Kubuntu thumb drive required turning off safe boot in the BIOS. I installed Kubuntu to 25 GB of free space and the former recovery partition. The system runs quite out of the box, except for two issues.

Grub threw unknown command 'drivemap' and invalid EFI filepath errors trying to boot Windows. According to this forum thread, it seems to be a grub-efi bug and can be fixed with:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update 
sudo apt-get install -y boot-repair
boot-repair

Fixing the screen brightness keys requires the parameters

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi='!Windows 2012'"
set in /etc/default/grub, with a sudo update-grub afterwards.

Controlling the keyboard backlight:
Apparently the backlight keys aren't mapped at all, but the hardware control works. Following the Ubuntu wiki, I set up two shell scripts, /usr/bin/kbdplus,
################################
# keyboard brightness increase
################################
 #!/bin/bash
brightness_val=$(cat /sys/class/leds/asus::kbd_backlight/brightness)
if [ 3 -gt $brightness_val ]
   then brightness_val=$(($brightness_val + 1))
   echo $brightness_val | tee /sys/class/leds/asus::kbd_backlight/brightness
fi
and /usr/bin/kbdminus,

################################
# keyboard brightness decrease
################################
#!/bin/bash
brightness_val=$(cat /sys/class/leds/asus::kbd_backlight/brightness)
if [ 0 -lt $brightness_val ]
  then
    brightness_val=$(($brightness_val - 1))
    echo $brightness_val | tee /sys/class/leds/asus::kbd_backlight/brightness
fi
made them executable and mapped them to the keyboard brightness keys in System Settings → Shortcuts → Custom Shortcuts.
I ran sudo sed -i '$ichmod a+w /sys/class/leds/asus\\:\\:kbd_backlight/brightness' /etc/rc.local and rebooted. It worked.

Useful stuff for limited hard drive space:
Amarok's removable media support. I could register my USB drive as a music source with Amarok, but right now the collection is scanned every time I connect the drive. With 80 GB of music on a terabyte drive, this takes ages. Instead, I added the folder to my local collection. Now Amarok prevents me from unmounting, but the collection loads quickly and missing files on the unplugged drive are handled gracefully (sort of - the current playlist doesn't register drive removal/attachment). No preset media keys on the Zenbook, so you have to define your own in System Settings → Global Shortcuts.

Scheduled backups! See here. Something that came up in the process: standard Kubuntu /etc/fstab entries for NTFS partitions come with umask=007,gid=46 for permission handling. Even though my user was in group 46 (plugdev), this threw permission errors with both Unison and Dropbox. Adding uid=1000 resolved the issue.

No comments: