Today I wanted to setup a DHCP server on a machine installed with
Solaris Express. Within just a few minutes, it's done. :) Solaris has
improved a lot on operability, on user experience.
To do it, run "/usr/sadm/admin/bin/dhcpmgr" and follow the step by step instructions. Pretty easy, ahha.
创建zone
# zonecfg -z centos
centos: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:centos> create -t SUNWlx
zonecfg:centos> set zonepath=/export/centos_root
zonecfg:centos> add net
zonecfg:centos:net> set address=192.168.0.2/24
zonecfg:centos:net> set physical=e1000g0
zonecfg:centos:net> end
zonecfg:centos> commit
zonecfg:centos> exit
以下载的tar包为源安装CentOS
# zoneadm -z centos install -d /export/centos_fs_image.tar
A ZFS file system has been created for this zone.
Installing zone 'centos' at root directory '/export/centos_root'
from archive '/export/centos_fs_image.tar'
This process may take several minutes.
Setting up the initial lx brand environment.
System configuration modifications complete.
Setting up the initial lx brand environment.
System configuration modifications complete.
Installation of zone 'centos' completed successfully.
Details saved to log file:
"/export/centos_root/root/var/log/centos.install.9025.log"
检查安装后zone的状态
# zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- centos installed /export/centos_root lx shared
启动安装好的zone
# zoneadm -z centos boot
chichi# zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
9 centos running /export/centos_root lx shared
使用技巧 Index files: C-c s I Find global definition: C-c s d Find symbol definition: C-c s s Find this file: C-c s f Find functions calling this function: C-c s c Find functions called by this function: C-c s C Find this pattern: C-c s e Find this text string: C-c s t Find files including this file: C-c s i
(load-file "~/.xemacs/mas-file-history.el") ; creates a menu with a list of recently opened files (setq mas-file-history-menu-path nil) ; put the menu at the top of the XEmacs window (setq mas-file-history-menu-title "History"); the name of the menu (with-temp-buffer) ; this hack seems to be necessary
用“%”匹配对应的括号。
(global-set-key "%" 'match-paren)
(defun match-paren (arg) "Go to the matching paren if on a paren; otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1)))))
I installed Solaris Developer Release 1/08 on my machine and tried
with ZFS. I have to say that I was impressed by the powerful
functionality and easy usage model of ZFS. I used to maintain a
website server which is based on LAMP. Now I would take SAMP + ZFS as
a better solution. In SDR 1/08, Web Stack Admin provides
easy access to Apache2, MySQL and PHP, while ZFS shows immense
scalability, great data integrity and simple administration. SAMP
would be another topic. Here I just want to focus on how to start
using ZFS.
After installation, the default root system
is UFS. ZFS
boot is still in work. I converted Solaris slice c0d0s7, which is
mounted on /export to ZFS. Before creating zfs pools, remove
"/dev/dsk/c0d0s4 ..." entry from /etc/vfstab
and unmount it.
# umount /export
Now create a ZFS pool.
# zpool create zfs_export
c0d0s7
invalid vdev specification use '-f' to override the
following errors: /dev/dsk/c0d0s7 contains a ufs filesystem.
The command failed because the slice contained a ufs filesystem.
Add -f option to zpool create command.
# zpool create -f zfs_export
c0d0s7 # zpool list
NAME
SIZE USED AVAIL CAP HEALTH
ALTROOT zfs_export 66.5G 111K 66.5G
0% ONLINE -
Change mount point to /export.
# zfs set mountpoint=/export
zfs_export # zfs list NAME
USED AVAIL REFER MOUNTPOINT zfs_export
117K 65.5G 18K /export
Share /export via NFS as read/write.
# zfs set sharenfs=on
zfs_export # share
zfs_export@zfs /export
rw ""
Share /export via SMB.
# svcadm enable -r
smb/server
svcadm: svc:/milestone/network
depends on svc:/network/physical, which has multiple instances. #
svcs | grep smb online
13:28:03 svc:/network/smb/server:default # zfs set sharesmb=on
zfs_export # zfs set sharesmb=name=myshare zfs_export i#
sharemgr show -vp
I just released Solaris Atheros driver ath 0.7(source and binary) to
OpenSolaris laptop community. The notable feature of this new version
is ad-hoc(IBSS) mode support. The released package consists of two
parts:
net80211 module - 802.11 protocol kernel support
ath v0.7 driver - Atheros driver
With ad-hoc mode support, now you can connect two laptops(PCs) together directly via wireless connection.
What's Ad-Hoc Network
Ad-hoc network is also referred to as Independent BSS(IBSS). Stations
in IBSS network communicate with each other directly. It's in contrast
to Infrastructure BSS (sometimes briefly called BSS), in which a
special node known as access point(AP) manages communication among
other nodes. Below is an illustration.
Figure 1 Independent and Infrastructure BSS
Minimal configuration, flexibility and quick deployment make ad-hoc
networks suitable for emergency solution. One typical use is to create
an ad-hoc network for sharing data in a conference room to support the
meeting. When the meeting ends, the ad-hoc network is dissolved.
How to Configure
Ath 0.7 requires OpenSolaris build 68 or later version.
On the first laptop, create an IBSS with specific ESSID(wireless
network name) and WEP encryption. Even WEP is proved to be unsafe, it's
better than none.
Now the two computers are connected via ad-hoc network.
To get these two computers communicated with each other, manually setup IP address for each one as below:
# ifconfig ath0 192.168.xxx.xxx netmask + up
Ok, here you go.
Known Issue
Solaris IBSS doesn't support WPA yet. Also it's not on our todo list.
If it's an important feature for you, please drop a note to OpenSolaris
laptop community.
星期六 十二月 29, 2007
Solaris on MacBook
I've got another MacBook Pro with Intel 2GHz Core 2 Duo CPU. It's
installed with Mac OS X 10.4, but shipped with a Leopard installation
DVD. Having heard so much about Leopard (good and bad), the first thing
I did is upgrading.
Next thing is to install Solaris Developer Release 1/08 on MacBook. The
installation failed two times, and succeeded at the third time. It cost
me almost 4 hours. Below is a summary of the installation.
Step one, re-partition the hard disk. Bootcamp 2.0 has already been included in Leopard. Ran Finder->Applications->Utilities->Boot Camp Assistant
to create a Windows partition. Changing the partition size by dragging
the bar between two areas. Or alternatively, command line tool diskutil can also be used to shrink the HFS+ partition. Given a 150G hard disk, run below commands in a termal.
Step two, change EFI partition's ID to something that Solaris doesn't
understand. I did it in running Leopard. For safety, you may restart
and boot from the OSX installation CD. When the installer starts, run
terminal from tool menu. Umount the disk
# umount /dev/disk0
Change EFI partition's ID.
# fdisk -e /dev/rdisk0 setpid 1 AF write quite
Step three, install rEFlt show GUI boot menu. Download rEFlt form here.
Step four, change Windows partition to Solaris2 partition. Insert
Solaris Express install CD. Reboot and hold on "C" key to boot from CD.
Select "Solaris Express" from grub menu. On the next screen, Choose "4. .Solaris Interactive Text (Console session)". Continue with the installation until you see screen titled with "Solaris Interactive Installation". press F5 to exit installation. Then you'll be dropped to a terminal. Run format to re-create a Solaris2 partition.
# format Searching for disks...done AVAILABLE DISK SELECTIONS:
0. c1d0 <DEFAULT ... >
...
Specify disk (enter its number): 0 format> fdisk # Delete the third Windows partition and create a Solaris2 partition # Enter 5 to save and exit fdisk format> quit
Step five, run install-solaris on the terminal to restart the installation. Almost at the end, the installation will fail. It's an unknown bug 6413235. Exit the installation program to enter a terminal. Do workaround for 6413235.
# mount -o remount,rw /
# cd /sbin
# mv fdisk fdisk.real
# cat >fdisk
#!/bin/sh
echo "$*" | grep -- "-F" > /dev/null
if [ $? = 1 ] ; then
/sbin/fdisk.real $*
fi
CTRL-D
# chmod +x fdisk
Restart the installation by running install-solaris. Now you can finish the installation successfully.
Restart the Mac, now you'll see Solaris from the rEFlt boot menu, which is shown as a Linux penguin icon.
For how to make wired and wireless LAN work, please refer to my previous blog.
请
注意,上一篇文章给的示例应用程序其内存泄漏发生在堆(heap)上,当程序退出的时候,堆随之被释放掉,所以并不会对系统造成影响。而本文提供的示例驱
动tleak将在内核产生内存泄漏,所以请谨慎使用,不熟悉内核的朋友请不要在自己的机器上运行该驱动及以下步骤。(USE AT YOUR OWN
RISK)