Saturday, November 28, 2009

Pool Mirrored

I just bought another drive for my trusted OpenSolaris box to create a mirror for my data.

The command to create the pool is deceptively simple:


pfexec zpool attach poolname original_drive new_drive

To get the name of the pool and the original drive name:

pfexec zpool status

How about the name of the new drive? The only way I can think of is:

pfexec format

Comparing the outputs of the above commands will let you find the name of the new drive.

Example:
cuppa@opensolaris:/datapool$ pfexec format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c7t0d0
/pci@0,0/pci1458,b002@11/disk@0,0
1. c7t2d0
/pci@0,0/pci1458,b002@11/disk@2,0
2. c7t4d0
/pci@0,0/pci1458,b002@11/disk@4,0
Specify disk (enter its number):
Next we will check the status of my existing pools:


cuppa@opensolaris:~$ pfexec zpool status
pool: datapool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
c7t0d0 ONLINE 0 0 0

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7t2d0s0 ONLINE 0 0 0

errors: No known data errors
cuppa@opensolaris:~$
Comparing the two outputs, it shows the device 'c7t4d0' is not used and therefore the new drive.

Adding it as mirror is straightforward:

pfexec zpool attach datapool c7t0d0 c7td4d0

Final product:

cuppa@opensolaris:~$ pfexec zpool status datapool
pool: datapool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
mirror ONLINE 0 0 0
c7t0d0 ONLINE 0 0 0
c7t4d0 ONLINE 0 0 0

errors: No known data errors
cuppa@opensolaris:~$




WARNING: If you got the order of drive names wrong, you risk overwriting all your data!!! Be careful.

Friday, November 27, 2009

On Compiling OCaml

I just finished compiled OCaml from source on Opensolaris (2009.06), the latest version at this time of writing is 3.11.1.

The steps are straight-forward except one catch: The build is dependent on gcc and gnu make. In fact the default 'make' program that comes with Solaris won't work.

Solution is simple: go to www.blastwave.org and download the relevant packages. Just follow their instructions and you should be fine. :)

On an unrelated note, I miss her again but don't have anyway to contact her anymore... :(

FreeBSD 8 is Out

Production-grade FreeBSD 8 is released, and I have found FreeBSD more and more attractive as the OS of choice for my home server (as compared to OpenSolaris). Slashdot has a comprehensive coverage for it here with reviews, upgrade instructions, and screenshots.

So far I have not seen much development in OpenSolaris: the latest snv_128 snapshot cannot even boot on my amd64 system, so i am stuck with the 2009.06 of OS.

FreeBSD has added some interesting features, and ZFS is one of them. Unfortunately FreeBSD only supports up to version 13 of the ZFS, while my data is stored in version 14 format and this is an issue. Any slight mistake in migration will see all my data gone, which is something I hate to see happening.

I am still considering the relative merits of migrating to FreeBSD, the adding of more and more GNU tools and greater Linux compatibility has made this Unix quite a strong contender as desktop OS.

On the other hand, my current OpenSolaris setup is working properly as a file and general purpose server. I have spent more and more time using it as opposed to my Windoze machine nowadays. So I have to give OpenSolaris due credit for its stability and performance.

BTW, there are movements to put Debian on the FreeBSD and OpenSolaris kernel, though these two ports don't seem to have much development nowadays.

Saturday, November 21, 2009

Thoughts of the day

In no particular order....
  • As you might see my previous blog entry, it consists only two dots with a counter there. Weird as it is, I got two blank emails last few days and it really again perturbed my supposedly peaceful life. I still miss her. sigh...
  • The interviews went quite well and I think after two more sessions next week, I should be able to secure the job. I can't divulge which company and what it does. Though its products are madly popular and fashionable these days [hint hint]
  • Watched 2012 just now, and am amused at the scene where the government assured the people the worst is over just hours before the country got hit upside down. Amusingly, in our real world, aren't there some governments said the recession is over and the worst has past? Hmmm.... :)

Thursday, November 12, 2009

.

.

==
count = 2

Tuesday, November 10, 2009

Engineering or Not?

Updated Nov 11:
The news just broke Ericsson will spend less on its R&D, therefore shut its UK site by next year and whatever remains will be relocated to "lower cost-base countries"

This is totally not surprising because Ericsson is for-profit and has shareholders to report to. Those shareholders care only their return of investment, nothing else. This kind of stuff happens at UK now, and it will soon happen in Singapore.

Hence what should engineers do NOW? I will say we should have more breadth in more fields, especially business. Nowadays everything centrals around money, and often times, a profitable tech product is not necessarily solid technically, examples abound: IP (The one in the TCP/IP suite), NTSC standard, and yes, the MS Windows as when it first appeared.

"Stay hungry, stay foolish" -- Steve Jobs
============
Nowadays my usual topic with Mr. Snail will be about the prospect of engineering in Singapore, and despite I tried my best to be optimistic, the future of engineering here still doesn't seem so bright.

A few days ago I grew curious and searched google on this topic, and found a few discussion threads with hundreds of replies from former and current engineers, all venting fumes on more or less what I and Mr. Snail talked about.

Here are two of the threads I found: one, two.

If you don't have the time to plow through them, here is the gist (all currency in SG$):

  • Engineering pay is pathetic in Singapore, with fresh grads starting around $2.7K (manufacturing) or $3.5K(R&D). The money seems much better in finance and banking, which can go around $5.5K for fresh grads while five digit salaries are very common in banks.
  • One person even boasted an annual salary of $300K + stock options doing sales
  • A lot of engineers want to exit engineering and jump ship
  • Those who remain in engineering are damn bitter
Some people reasoned banks only employ a few people for trading but rack in millions, ergo each of them can get a significant amount of money after dividing the loot. While in engineering, there are a lot of overheads (RnD, raw materials, factory spaces, machinery, etc.) and the profits are divided thinly among number of staff. Therefore banking is the best occupation in terms of benefits and money.

But what I don't understand is: what those bankers do are NOT adding values to the economy, there is no real outputs and basically banks are just fucking with other people's money and grow things from nothing! What are the contributions of the financial sector and banks nowadays? except charging some exorbitant fees on basic banking transactions, giving meager interests on our savings but charging an arm and a leg for the loans. When the loans go bad, poof, they are written off and the government will use OUR money to bail those banks out.

No wonder everybody wants to be banker.

If you really wanna enter the banking sectors, I was told these two websites are compulsory readings:

Mark Joshi
E. Derman

Thursday, November 05, 2009

Ten Meaningful Quotes

These quotes are from the net, and I don't know who the original author is. The translations are to my best effort, certainly there could be better ones and you are welcome to help out. :)

第一句话:如果我们之间有1000步的距离,你只要跨出第1步,我就会朝你的方向走其余的999步。
[First Quote]: If there are 1000 steps between us, as long as you take the first one, I am willing to walk the remaining steps towards you.

第二句话:通常愿意留下来跟你争吵的人,才是真正爱你的人。

[Second Quote]: Usually the one who stays back to argue with you is the one who truly loves you.

第三句话:付出真心,才会得到真心,却也可能伤得彻底;保持距离,就能保护自己,却也注定永远寂寞。

[Third Quote]: Give out your heart, only then you will get one from others, but you could hurt thoroughly in the process; keeping a distance with others can protect yourself, but it also means you are destined to eternal solitude.

第四句话:有时候,不是对方不在乎你,而是你把对方看得太重。

[Fourth Quote]: Sometimes it is not the other person doesn't care about you, it is you who put too much attention on that person.

第五句话:朋友就是把你看透了还能喜欢你的人。

[Fifth Quote]: A friend is someone who knows you thoroughly but still chooses to like you.

第六句话:就算是believe,中间也藏了一个lie。

[Sixth Quote]: Even the word 'believe' has an 'lie' embedded within

第七句话:真正的好朋友,并不是在一起就有聊不完的话题,而是在一起,就算不说话也不会感到尴尬。

[Seventh Quote]: Real good friends don't have to have infinite amount of topics to talk about; but instead, when they are together, they won't feel awkward for not talking.

第八句话:没有一百分的另一半,只有五十分的两个人。

[Eighth Quote]: There is no 100% perfect partner, only two 50% persons

第九句话:为你的难过而快乐的,不是善人;为你的快乐而快乐的,是朋友;为你的难过而难过的,就是那些该放进心里的人。

[Ninth Quote]: Those who feel happy over your sorrow are not kind souls; those who are happy over your happiness are your friends; those who feel your sadness are those whom you should put inside your heart

第十句话:冷漠,有时候并不是无情,只是一种避免被伤害的工具。

[Tenth Quote]: Indifference, sometimes doesn't mean lack of emotions, it just serves as a tool to avoid injury.

这十句话很有意思,也很有深度,值得认真去思考,也许会有意想不到的收获。但请记住:没有绝对正确的话,不要过于迷信某一两句话,要结合具体情况进行具体的分析,没有自已的思考与判断,好话也会害死人。

These ten quotes have quite profound meanings and deserve some extra thoughts. But please note: There is no absolute truth, use your own discretion on these advices.