There are different ways of using NVIDIA graphics drivers in Linux machine, such as:
1. Using it as the main GPU
Cons:
a. Significantly more power consumption compared to using Intel HD
b. Known artifacts, which is sometimes portion of the screen gets corrupted. This goes away when mouse is hovered over, but is still annoying
2. Using it with Bumblebee to get PRIME-like feature.
As most of you are probably familiar, in Windows, the default setting is that NVIDIA GPU is turned on only if it's needed. For example when you're running a game, it's turned on, but when you're browsing, editing a text-file, or something else lightweight, it's turned off to conserve the battery. In Linux, however, such feature doesn't work. The open-source community, however, created an effort to get a similar feature: Bumblebee project. With Bumblebee, Intel HD is the one that renders to the screen. NVIDIA GPU, when requested, is used to render things to a transparent layer, which is then transported into the Intel HD buffer to be rendered to the screen. Unliked PRIME feature in Windows, however, the switch between when to use NVIDIA vs. Intel is not automated. You'll have to specifically tell a program to use which GPU.
For more information: https://github.com/Bumblebee-Project/
Cons:
a. Setup can be pretty complex
b. The perf is not as good as using NVIDIA to render directly to the screen, because of the additional step of transporting NVIDIA-rendered buffer to screen buffer, which is a CPU-consuming step
3. Using nvidia-xrun to run a separate entity of X server which uses NVIDIA GPU.
This is actually my favorite, because this is very easy to setup. To give a little bit of background, in Linux, there is a component called Display Manager the job of display manager is to provide an interface for application to render stuffs onto the screen. In other words, it's a bridge between application and display hardware. And for any applications to render significant graphics into the screen, they use the API provided by X server. So the idea here is to run 2 separate X servers. The first is used to run typical lightweight workload such as text-editing, web-browsing, etc, and is backed by Intel HD drivers. The second is backed by NVIDIA drivers, hence is using the NVIDIA card, and is only run when there is a need to run an application that requires it. So this is very similar to Bumblebee project, except is much simpler.
Special thanks to:
https://wiki.archlinux.org/index.php/NVIDIA
https://github.com/Witko/nvidia-xrun
https://github.com/Bumblebee-Project/
Random useful tech stuffs I write to remind myself. Hopefully useful for you!
Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts
Sunday, July 1, 2018
Tuesday, November 14, 2017
Upgrading Ubuntu Linux Kernel
Sometimes there are problems with the kernel that a Ubuntu distro ships with. For example, on 16.04 LTS release image, my ThinkPad Yoga 14 S3 often fails to resume from sleep. And the latest version of this writing, 4.13.12, caused intermittent WiFi issue which required me to re-connect to the AP periodically.
In short, sometimes there are needs to switch to different kernel versions (sometimes older) to find the one that is the most stable for the hardware in subject.
Here's how you upgrade Linux Kernel:
1. Pick the kernel to update to in:
2. Download the 'generic' version of the right architecture (3 deb files)
3. Install the kernel from terminal
4. Reboot your system!
Tips:
You can boot to a different kernel version in Ubuntu. While booting up, once you get into GRUB bootloader, pick "Advanced Option" and select the version of kernel you want to use.
In short, sometimes there are needs to switch to different kernel versions (sometimes older) to find the one that is the most stable for the hardware in subject.
Here's how you upgrade Linux Kernel:
1. Pick the kernel to update to in:
http://kernel.ubuntu.com/~kernel-ppa/mainline/
2. Download the 'generic' version of the right architecture (3 deb files)
3. Install the kernel from terminal
sudo dpkg -i *.deb4. Reboot your system!
Tips:
You can boot to a different kernel version in Ubuntu. While booting up, once you get into GRUB bootloader, pick "Advanced Option" and select the version of kernel you want to use.
Monday, July 24, 2017
Using Scanner in Ubuntu
After installing Epson scanner drivers from official Epson site, there are a few tools that can be used to scan:
1. scanimage terminal application
2. xsane GUI app
3. Simple Scan GUI app
The GUI apps are straight-forward to use. But I found that sometimes they just don't work. So I use the Terminal method when that happened :)
1. scanimage terminal application
2. xsane GUI app
3. Simple Scan GUI app
The GUI apps are straight-forward to use. But I found that sometimes they just don't work. So I use the Terminal method when that happened :)
scanimage --resolution 300 --mode Color --format ppm > output.ppm
Thursday, May 4, 2017
XKB Keyboard Mapping - Remapping a Key
I just bought myself a S3 Yoga 14. After installing Ubuntu 16.04, I found out that the key that was suppose to spew out 'pipe' and 'backward slash' (when shifted) actually spewed 'greater than' and 'less than'. This little write up explained how I fixed it.
As a reference, please read this first to get some relevant information:
http://www.antoniusdharijanto.com/2015/10/simple-key-re-mapping-on-ubuntu-1404.html
Steps
1. Figure out the keycode of the offending key
There's a little program 'xev' that when runs from terminal, it would give information about whatever key is pressed, including the keycode.
2. Figure out what the key from (1) is supposed to map into.
Since I have another laptop running Ubuntu, I just run xev there and figure out the keycode of the key 'pipe' and get the action from /usr/share/X11/xkb/keycodes/evdev
2. Re-map that keycode to pip
Open up /usr/share/X11/xkb/keycodes/evdev and remap that keycode to the proper functionality.
Update:
The key to be updated was:
<BKSL> = 94; // Note that other occurence of BKSL has to be commented out for this to work
As a reference, please read this first to get some relevant information:
http://www.antoniusdharijanto.com/2015/10/simple-key-re-mapping-on-ubuntu-1404.html
Steps
1. Figure out the keycode of the offending key
There's a little program 'xev' that when runs from terminal, it would give information about whatever key is pressed, including the keycode.
2. Figure out what the key from (1) is supposed to map into.
Since I have another laptop running Ubuntu, I just run xev there and figure out the keycode of the key 'pipe' and get the action from /usr/share/X11/xkb/keycodes/evdev
2. Re-map that keycode to pip
Open up /usr/share/X11/xkb/keycodes/evdev and remap that keycode to the proper functionality.
Update:
The key to be updated was:
<BKSL> = 94; // Note that other occurence of BKSL has to be commented out for this to work
Thursday, December 29, 2016
Fingerprint Authentication on Ubuntu 16.04
Just for fun, I googled around about how to enable fingerprint login in my X201 with Ubuntu 16.04. And then I came across this super cool tool that let you not only login, but to 'sudo' using fingerprint! How cool is that? Goodbye typing password while thinkering around with system-privilege :)
Here's how you install it:
Here's how you install it:
Friday, December 2, 2016
Some Daemons are Not Automatically Started on Ubuntu 16.04
I had a crucial daemon to prevent my laptop from restarting, which is thinkfan (explained here):
http://www.antoniusdharijanto.com/2014/09/corner-cases-of-ubuntu-1404-on-lenovo.html
After upgrading to 16.04, the daemon is no longer started automatically. I noticed this because my laptop restarted itself due to overheating. And the reason is because Ubuntu 16.04 uses systemctl daemon manager as oppose to upstart that 14.04 earlier used.
Here's the solution:
1. Make sure thinkfan is upgraded to the latest (e.g. sudo apt-get update && sudo apt-get install thinkfan). Latest version has systemctl enabled for it.
2. Check if thinkfan can run: sudo systemctl start thinkfan.service
3. Enable the daemon if (2) succeeded: sudo systemctl enable thinkfan.service
Optional:
4. To get it to restart automatically upon crash:
Edit /etc/systemd/system/multi-user.target.wants/thinkfan.service and add 'Restart=always' under [Service] section.
P.S. I notice the same think with mysql daemon. Using the same command, systemctl is smart enough to redirect the command onto sysv that mysql is using.
Enjoy!
Source:
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
http://www.antoniusdharijanto.com/2014/09/corner-cases-of-ubuntu-1404-on-lenovo.html
After upgrading to 16.04, the daemon is no longer started automatically. I noticed this because my laptop restarted itself due to overheating. And the reason is because Ubuntu 16.04 uses systemctl daemon manager as oppose to upstart that 14.04 earlier used.
Here's the solution:
1. Make sure thinkfan is upgraded to the latest (e.g. sudo apt-get update && sudo apt-get install thinkfan). Latest version has systemctl enabled for it.
2. Check if thinkfan can run: sudo systemctl start thinkfan.service
3. Enable the daemon if (2) succeeded: sudo systemctl enable thinkfan.service
Optional:
4. To get it to restart automatically upon crash:
Edit /etc/systemd/system/multi-user.target.wants/thinkfan.service and add 'Restart=always' under [Service] section.
P.S. I notice the same think with mysql daemon. Using the same command, systemctl is smart enough to redirect the command onto sysv that mysql is using.
Enjoy!
Source:
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
Thursday, December 1, 2016
Ubuntu 16.04 stucked on boot logo after an upgrade from 14.04
Yesterday I finally decided to let Ubuntu autoupgrade system update my 14.04 into 16.04. After some time, my laptop got really hot, which seems to be caused by some CPU-intensive operations of the upgrade. It got too hot until a point that the firmware decided to shut my laptop down forcefully. Crap! I'm in the middle of an update!
Yes, as you can already guess, my laptop now stucked on boot logo! What's even worse, the boot logo didn't even animate, which means it hung and I can't use emergency mode or tty2!
I almost thought I had to re-install the entire OS from scratch, which would have been much painful considering all the programming tools and libraries I've painstakingly installed throughout the past year! Fortunately, many people out there shared how they recovered their systems!
[SOLUTION]
There really are two things that need to be done:
1. Complete the unfinished upgrade
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
1. Complete the unfinished upgrade
Yes, as you can already guess, my laptop now stucked on boot logo! What's even worse, the boot logo didn't even animate, which means it hung and I can't use emergency mode or tty2!
I almost thought I had to re-install the entire OS from scratch, which would have been much painful considering all the programming tools and libraries I've painstakingly installed throughout the past year! Fortunately, many people out there shared how they recovered their systems!
[SOLUTION]
There really are two things that need to be done:
1. Complete the unfinished upgrade
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
1. Complete the unfinished upgrade
This can be done via "chroot"-ing onto the broken system via Live CD. For those unfamiliar, "chroot" is a mechanism to "get into" another Linux installation from a currently running one. In this case, the currently running is one from Live CD and the other one is mine that wouldn't boot. It's done as follow:
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
I commented out the line that tried to mount the no-longer-existing path. And voilla! It worked like a charm!
a. fdisk -l #Figure out the disk where your other Linux is installedb. mount /mnt/ /dev/sdX #'/dev/sdX' would be from step (a)c. for i in /sys /proc /run /dev /dev/pts; do sudo mount --bind "$i" "/mnt$i"; done # This is so the chroot-ed system has access to current Linux's hardware nodes that are necessary, for example for internet connectiond. sudo chroot /mnt/ #After this, you're shell is under the other Linux!It's time to complete/fix the upgrade that has been halted.a. sudo apt-get update # Update the list of cached componentsb. sudo apt-get upgrade # Upgrade the system
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
For me, there's still a problem that causes my Linux to get stuck on boot loop. After a while, the system got into emergency mode, where there's an option to go into root shell to do something.
On the emergency mode:1. journalctlThe shell immediately prompted me to run this command, so I did and found out the culprit:
"timeout waiting for device dev-disk-by..... " and several line below that, it seems that the failure is due to the system trying to mount /dev/disk/by-uuid/XXX that didn't exist. Turned out this was the path to my Windows partition, which changed after an upgrade to 16.04
2. vim /etc/fstabI commented out the line that tried to mount the no-longer-existing path. And voilla! It worked like a charm!
Credit: http://www.webupd8.org/2014/01/how-to-fix-non-bootable-ubuntu-system.htmlhttp://forums.debian.net/viewtopic.php?f=10&t=118828Thursday, October 22, 2015
Ubuntu 14.04 suddenly won't boot? This is how you debug it!
After a couple days without rebooting my X201 that was running Ubuntu, I decided to reboot the system. And unfortunately, it won't boot afterwards! After passing the Ubuntu's familiar purplish-black blank background, it got stuck in a black screen. What scared me were that pressing caps-lock didn't even turn on the keyboard indicator and I also couldn't enter "console mode" (ctrl + alt + f1). I was scared that the system went into a hard-hang, perhaps because I accidentally installed some craps. However, it turned out that my xserver binary was missing; the file /usr/bin/X didn't exist, for some reason! How did I figure that out? This post explains it.
Ubuntu keeps different the logs of the last boot attempt. These logs can be used to triage booting issue and potentially are useful to fixing it too. It Through these logs, I was able to figure out my xserver issue. This is how you do it:
1. Boot the system, get it to the hanging state. This step is necessary in order to get the log files generated.
2. Boot to a live-session using Ubuntu CD or Ubuntu USB stick
3. Open "[path to partition]/var/log" of the partition where the problematic Ubuntu is installed. Note that this is not just "/var/log" because that belongs to the currently running live session.
4. Sort the log files by modified date, and open the logs that correspond to the booting attempt from step 1.
5. As there are different log files, I'd suggest to first look at boot.log, which is similar to the kernel log that you get from dmesg. If nothing is suspicious there, then it's likely to be a userspace issue.
6. In my case, I found my xserver problem through the log at /var/log/lightdm/lightdm.log. This is the suspicious snippet of the logs:
+0.05s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+0.05s] DEBUG: DisplayServer x-0: Can't launch X server X -core, not found in path
[+0.05s] DEBUG: DisplayServer x-0: X server stopped
Through a quick google search, I figured that /usr/bin/X is where "X server X -core" is supposed to be located at. In my case, the file was missing, so it was rather obvious. I then rebooted to Ubuntu recovery mode (by holding "shift" right after the system passes bios), and reinstalled xserver via sudo apt-get install --reinstall xserver-xorg.
Hope this post can be useful!
Sunday, March 29, 2015
Compiling AOSP gingerbread on Ubuntu 14.04
I've finally succeeded compiling Gingerbread (2.4) build on Ubuntu 14.04 and I think I wanna share the steps :)
1. Follow the steps to setup build env at Google's AOSP official site:
http://source.android.com/source/initializing.html
2. Download the source code:
http://source.android.com/source/downloading.html
The TAG for for Gingerbread I used is: android-2.3.6_r1, which is the version supported on Nexus One
3. Compile:
http://source.android.com/source/building-running.html
Here's the tricky part. Compilation will work seamlessly (without modding the source code) on GCC-4.4. Newer version of GCC has stricter code formatting, causing some parts of the project to fail.
One nice work-around I found online:
1. Download gcc-4.4: sudo apt-get install gcc-4.4-multilib g++-4.4-multilib
2. Make a folder where you create symlinks for gcc, g++, and cpp to gcc-4.4, g++-4.4, and g++-4.4 respectively
3. Override the PATH env, e.g. export PATH=$PWD:$PATH
This work-around is nice because you don't have to change your default gcc onto older version. Well, at least I don't want to :p
One caveat though, I find one project that still failed after this, which turned out to hard-code gcc path onto /usr/bin/gcc! Dang... So don't forget to modify this also:
diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl
index 083e309..b6c942f 100755
--- a/WebCore/dom/make_names.pl
+++ b/WebCore/dom/make_names.pl
@@ -47,7 +47,7 @@ my %tags = ();
my %attrs = ();
my %parameters = ();
my $extraDefines = 0;
-my $preprocessor = "/usr/bin/gcc -E -P -x c++";
+my $preprocessor = "/usr/bin/gcc-4.4 -E -P -x c++";
Now compilation should succeed flawlessly! :)
1. Follow the steps to setup build env at Google's AOSP official site:
http://source.android.com/source/initializing.html
2. Download the source code:
http://source.android.com/source/downloading.html
The TAG for for Gingerbread I used is: android-2.3.6_r1, which is the version supported on Nexus One
3. Compile:
http://source.android.com/source/building-running.html
Here's the tricky part. Compilation will work seamlessly (without modding the source code) on GCC-4.4. Newer version of GCC has stricter code formatting, causing some parts of the project to fail.
One nice work-around I found online:
1. Download gcc-4.4: sudo apt-get install gcc-4.4-multilib g++-4.4-multilib
2. Make a folder where you create symlinks for gcc, g++, and cpp to gcc-4.4, g++-4.4, and g++-4.4 respectively
3. Override the PATH env, e.g. export PATH=$PWD:$PATH
This work-around is nice because you don't have to change your default gcc onto older version. Well, at least I don't want to :p
One caveat though, I find one project that still failed after this, which turned out to hard-code gcc path onto /usr/bin/gcc! Dang... So don't forget to modify this also:
diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl
index 083e309..b6c942f 100755
--- a/WebCore/dom/make_names.pl
+++ b/WebCore/dom/make_names.pl
@@ -47,7 +47,7 @@ my %tags = ();
my %attrs = ();
my %parameters = ();
my $extraDefines = 0;
-my $preprocessor = "/usr/bin/gcc -E -P -x c++";
+my $preprocessor = "/usr/bin/gcc-4.4 -E -P -x c++";
Now compilation should succeed flawlessly! :)
Tuesday, September 9, 2014
Corner cases of Ubuntu 14.04 on Lenovo ThinkPad x201
I've been using Ubuntu 14.04 for a couple months now.
cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
To make workaround permanent, we can edit the kernel command line argument, just like what's explained on the same page:
Modify /etc/default/grub to be like this:
Everything works like a charm afterwards!
1. CPU got stucked on 1.2GhZ
Recently I installed a handy utility called indicator-cpufreq, which gives a system status bar icon indicating the currently used CPU governor and the current cpu frequency. I noticed that my CPU always got stucked on 1.2Ghz, no matter what I did. I have tried modifying it manually by echo-ing the sysfs node and using cpufreq-utils, without much luck. I then came across this page:
http://askubuntu.com/questions/340626/permanently-change-maximum-cpu-frequency
This page explains that there is a CPU bios_limit that if set wrongly, may prevent the CPU from going above the frequency threshold that's set there.
cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
Turned out it really was the culprit!! For some weird reason it got set to 1.2GHZ!!
This is how you worked around it:
This is how you worked around it:
echo 1 > /sys/module/processor/parameters/ignore_ppc
To make workaround permanent, we can edit the kernel command line argument, just like what's explained on the same page:
Modify /etc/default/grub to be like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.ignore_ppc=1"
Everything works like a charm afterwards!
I then installed cpufreqd, which is a daemon to customize CPU frequency based on the laptop's realtime battery status (e.g. power level, plug/unplugged, etc). Now my docked x201 is running buttery smooth at 2.67 GHZ :)
I want to check out how long will it take to build AOSP on this laptop now :)
I want to check out how long will it take to build AOSP on this laptop now :)
2. Intermittent shutdown due to overheating
Another problem I was facing is that after a couple hours of running docked, my laptop would shut itself off! When this happened, I undocked my laptop and noticed that it's abnormally hot!
I then realized that x201's airflow is located on its bottom, which got blocked by the dock. (sigh.. guess the dock isn't poorly designed.... :( )
Don't fret out though! There's solution!
I found this handy tool to control the fan speed of the laptop's.
Don't fret out though! There's solution!
I found this handy tool to control the fan speed of the laptop's.
http://www.thinkwiki.org/wiki/How_to_control_fan_speed
Basically, x201's fan can be controlled by this node:
/proc/acpi/ibm/fan
There are several levels that can be set, which corresponds to the RPM of the fan.
With this in mind, thinkfan can be used to automate the RPM of the fan depending on the reading of the thermal sensors. This page kindly describes how to set it up. (including how to run thinkfan as a daemon, custom setup for x201, etc)
With this in mind, thinkfan can be used to automate the RPM of the fan depending on the reading of the thermal sensors. This page kindly describes how to set it up. (including how to run thinkfan as a daemon, custom setup for x201, etc)
http://staff.science.uva.nl/~kholshei/thinkfan_guide/
Edit (10/06/2015):
The following steps are how I did it:
1. sudo apt-get install thinkfan
2. sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
3. sudo vim /etc/default/thinkfan, change it to be the following (this is to load thinkfan on boot):
START=yes
4. sudo vim /etc/thinkfan.conf, change it to be the following (this is fan vs. sensor-reading):
# The way the config works is that it picks the highest value among all sysfs nodessensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
#sensor /proc/acpi/ibm/thermal
(0, 0, 47)
(1, 46, 50)
(2, 49, 53)
(3, 52, 56)
(4, 55, 59)
(5, 58, 62)
(6, 61, 65)
(7, 64, 75)
#127 is for disengaged
(127, 74, 32767)
Edit (10/06/2015):
The following steps are how I did it:
1. sudo apt-get install thinkfan
2. sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
3. sudo vim /etc/default/thinkfan, change it to be the following (this is to load thinkfan on boot):
START=yes
4. sudo vim /etc/thinkfan.conf, change it to be the following (this is fan vs. sensor-reading):
# The way the config works is that it picks the highest value among all sysfs nodessensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
#sensor /proc/acpi/ibm/thermal
(0, 0, 47)
(1, 46, 50)
(2, 49, 53)
(3, 52, 56)
(4, 55, 59)
(5, 58, 62)
(6, 61, 65)
(7, 64, 75)
#127 is for disengaged
(127, 74, 32767)
And for debugging:
1. To see how a new config file works:
sudo thinkfan -n
2. To check current temperature:
cat /sys/devices/virtual/hwmon/hwmon0/temp1_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
'or'
cat /proc/acpi/ibm/thermal (in ubuntu 14.04, only shows one temperature)
3. To check fan level:
cat /proc/acpi/ibm/fan
(level shouldn't be 'auto' if thinkfan is really running)
4. ps aux | grep thinkfan <- you should see the process running
1. To see how a new config file works:
sudo thinkfan -n
2. To check current temperature:
cat /sys/devices/virtual/hwmon/hwmon0/temp1_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
'or'
cat /proc/acpi/ibm/thermal (in ubuntu 14.04, only shows one temperature)
3. To check fan level:
cat /proc/acpi/ibm/fan
(level shouldn't be 'auto' if thinkfan is really running)
4. ps aux | grep thinkfan <- you should see the process running
Monday, November 28, 2011
Mounting Linux hdd (ext4/ext3/ex2) in OSX
As the title says, here's how to mount Linux partition in OSX:
1. Download MacFuse .dmg from http://code.google.com/p/macfuse/
2. Download fuse-ext2 .dmg from http://sourceforge.net/projects/fuse-ext2/
3. Install them respectively.
4. Reboot your computer?
5. Here is the magic terminal keywords to mount your beloved Linux hdd:
a. First do: 'disktool -l' to find out the name of Linux hdd you're interested in. The name is something like disk0s1 or similar.
b. Next: 'mkdir /Volumes/[HD NAME]' replace HD NAME with your choice of your name. (eg. Linux)
c. After that, 'sudo fuse-ext2 /dev/[LINUX HD NAME] /Volumes/[HD NAME]/ -o force' replace the LINUX HD NAME with the name from part a. above and HD NAME from part b. above
Voila! You're beloved Linux partition is now mounted! :)
Tips: You can add a script to your .profile to automate the steps above every time your computer boots up!
1. Download MacFuse .dmg from http://code.google.com/p/macfuse/
2. Download fuse-ext2 .dmg from http://sourceforge.net/projects/fuse-ext2/
3. Install them respectively.
4. Reboot your computer?
5. Here is the magic terminal keywords to mount your beloved Linux hdd:
a. First do: 'disktool -l' to find out the name of Linux hdd you're interested in. The name is something like disk0s1 or similar.
b. Next: 'mkdir /Volumes/[HD NAME]' replace HD NAME with your choice of your name. (eg. Linux)
c. After that, 'sudo fuse-ext2 /dev/[LINUX HD NAME] /Volumes/[HD NAME]/ -o force' replace the LINUX HD NAME with the name from part a. above and HD NAME from part b. above
Voila! You're beloved Linux partition is now mounted! :)
Tips: You can add a script to your .profile to automate the steps above every time your computer boots up!
Saturday, November 26, 2011
Installing Ubuntu 11.10 on MacBook 5,1 + Tweaks to run it smoother
Previously I had Ubuntu 11.x installed in my MacBook 5,1. However, after I upgraded it to 11.4 (Natty Narwhal) a problem occurred. My Ubuntu didn't boot-up anymore. I googled around and it seemed that 11.4 has problem with video driver that my MacBook uses.
Long story short, I re-installed my whole Ubuntu partition.
Here are some steps of how to do it.
1. If you're triple booting, make sure to have Refit installed. (This is some sort of BIOS emulation for Mac fancy new technology?) But if you're just dual booting, bootcamp is sufficient.
2. If you're planning to install Windows as well, I would recommend to install the windows first before installing the Ubuntu (a lot of people suggest this). Install the Windows using bootcamp as usual.
3. Now to install Ubuntu, burn the image to a cd/dvd, put it inside the disc reader, then reboot your mac. After you hear the boot-indicator beeping sound (before the apple logo), immediately press and hold 'c' (c stands for cd I guess?) This will let your MacBook boots from the Ubuntu image.
4. Make sure NOT to partition your hard-disk from Ubuntu installer! My friend OSX partition was gone because of this. Just to be safe, always partition using DiskUtility.
5. When prompted for swap file during the Ubuntu installation, just ignore it. We don't need it.
6. Now just follow all the installation step prompted and you'll be good to go! :)
Here are several tricks to make Ubuntu 11.10 run smoother. These tricks originally came from different resources I found in Google. I want to share these as they are really helpful. (Thanks to all the original sources)
Wireless card problem:
In some MacBook version, the wifi doesn't work out of the box. To fix this, go to 'additional driver' under the application menu. Look for broadcom adapter then install.
Sluggish graphics:
Again, in some MacBook version, the NVDIA graphic card isn't appropriately configured out of the box. So go to 'additional driver' then try to install one of the listed NVDIA drivers. Some might not allow hibernate, some might not fix the sluggish-ness of your graphics, some might not do both, but some might fix everything! Try one that works for you. If nothing works, try going to NVDIA official site and download their latest driver.
Keyboard shortcut brightness doesn't work:
This one is pretty irritating, but I found the solution to be quite simple.
Edit the text file /etc/X11/xorg.conf (need root access)
In the "Device" section, add up this line:
Option "RegistryDwords" "EnableBrightnessControl=1"
Now save the file, reboot your Ubuntu, and you're keyboard is good to go!
Trackpad "gets in the way" when typing:
Sometimes when you're typing, you accidentally touch the trackpad so the field where you're typing loses the focus. This is due to your hand accidentally touching the trackpad that's really sensitive. (From this I realized how great Apple drivers are!)
To fix this, install "Pointing devices" from Ubuntu Software Center. Run this program like running ordinary application. There is a really cool tweak to your trackpad, "Detect Palm". Basically this detects the "accidental" touch that happens when you're typing. For me, after installing this, the trackpad doesn't really "get in the way" anymore. (sometimes they still do, but not that often)
Disabling trackpad via terminal
Okay if you don't want to go into all the hassle of downloading additional software just to enable/disable trackpad or any other input device, here is how you do it using terminal.
'xinput list' -> this gives the list of input devices available.
'xinput set-prop [id] "Device Enabled" [1/0] -> to disable/enable the input device.
Just in case you have your trackpad disabled and forget to bring mouse, hit ctrl+alt+t to open terminal and type in the magic keywords above to enable your trackpad. Or maybe aliasing is better!
Okay so those are the tips so far. I'll be updating this if I found new fancy tricks. So far I'm loving my new Ubuntu 11.10!
Have fun with your Ubuntu!
Long story short, I re-installed my whole Ubuntu partition.
Here are some steps of how to do it.
1. If you're triple booting, make sure to have Refit installed. (This is some sort of BIOS emulation for Mac fancy new technology?) But if you're just dual booting, bootcamp is sufficient.
2. If you're planning to install Windows as well, I would recommend to install the windows first before installing the Ubuntu (a lot of people suggest this). Install the Windows using bootcamp as usual.
3. Now to install Ubuntu, burn the image to a cd/dvd, put it inside the disc reader, then reboot your mac. After you hear the boot-indicator beeping sound (before the apple logo), immediately press and hold 'c' (c stands for cd I guess?) This will let your MacBook boots from the Ubuntu image.
4. Make sure NOT to partition your hard-disk from Ubuntu installer! My friend OSX partition was gone because of this. Just to be safe, always partition using DiskUtility.
5. When prompted for swap file during the Ubuntu installation, just ignore it. We don't need it.
6. Now just follow all the installation step prompted and you'll be good to go! :)
Here are several tricks to make Ubuntu 11.10 run smoother. These tricks originally came from different resources I found in Google. I want to share these as they are really helpful. (Thanks to all the original sources)
Wireless card problem:
In some MacBook version, the wifi doesn't work out of the box. To fix this, go to 'additional driver' under the application menu. Look for broadcom adapter then install.
Sluggish graphics:
Again, in some MacBook version, the NVDIA graphic card isn't appropriately configured out of the box. So go to 'additional driver' then try to install one of the listed NVDIA drivers. Some might not allow hibernate, some might not fix the sluggish-ness of your graphics, some might not do both, but some might fix everything! Try one that works for you. If nothing works, try going to NVDIA official site and download their latest driver.
Keyboard shortcut brightness doesn't work:
This one is pretty irritating, but I found the solution to be quite simple.
Edit the text file /etc/X11/xorg.conf (need root access)
In the "Device" section, add up this line:
Option "RegistryDwords" "EnableBrightnessControl=1"
Now save the file, reboot your Ubuntu, and you're keyboard is good to go!
Trackpad "gets in the way" when typing:
Sometimes when you're typing, you accidentally touch the trackpad so the field where you're typing loses the focus. This is due to your hand accidentally touching the trackpad that's really sensitive. (From this I realized how great Apple drivers are!)
To fix this, install "Pointing devices" from Ubuntu Software Center. Run this program like running ordinary application. There is a really cool tweak to your trackpad, "Detect Palm". Basically this detects the "accidental" touch that happens when you're typing. For me, after installing this, the trackpad doesn't really "get in the way" anymore. (sometimes they still do, but not that often)
Disabling trackpad via terminal
Okay if you don't want to go into all the hassle of downloading additional software just to enable/disable trackpad or any other input device, here is how you do it using terminal.
'xinput list' -> this gives the list of input devices available.
'xinput set-prop [id] "Device Enabled" [1/0] -> to disable/enable the input device.
Just in case you have your trackpad disabled and forget to bring mouse, hit ctrl+alt+t to open terminal and type in the magic keywords above to enable your trackpad. Or maybe aliasing is better!
Okay so those are the tips so far. I'll be updating this if I found new fancy tricks. So far I'm loving my new Ubuntu 11.10!
Have fun with your Ubuntu!
Subscribe to:
Posts (Atom)

