30 Kasım 2012 Cuma

BackUp Your Linux System with TAR

People using a lot of specific configurations in their Linux systems may want to back up their systems in order not to do the same configurations if system fails.
There are several ways to back up your linux system:
1) The first and the low-level one is "dd" command which dumps the whole disk byte-wise. Since my Ubuntu system was almost 200GB in size, it takes very long time both back-up and restoring.
2)The second option is to use some programs like "CloneZilla". There is a lot of information about usage of these softwares, if you google it.
3)As a Linux user, you can do this just by using TAR command to archive your linux system and reuse it if necessary.

BACK-UP with TAR:
1) Prepare your system before TAR: You can delete all unnecessary files, folders etc for smaller image sizes. You can delete your personal files and internet history not to include them in your back-up image. Do not forget to unmount extra hard-drives mounted un your system(extarnal hdd etc.)
2) After preparation we can take our back-up now.
Open the terminal.
cd /
tar -cvpzf backup.tar.gz --exclulde=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev /
 We are archiving with "preserve file permisions" options -p- and "gzip" option -z-. Also note that some unnecesary directories are excluded. For instance, /dev directory is a tmpfs directory created by udev at every startup. We do not need it while archiving the system.
After a while, the back-up process will finish. You may see a line saying: "Exiting with failure status due to previous errors". Do not take this message into account. Now you can check whether your backup.tar.gz file is located under root. You can copy the image to another folder or hard-disk if you wish for later usage.


RESTORING
If you are restoring root directory, you shall use a Live CD. Start the system with your Live CD, mount the relevant drive and take care about the correct paths for the commands.
Assuming your backup.tar.gz is located under /home/test, the command is:
tar -xvpzf /home/test/backup.tar.gz -C /
After extraction process do not forget to recreate the directories excluded before:
mkdir /proc /lost+found /sys /mnt /media

Time to reboot your computer to check if restoring is OK!..

If you encounter problems at GRUB boot, check internet for instructions.
https://help.ubuntu.com/community/GrubHowto#Backup,%20Repairing%20and%20Reinstalling%20GRUB

References
https://help.ubuntu.com/community/BackupYourSystem/TAR

21 Kasım 2012 Çarşamba

XML Copy Editor "start-up" Problem in Ubuntu 12.04


Today, I need to use an xml editor for editing some xml files. When I use Ubuntu's Software Center and download "XML Copy Editor", I face with a start-up problem that the program does not start even if you start it from dash or terminal. Its window appears for a second but it stucks.

I've found out a solution to this problem and it really works out! The solution is to compile the source code of XML Copy Editor from scratch.

mkdir ~/compilexmlcopyeditor && cd ~/compilexmlcopyeditor
sudo apt-get purge xmlcopyeditor
sudo apt-get build-dep xmlcopyeditor
sudo apt-get source xmlcopyeditor
cd xmlcopyeditor-
1.2.0.6
sudo dpkg-buildpackage -rfakeroot -us -b
cd ..
dpkg -i *.deb


After the steps above,  in terminal window run the program as below:
xmlcopyeditor <YOUR_XML_FILE>

Bingo!..

References
https://bugs.launchpad.net/ubuntu/+source/xmlcopyeditor/+bug/967087



11 Kasım 2012 Pazar

Sourcey G++ Lite Installation for Mips-GNU-Linux and PATH Adjustment for Fedora and Ubuntu

In order to install mips cross compiler, we firstly have to find mips-4.3-51-mips-linux-gnu.bin.
Go to the directory where mips-4.3-51-mips-linux-gnu.bin is located, open a terminal and write:
$ ./mips-4.3-51-mips-linux-gnu.bin
If you do not have a customization, proceed with Next to the end of the installation through the wizard.
After the installation completes, open a terminal, write "mips" and press TAB to check whether the cross-compiler name completes automatically. If not, we shall add the compiler to PATH.

For Fedora,
$ cd /home/$USER
$ vi .bash_profile
You can also edit .bash_profile with more user friendly text editors as "Gedit".
To the bottom of the file -before #END- :
PATH=$PATH:/opt/Sourcery_G++_Lite/bin
export PATH
Restart your computer to apply the changes.

For Ubuntu
$ gedit .bashrc
To the bottom of the file add the lines below:
PATH="/home/$USER/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
export PATH
PATH=$PATH:/opt/Sourcery_G++_Lite/bin

Restart your computer to apply the changes

Now we are able to cross-compile our projects with mips-gnu-linux.

Note: If you are using Ubuntu and encounter a problem during compilation like:
gcc version 4.3.2 (Sourcery G++ Lite 4.3-51) GCC version should be gcc version 4.3.2. please check it!!
make[1]: *** [check_gccver] Error 99 

and compilation fails, you should make some modifications:
Make sure that the symbolic link /bin/sh points to /bin/bash rather than /bin/dash (for Ubuntu 7.04+ dash is the default, check it). To change it run the following command (with root priviledge):
$ sudo rm /bin/sh
$ sudo ln -sf /bin/bash /bin/sh

$ ls -alh /bin/sh

 Try to compile again your project, everything has to be OK now!
 


 
 







10 Kasım 2012 Cumartesi

Ubuntu 12.04 System Configuration for Nvidia Optimus Graphic Card

After proper installation of Ubuntu 12.04, I faced with Graphic card and Power management problems with my Z570 notebook. In this release, I will try to explain how I handled these issues.

If your notebook has a Nvidia Optimus graphic card, this means that your notebook having two graphic cards. One of them is Nvidia and the other one is Intel HD most probably. While you're using Windows 7, the Windows 7 drivers provide a switching between these graphic cards according to performance requirements.

In order to handle this issue, I will advice the readers to follow the instructions at the given web site: https://wiki.ubuntu.com/Bumblebee

There are infinitely many rubbish information about Bumblebee, so using the link above will be enough for this issue. If you encounter a problem like "Cannot find bumblebee and bumblebee-nvidia package", ensure that in UpdatesAvailable-->Settings->Software Source-->OtherSoftware the bumblebee package selections are ticked.

Please do not install any drivers for Nvidia before Bumblebee installation. If you have already installed Nvidia drivers, you shall purge them by:
apt-get purge nvidia-current
rm /etc/X11/xorg.conf
reboot now
In fact, Bumblebee will install nvidia drivers itself. After installation of Bumblebe, you should reboot the system.
After reboot, you should check your Graphics card shown in "System Details". Mine is "Intel® Sandybridge Mobile
x86/MMX/SSE2".
If you have an improper resolution as 640x480, I suggest you to make the changes given below:
In /etc/X11/xorg.conf, look for these two lines :
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
and replace them with
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 75.0
Reboot or Logout to apply the changes.
Finally, in order to test if your Nvidia Graphic card is working properly in Ubuntu, open the terminal and write the command:
optirun glxspheres 
You can see the similar lines as given below on the terminal:
sezerb@sezerb-Ideapad-Z570:~$ optirun glxspheres
Polygons in scene: 62464
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GT 520M/PCIe/SSE2
97.621786 frames/sec - 108.945913 Mpixels/sec
103.086423 frames/sec - 110.279806 Mpixels/sec
106.882137 frames/sec - 104.728248 Mpixels/sec
 
This is how "optirun" commands work. For instance if you want to use your Nvidia card with firefox, you should write:
optirun firefox 
Bumblebee also sets the power switch of your Nvidia card to OFF if you are not using "optirun" command.
This provides power management and long battery life.
Note: In Bios Configuration menu, one can easily select the switchable graphic card option or the Integrated card option. 
If you do not want to use Nvidia card, you can handle this from Bios.
 
Update @08.12.2012
If you have hybrid graphic cards and if your system allows hardware mux between these cards, you can use also use
vga_switcheroo  (supported by radeon, nouveau) (not supported by nvidia, fglrx)
https://help.ubuntu.com/community/HybridGraphics   
 
References 
 https://wiki.ubuntu.com/Bumblebee
 http://askubuntu.com/questions/201123/screen-resolution-stuck-at-640x480-after-installing-bumblebee
 
   
   
     

 
 

Hello World! Installing Ubuntu to Lenovo Z570 Notebook


This is my first release to my blog. I'm starting with an important but simple issue: Installing Ubuntu 12.04 to my Lenovo Z570 Notebook. Installing any Linux distro is not a difficult job, but if you do not want to damage your Windows 7 and Windows Recovery partitions in harddisk and also if you want to use multiple OS at the same time, this publication will be useful for you.

First of all, I shall thank to Edwin W. Meyer who provides very useful informations in his website for this issue. (http://edwinmeyer.com/LenovoUbuntuWin7DualBoot.html)

I've followed the instructions up to the section "4. Install Ubuntu 10.10". The instructions above this section is highly important for a proper installation. When I come to the section 4 of the document, I started the Install procedure but I did not choose the custom one, I chose the option "Install Ubuntu Alongside Windows 7". Ubuntu found my unallocated space which is located at the very beginning of D drive and installed itself to that area. It also arranges all stuff related with Windows and Linux bootloaders. So when system rebooted, everything was fine. In Boot menu Ubuntu 12.04, Windows 7 and Windows Recovery selections are available. All of them is functioning properly, even the recovery button.

Thanks to Ubuntu 12.04 for smoothing our way to victory!..

References
http://edwinmeyer.com/LenovoUbuntuWin7DualBoot.html