星期四 四月 03, 2008


As a classic file
system,NFS played an important part in unix system.In this acticle I
will introduce how to use NFS including configuring NFS server and
client.

NFS Server:

In the console,you can use dfshares to the existing NFS server shared directory.

# dfshares


nfs dfshares:swustcs: RPC: Program not registered

because nfs is based on RPC(Remote procedure call),you must register RPC first,such as the command below:

#/usr/lib/nfs/mountd

Start NFS server(it is active by default):

#svcadm enable network/nfs/server     (you can also stop it by: #svcadm disable network/nfs/server)

 

Set share directory on NFS Server

#share -F nfs -o ro=swustcs /cdrom

 
NFS Client:

In order to share NFS server resource,you must start the nfs service at the client:
list nfs service:

# svcs | grep nfs
online         15:43:28 svc:/network/nfs/rquota:default
online         15:43:29 svc:/network/nfs/mapid:default
online         15:43:29 svc:/network/nfs/status:default
online         15:43:31 svc:/network/nfs/nlockmgr:default
online         15:43:33 svc:/network/nfs/server:default

Check the shared directory:

# showmount -e
swustcs 的导出列表:
/cdrom swustcs

create a directory to mount shared directory:

# mkdir /nfstest

 
mount the shared directory to local directory:

# mount -F nfs swustcs:/cdrom /nfstest

read the directory:

# ls /nfstest
cdrom0      sol_11_x86
# ls /nfstest/sol_11_x86
autorun.inf                  JDS-THIRDPARTYLICENSEREADME
autorun.sh                   License
boot                         README.txt
Copyright                    sddtool
DeveloperTools               Solaris_11
installer
#


umount the shared directory:

# umount /nfstest
# ls /nfstest

 

 

Cai Xiaowu

csqqer@gmail.com
 


星期二 四月 01, 2008

This afternoon, Baihui and I went to JinLing institute of technology to hold a Solaris tech talk.These days, I have prepared some my own new elements in my odp.I introduced some moves before some Solaris features were talked about. 
                               
The first move name is The ShawShank Redemption.I like this move,however,the Oscar's best file is Forrest Gump in 1994.In the move, the actor tells us we should have hope in our life.Of cource,it is very ingenious way to break prison.But if  i assume that there are lots of searchlights in every places of prison,maybe the actor can't have the sucessful experience.The same function is Solaris Dtrace,there are about 50,000 probes for dynamically tracing in a live running system.You can use dtrace in kernel, applications, process and so on.
The second move name is The Matrix.As we know,the Virus Smith have changed stronger and stronger, he can enter different environment, and only the human's hero Neol can defeat him.But if we can isolate the Virus Smith in one environment so that he can't damage other environment,the world will be better.So Solaris virtualition can achieve the aim.We can use different type virtualition,such as XVm, Container, and Logical Domains.If some system or environment can't run nor be damage by computer virus,Solaris virtualition can let other systems or environment continue to run,and we can concentrate to deal with the damaged one.
The third move name is  A Chinese Odyssey.It is about Chinese tragic love story.The actors include the Chinese famous actor Stephen Chow.In the move, the actress leave one thing in actor's heart.But the actor still do not know what it is unless he reincarnate immortality.The drop of tear tells him that he love the actress.But if we could let the actor know what it is at once when the actress leave something in his heart,maybe there will be the happiness result.Solaris ZFS can detect and tell you what's exact wrong with data,furthormore, it can correct the data corruption. That's a great function in system!

星期一 三月 31, 2008

 Hi,everybody. I am Yao Lu,from Chongqing,China. This is my first article in blog.sun.com. I want to show you some little demo about Solaris Dtrace,Zone,ZFS. If you are a beginner for Solaris,it is useful for you. You can use these simple demos to experience the new feature of Solaris.


 Zone


Zones provide a new isolation primitive for the Solaris OS, which is secure, flexible, scalable and lightweight: virtualized OS services which look like different Solaris instances.


bash-3.00# zonecfg -z test-zone


zonecfg:test-zone> create                            


zonecfg:test-zone>set zonepath=/export/home/test-zone
zonecfg:test-zone> add net
zonecfg:test-zone:net> set physical=bge0
zonecfg:test-zone:net> set address=129.158.163.232
zonecfg:test-zone:net> end
zonecfg:test-zone> verify
zonecfg:test-zone> commit
zonecfg:test-zone> exit


bash-3.00# zonecfg -z test-zone info


zoneadm -z test-zone install


bash-3.00# zoneadm list -cv


bash-3.00# zoneadm -z test-zone boot


bash-3.00# zoneadm list -cv


bash-3.00# zlogin test-zone


bash-3.00# ifconfig -a


 


ZFS


The Solaris ZFS offers a dramatic advance in data management with an innovative approach to data integrity, tremendous performance improvements, and a welcome integration of file system and volume management capabilities.



 mkfile n 100m file1


mkfile n 100m file2


mkfile n 100m file3


mkfile n 100m file4


mkfile n 100m file5


zpool create pool raidz /file1 /file2 /file3 /file4 /file5


zfs create pool/first


zpool list


SUN University Tech Day Demo(Chengdu,China)


In addition,I have taken part in Sun University Tech Day in Chengdu,China,2007. The speaker,Alex Peng,shows us a demo about ZFS.He made a zpool by using some U disks,and he copied a xxx.mp3 into the zpool. The XXX.mp3 has been played. Then he demounted the U disks one by one until only one U disk was in the zpool,But the music could be still playing.


Demo:


rmformat   (display U disk id, for example,c0t0d0,c0t0d1……)


 zpool create f upool raidz cxtxdx……….


 ls l /upool


 cp /desktop/xxx.mp3 /upool/


 realplay/upool/xxx.mp3 &


 


 Dtrace:


DTrace is a comprehensive dynamic tracing framework for the Solaris™ Operating Environment. DTrace provides a powerful infrastructure to permit administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.


Make a file ,and filename is ‘hello.d’


 BEGIN


 {


trace(“hello,SUN”);


exit(0);


}


 DTrace –s hello.d


 DTrace –l


 DTrace –l|wc -l


 


Yao Lu


e-mail:luyaochrist@163.com


msn: christ_878@hotmail.com


Thank you very much!


 


 

Problem:


1.      We install Solaris b79 first and install Windows later in the lab, but the MBR was destroyed and the Grub does not work.


2.      Only one PC in the lab has CD-ROM and others does not have.


Solutions:


1.      Solution of PC with CD-ROM


1)     Prepare a Solaris X86 CD or DVD. Set up the machine boot from CD-ROM.


2)     Enter “c” into the grub in the grub form.


3)     Find the installed Solaris with following methods:


grub>find /platform/i86pc/multiboot


(hd0,1,a)--------------------output


OR:  grub>find /boot/grub/menu.lst


       (hd0,1,a)--------------------output


4)     Set the output to root device


grub>root (hd0,1,a)
Filesystem type is ufs, partition type 0xbf


5)     Set the boot and archive files and boot from grub


grub>kernel /platform/i86pc/kernel/unix
grub>module /platform/i86pc/boot_archive
grub>boot


So we can boot Solaris X86 from grub.


6)     After logining to Solaris, steup grub as root, and reboot


#cd /usr/sbin
#installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0


Output:


Updating master boot sector destorys existing boot managers (if any)
Continue (y/n)? y
stage1 written to partition 1 sector 0 (abs 31455270)
stage2 written to partition 1, 233 sectors starting at 50 (abs 31455320)
stage1 written to master boot sector


#reboot


7)     Successful….


2.      Solution of PC without CD-ROM


1) Set the Solaris partition active in Windows


   Find the partition Which Solaris installed and set it active.


2    2) Reboot the computer. Because the MBR has been changed, the Windows cannot be boot. But after it we can enter the grub.


3) After entering the grub, we can adopt the solution above from the third step to the seventh step. And we can relax after installed the grub again.


See: http://developers.sun.com.cn/blog/BingfengHong/entry/solaris10_x86_windows%E5%8F%8C%E7%B3%BB%E7%BB%9Fgrub%E5%BC%95%E5%AF%BC%E4%BF%AE%E5%A4%8D%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88