Category Archives: OS

sda must have a gpt disk label

安装RHEL时遇到sda must have a gpt disk label的错误,解决方法参考了:
I got error ‘sda must have a gpt disk label’ when I was installing RHEL 6.5 64bit. I got solution from the URL above

I. Press ‘CTRL+ALT+F2’ to get into cml

2.输入parted /dev/sda,进入parted状态,
II. Use ‘parted’ to enter ‘parted’, chose your disk

3.输入mklabel gpt,提示所有数据将被删除,输入yes  //原博客这里写成了pgt,应该是gpt
III. Use ‘mklabel gpt’ to force the disk use gpt, answer yes when the prompt of erasing all data (Caution!!! Be sure you want to erase all data on the disk)

IV. Press ‘CTRL+ALT+F6’ to go back to installation UI

Solaris tips(I)

  • stop cacao process

root@felix1 [/] # cacaoadm stop

  • stop desktop process

root@felix1 [/] # svcs -a | grep graphical
online         Sep_18   svc:/application/graphical-login/cde-login:default
root@felix1 [/] # svcadm disable cde-login
root@felix1 [/] # svcs -a | grep graphical
disabled       18:08:37 svc:/application/graphical-login/cde-login:default

  • check the WWN

fcinfo hba-port | grep WWN

  • swupna.jar process

edit /usr/dt/config/Xsession.d/1001.swupnot to comment out the line and kill the process

  • force send mails in queue

/usr/lib/sendmail -q -v

  • route -p xxx writes to /etc/inet/static_route
  • privilege to capture packet on bge

chmod 666 /dev/bge

  • enable mpxio in Solaris 10 for 3par 7200

add configuration to /kernel/drv/scsi_vhci.conf

 device-type-scsi-options-list =
“3PARdata”, “symmetric-option”;

symmetric-option = 0x1000000;

use /usr/sbin/stmsboot -e to enable multi-pathing
  • checksum and md5

digest -v -a md5 a.tar

cksum a.tar
digest -v -a sha1 a.tar
  • show mac address by ilom

show /SYS/MB/NET0

  • dbm map “Alias0”: missing map file /etc/mail/aliases

under /etc/mail,

# makemap hash aliases.db < /etc/mail/aliases
  • Solaris 10 language package installation
1 prepare language packages.
All language packages locate in /mountpath/Solaris_10/Product/ of Solaris DVD.
You can either mount an OS iso or nfs source from other servers.
2 list languages which have been installed already
# locale –a
3 install language packages
# localeadm –a korean  -d /cdrom/cdrom0/Solaris_10/Product install Korean
# localeadm –a zh_CN –d /cdrom/cdrom0/Solaris_10/Product install simplified Chinese
Log file is /var/sadm/install/logs/localeadmin_install.2014-01-28
locale/region name is zh_cn
Warning! You have chosen the zh_CN locale rather than a region to install.
This locale is part of the Simplified Chinese region. If you choose to continue, all of the locales in this region will be installed.
Do you wish to continue? [y/n]: y
Adding packages for Simplified Chinese (china)
Region china will be installed.
It takes a few minutes to finish the installation.
4 list languages installed on server
bash-3.2# locale -a

zfs的迁移(zfs migration)


1. 创建zpool

zpool create ztest c1t3d0

2. 拷贝数据并export

zpool export ztest


3. 把磁盘添加到另外一台主机,查看可否import

-bash-3.2# zpool import
pool: ztest
id: 3289554358798268199
state: ONLINE
action: The pool can be imported using its name or numeric identifier.

ztest ONLINE
c1t5d0 ONLINE

4. 直接import

-bash-3.2# zpool import ztest
-bash-3.2# df -k
Filesystem kbytes used avail capacity Mounted on
rpool/ROOT/s10zfsdb 30707712 10978054 13975936 44% /

rpool 30707712 42 13975936 1% /rpool
ztest 10257408 31 10257323 1% /ztest


Solaris 10 network installation/网络安装提要

Server side
1. Find the mac address of client
2. Edit /etc/ethers, to add the MAC address into the file:
0:14:4f:79:b4:56        Meno
3. Add hostname and IP to /etc/hosts    Meno
4. Download the ISO files and mount
a. lofiadm -a /data/sol10-u11.iso

b.  lofiadm —–check result
c.  mount -F hsfs -o ro /dev/lofi/1 /a
5. Add client
cd /a/Solaris_10/Tools
./add_install_client Meno sun4u
6. Check NFS/RPC bind and NFS share
svcs -a | grep nfs
svcs -a | grep rpc/bind

online 21:46:22 svc:/network/rpc/bind:default
online 21:46:23 svc:/network/nfs/server:default
online 21:46:23 svc:/network/nfs/mapid:default
online 21:46:22 svc:/network/nfs/rquota:default
online 21:46:23 svc:/network/nfs/status:default
online 21:46:23 svc:/network/nfs/nlockmgr:default
online 21:46:22 svc:/network/rpc/bootparams:default
online 21:45:18 svc:/network/rarp:default
# share
–               /a   ro,anon=0   “”
{0} ok boot net – install

Solaris 10 Patch Issues Summary

1. If you removed /var/sadm/pkg/*, you’ll not be able to maintenance the normal patch process. Maybe you get an error:

Target boot environment not identified as solaris 10

The reason is missing of SUNWcsr and SUNWcsu

Solution: if you have the same OS with the same patch level, duplicate the /var/sadm/pkg/* to this server. Then install the recommended patch

2. Don’t put the unzipped patch cluster in a directory that the “nobody” cannot read. Otherwise you’ll not be able to install any patch.

3. If you want to save disk space of /var, you can remove /var/sadm/pkg/*/save. You’ll not be able to revert to previous patch version but doesn’t impact next patch

mesg: cannot change mode

如果profile里加了mesg n 这句话,在使用su – 的时候会得到mesg: cannot change mode的提示,这是因为su – 的用户不能改变登陆用户的mesg的mode,事实上不影响tty或者terminal的状况,所以可以忽略

DNS失效导致CSS disable service IP

现象:app服务正常,进程正常,可以telnet private IP,但是telnet service IP不通,CSS看到端口是down的,实际上服务器上是up的
问题原因:由于DNS服务器down掉,导致CSS在bind app服务器的时候,app server反解CSS IP地址需要很长时间才能timeout,但是CSS没有得到response就timeout了,所以导致CSS认为端口是down的,所以就disable了service IP

另外一个现象:把CSS的IP加入hosts之后,service IP不down了,但是ADS服务器出问题的时候,客户连接进来还是会反解超时,导致服务中断
解决方案:把resolv.conf配置加一个options rotate,使用round-robin模式

vxfs corrupt导致cluster file system不能online

在移除CFS节点的时候,由于没有运行cfsumount再进行cfscluster stop操作,导致vxfs文件系统损坏,这样文件系统资源挂不上,并且有如下报错:
/dev/vx/dsk/ShareDG/Mainvol1 is corrupted. needs checking
root@Rhada # /opt/VRTS/bin/fsck -F vxfs /dev/vx/dsk/ShareDG/Mainvol1
log replay in progress
log replay failed to clean file system
file system is not clean, full fsck required
full file system check required, exiting …
root@Rhada # /opt/VRTS/bin/fsck -F vxfs -y -o full /dev/vx/dsk/ShareDG/Mainvol1
log replay in progress
pass0 – checking structural files
pass1 – checking inode sanity and blocks
pass2 – checking directory linkage
pass3 – checking reference counts
pass4 – checking resource maps
au 5286 emap incorrect – fix? (ynq)y
au 5286 summary incorrect – fix? (ynq)y
free block count incorrect 94503896 expected 94536664 fix? (ynq)y
free extent vector incorrect fix? (ynq)y
OK to clear log? (ynq)y
flush fileset headers? (ynq)y
set state to CLEAN? (ynq)y
root@Rhada # hastatus -sum

Login got slow with NFS on Solaris / Solaris 在mount了NFS时login变慢

Issue: Login got slow, su to normal user slow, but su to root not effected

检查:在/etc/profile添加检查点,发现原因是执行 /usr/sbin/quota 这一步时很慢,但是系统没有启用quota,只是挂接了NFS
Check: Add checkpoint to /etc/profile and found the step “/usr/sbin/quota” is very slow, but the system hasn’t quota set up, only mounted NFS

Reason: Normally, it’s ok without firewall, but it’s slow when the firewall blocks the rquotad packages

Solution: use noquota option to mount NFS, for example:
# mount -F nfs -o noquota server1:/dir1

登陆慢的另外一个原因也可能是你的DNS server没办法解析你的地址,把ip地址加入/etc/hosts即可

CentOS上开启samba配置/Enable samba with selinux/iptables on CentOS

在CentOS 6.3上开启Samba服务,其中涉及到安装samba包,编写配置文件,开启iptables,配置selinux。
1. Install samba
# yum search samba
# yum install samba.x86_64

2. Configure a simple samba,
workgroup = workgroup
netbios name = whatever
server string = whatever
security = share
log file = /var/log/samba/%m.log
max log size = 50
path = /data1/dir1
writeable = no
browseable = yes
guest ok = yes
public = yes

# service smb start

3. 配置iptables
-A INPUT -m state –state NEW -m tcp -p tcp –dport 139 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 445 -j ACCEPT
-A INPUT -p udp -m udp –dport 137 -j ACCEPT
-A INPUT -p udp -m udp –dport 138 -j ACCEPT
# service iptables restart

4. 配置selinux
# getsebool -a | grep samba
samba_create_home_dirs –> off
samba_domain_controller –> off
samba_enable_home_dirs –> off
samba_export_all_ro –> off
samba_export_all_rw –> off
samba_run_unconfined –> off
samba_share_fusefs –> off
samba_share_nfs –> off
sanlock_use_samba –> off
use_samba_home_dirs –> off
virt_use_samba –> off
# getsebool -a | grep smb
allow_smbd_anon_write –> off

# setsebool -P samba_export_all_ro on

5. 完工!