Cloning Ubuntu installation

26 04 2009

Hi you might want to upgrade your disk from time to time, so you either need to clone or ghost it. Heres how I do it.

First prepare the disk with the GUI tool gparted. I like to have a few partitions, one for winblows, one for winblows games, one for ubuntu and one ext3 for storage.

Then copy your system (remember not to have too many apps open at this time wierd stuff could happen once you start up the other disk)
Open a terminal and write:

sudo rsync -a -x --exclude /media/newdisk / /media/newdisk

Make grub active on the new disc, in the same terminal or another write:

grub> setup (hd0) (hd0,0)

Which installs grub into the MBR of hd0 (hda) using the boot files that were already in /boot on hd0,0 (hda1).

Now you can do "kernel (hd0," and then tab in the grub command line to find partitions. Once you identify your drive you should also be able to do the math for the partition.

Okay almost done, now we have to go edit the grub menu.list located under the /boot folder of the new disk, ubuntu are using uuids to identify partitions. So it’s time to open gparted again, remember that we did it the last time from a terminal, we do the same thing again “sudo gparted”, and find the partition where you copied the system to and then right click and press info now theres a field called uuid, copy paste those into the appropriate of the menulist like here :

example

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 49753240-3c10-4fdb-a624-6b07b5071d09
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=49753240-3c10-4fdb-a624-6b07b5071d09 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Windows XP Home
uuid 4D9D89C529CA8435
makeactive
chainloader +1

So before wiping the old disk I suggest that you try booting the new one, just in case something went wrong. I had no troubles with it, but it’s always nice to have a backup.. Most motherboards today have a option to boot from different disks.

I’ve used this blog here as source http://encodable.com/tech/blog/2006/10/30/Ubuntu_Linux_Hard_Drive_Upgrade
as well as this one http://samuelcheng.wordpress.com/2009/02/04/transferring-ubuntu-to-new-harddrive/





Adjust Webcam settings ubuntu

8 04 2009

My solution was to run this small tool :

luvcview -f yuv -l

I have a creative live im ultra.. Works like a charm.. Now if I could only get my twin display working when I play games!





Wicket continues to impress me

11 12 2008

So I wanted to put in a conditional css thing to fix a IE problem, todo this thing in wicket I just though up a way. And wrote the code, it just worked:)

Heres how:
Markup (in head):

<style wicket:id="ieStyle" type="text/css">

</style>

A simple webmarkupcontainer, to put in the hack (with a resource reference)::

add(new WebMarkupContainer("ieStyle"){

@Override
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
super.onComponentTagBody(markupStream, openTag);
String csshoverurl=urlFor(new ResourceReference(BasePage.class,"csshover2.htc")).toString();
getResponse().write("" +
"body {" +
"behavior: url("+csshoverurl+");" +
"}");

}

}

And to finish it up make it conditional so only IE picks it up, by adding a behavior:

public class IECheckBehaviorBehavior extends  AbstractBehavior {
public IECheckBehaviorBehavior() {
}
@Override
public void beforeRender(Component component) {
super.beforeRender(component);
Response response = component.getResponse();
response.write("*!--[if lt IE 7]&gt;--*");
}
@Override
public void onRendered(Component component) {
super.onRendered(component);
Response response = component.getResponse();
response.write("*![endif]--*");
}
}

The result:

<!--[if lt IE 7]&gt;-->
body {behavior: url(resources/zeuzgroup.web.page.BasePage/csshover2.htc;jsessionid=1pjzdpc4j8asn);}
<![endif]-->

Simple and and almost clean 🙂

Ps updated the post to show correct source





Ubuntu Benchmarking

13 08 2008

So you want to benchmark your ubuntu box?

Test your harddrives:

hdparm -tT /dev/sda

results
/dev/sda:
Timing cached reads: 276 MB in 2.00 seconds = 137.91 MB/sec
Timing buffered disk reads: 58 MB in 3.05 seconds = 19.05 MB/sec

For cpu & network you can run

Super pi:

Command line(installation):

ftp

open pi.super-computing.org

cd Linux

get super_pi.tar.gz

tar -zxvf super_pi.tar.gz

to run:

./super_pi 2

results:

End of main loop
End of calculation. Time= 194.060 Sec.
End of data output. Time= 0.870 Sec.
Total calculation(I/O) time= 194.930( 6.760) Sec.

Hardinfo runs with an gui or in your command prompt:)

Do this from command line:

sudo apt-get install hardinfo

Then

hardinfo

Lay back and watch benchmark commence, heres my results for my really low end p3 500 mhz 512 mb box:

CPU ZLib
——–

-CPU ZLib-
<i>This Machine</i> : 4274,070
PowerPC 740/750 (280.00MHz) : 2150.597408
Intel(R) Celeron(R) M processor 1.50GHz : 8761.604561

CPU Fibonacci
————-

-CPU Fibonacci-
<i>This Machine</i> : 20,012
Intel(R) Celeron(R) M processor 1.50GHz : 8.1375674
PowerPC 740/750 (280.00MHz) : 58.07682

CPU MD5
——-

-CPU MD5-
<i>This Machine</i> : 14,664
PowerPC 740/750 (280.00MHz) : 7.115258
Intel(R) Celeron(R) M processor 1.50GHz : 38.6607998

CPU SHA1
——–

-CPU SHA1-
<i>This Machine</i> : 16,703
PowerPC 740/750 (280.00MHz) : 6.761451
Intel(R) Celeron(R) M processor 1.50GHz : 49.6752776

CPU Blowfish
————

-CPU Blowfish-
<i>This Machine</i> : 69,238
Intel(R) Celeron(R) M processor 1.50GHz : 26.1876862
PowerPC 740/750 (280.00MHz) : 172.816713

FPU Raytracing
————–

-FPU Raytracing-
<i>This Machine</i> : 94,175
Intel(R) Celeron(R) M processor 1.50GHz : 40.8816714
PowerPC 740/750 (280.00MHz) : 161.312647