存档

‘科技’ 分类的存档

Save private “LAT”

2006年12月3日 没有评论

Mount my harddisk to new machines, XP down, but CentOS/LAT would still startup. I want to play 3C with my fellows, and it’s two slowly in Linux cedege, I had to install a new XP without losing my private “LAT”. Grub manages the boot of harddisk, when choose boot from XP, blue screen happenes. The XP must be re-installed. Finally, I resolve this trouble by the following steps.

Add another new IDE harddisk , set it as “Master” and the old one as “Slave” , then boot from CD-ROM(XP CD inside) to install XP in master harddisk. Install a fresh mini CentOS on master, it will also use grub. Modify this mini CentOS’s grub.conf(Refer the former /boot/grub/grub.conf), and the “CentOS/LAT” entry. Yes, the private “LAT” was saved.

分类: 科技 标签:

Patch apply

2006年12月3日 没有评论

# $errnum = system(“$config{‘update_system_cmd’} $install_file doit_in_foreground >/dev/null 2>&1”);
#`echo Start install parameters – update.cgi – force install:$force_install >> /tmp/gui.dbg`;

my $TMP_LOG = “/tmp/tmp_install_patch.log”;
`echo “” > $TMP_LOG`;
my $cmd_out = system(“$config{‘update_system_cmd’} $install_file $force_install install 1>/dev/null 2>$TMP_LOG &”);
print qq(
);
print qq(

);

my $ps = 0;
my $pat = “Patching the system OS software under maintenance mode!”;
my $line_num = 1;
my $lines;
while(!$ps){
`ps -aef | grep SYS_InstallStartOSInstall | grep -v grep`;
$ps = $?;
my @var = `sed -n ‘$line_num,$p’ $TMP_LOG | grep -v DBG | sed s/^[][]*/”

“/`;
foreach $vv(@var){
if($vv=~m/$pat/){
print qq(

);;
$pat_line = `cat -n $TMP_LOG | wc -l`;
$line_num = $pat_line + 1;
}
elsif(defined $pat_line){
if(not $vv=~m/^&/ and not $vv=~m/error/ and not $vv=~m/arning/){
print qq(

);
$lines = `cat -n $TMP_LOG | wc -l`;
$line_num = $lines + 1;
}
}
else{
$lines = `cat -n $TMP_LOG | wc -l`;
$line_num = $lines + 1;
}
}
sleep 0.1;
}

print qq(

Patch Apply

$vv
$vv

);
`cat $TMP_LOG >> $INSTALL_LOG`;
my $sta = grep /Succeed/, $TMP_LOG;
button_table_start();

if(!$sta){
# print “sta=$stan”;
print “Patch install successfully, please reboot your systemn”;
print qq(


n);
print qq(

);
write_action_button(“reboot”,$software_26,”javascript:document.rebootForm.submit()”);
print qq(
);
exit 0;
}
else{
print “Install failedn”;
write_action_button(“back”,”<< $software_10","index.cgi"); print "sta=$stan"; exit 0; } button_table_end(); `rm -rf $TMP_LOG`;

分类: 科技 标签:

ftp share_info, share_modify

2006年12月3日 没有评论

sub share_info($$)
{
my $invocant = shift;
my $share = shift;
unless( defined $share) {
ftp_error->set_error( $ftp_error::error_parameter );
return undef;
}
my $cfg = Config::IniFiles->new();
unless( $cfg) {
ftp_error->set_error( $ftp_error::error_file_IO);
return undef;
}
$cfg->SetFileName($file_share_config);
$cfg->ReadConfig();
return $error_share_not_exist unless( $cfg->SectionExists($share));
my $pathname = $cfg->val( $share, $tag_pathname);
my $guest = $cfg->val( $share, $tag_guest);
my $readonly = $cfg->val( $share, $tag_readonly);
my $hide = $cfg->val( $share, $tag_hide);
return ($share, $pathname, $guest, $readonly, $hide);
}
…..
sub share_modify($$$$$$)
{
my $invocant = shift;
my( $share, $pathname, $guest, $readonly, $hide) = @_;
unless( defined $share && defined $pathname
&& defined $guest && defined $readonly && defined $hide) {
ftp_error->set_error( $ftp_error::error_parameter );
return undef;
}
……

分类: 科技 标签:

Program: fix two P1 bugs

2006年12月3日 没有评论

In the last two weeks, I fixed two P1 bugs. One is saving setting when update ftp share, the other is displaying patch install process. Almostly all my energy were put into programming. It’s so long that I did not touch program since 2002 writing ASP in Wuhan. I read many Perl manuals to learn the perl syntax and try to apply it in a short time, though in fact, these two fixing took me nearly two weeks. It was low working-rate. I’m still pleased with my working, a famous German writer said “It maybe not the best, but is good as being finished.”

I learn more from two cases not only Perl experience, but also, the most important thing, I am really programmer. The programing seems to be annoyed and charming job, some lines of code could work as what you want. Still do I have litter difficult in improve the rate, and I believe I could be more familar with more practises.

More patience, will get more. Read the whole program first, do more thinking, then start modify. Bruce said, the preparing work is the key during fixing problems. Sometimes, perhaps I’m too anxious to have enough preparing thinking, it wasted my external spirit to try and try. It’s not benifit for me. I’ll pay more attention on the ready process.

nscd and RAID6 will be the next points researched.

I’ve been in Plasmon for four months. Before Dec,25th, we will fly to Sanya for our holiday, and I brought a DV last week. In the December of last year, I did not go to Hainan even emergency AF2 issue happened in Hainan.

分类: 科技 标签:

Week summary

2006年11月19日 没有评论

Spin out/in SATA module from kernel when physically remove the drivers, especial Hot-Swap case. I did a whole testing on SNAZ-S4-400 platform(RAID0, 1,5), plug the disk out when there’s (or not) I/O, when the “miss” hard disk inserted back, the RAID were all recoveried. Bruce said, Irish had produced many disk failure issues when hotswap. I would follow up this testing and plan to use larger I/O pression.

“smbpasswd” add user to LDAP
1.In the “/etc/samba/smb.conf”, modify the second line as the following:
Passdb backend=ldapsam: ldap://192.168.123.33:389
This means the new users will be added here.
2.In localhost, # adduser phillip
# smbpasswd -a phillip
3. Then issue “ldapsearch -x”, the new user “phillip” is in the returned entries.

IE 7.0 running as IE6.0:
Microsoft supplied UASU tool for opening an IE7.0 instruce that emluates IE6 by sending the IE6 use agent string. I downloaded UASU.msc and installed, it works well on IE7.0 platform.

Perl, for about two months, I restarted to learn it now, and I must pay more attention on enhancing my program ability, such as read, write and debug. Bruce gave me a good advice, learn this program when using it, read the manul when needed. I think it is right and will be on this learning road. My schedule is spending one week, to master this program as almost our general programs are all written in Perl.

Before do anything, think about it careful, try to make it more clearly. Then, just do it.

分类: 科技 标签:

RAID commands

2006年11月13日 没有评论

Check the RAID setting by running the following command:
# cat /proc/mdstat
Personalites: [md5]
md0: active raid5 sdd1[2] sde1[3] sdc1[1] sdb1[0]
75469842 blocks level 5, 128k chunk, algorithm[3/3] [UUU]
Here, the first “3” in “[3/3]” indicates the how many devices in the array; the second “3” means active device numbers. If one device in array has been destoried, the second number would decrease “1”, for example, one disk failed, the second number is “2” as the result of “3-1”.
“UUU” marks the currently using device status. Assume /dev/sdb1 failed, it should be [_UU], at this point, the array runs in degrade mode without redundant.
“sdd1[2]”, assume “n” is the number of devices in array: if the number in “[]” is less than “n”, it means the device is active,else if the device is for backup. When one device down, the coresponding “[]” will be marked as “[F]”.

Mark the /dev/sdb1 as failed:
# mdadm /dev/md0 -f /dev/sdb1
Note, in this case, “/dev/sdb1” was component of “/dev/md0”.

Remove failed device:
# mdadm /dev/md0 -r /dev/sdb1

Add device to array:
# mdadm /dev/md0 -a /dev/sdb1

Start all arrays in “mdadm.conf”
# mdadm -As

Start idenfied array:
# mdadm -As /dev/md0

Stop array:
# mdadm -S /dev/md0

List detail information:
# mdadm -D /dev/md0

分类: 科技 标签:

RHCE study notes

2006年11月12日 没有评论

Chkconfig: maintain /etc/rc.d directory structure, add, remove change serivce, list time stamp information. Check the state of particular service.
# chkconfig –list sendmail
# chkconfig –level 4 sendmail off

The “ntsysv” command takes the functionality of chkconfig and wraps it into an easy-to-use screen interface.

kdbconfig: set the type of keyboard, refer to “/etc/sysconfig/keyboard”
timeconfig: set time zone, refer to “/etc/sysconfig/clock”
mouseconfi: set mouse, refer to “/etc/sysconfig/mouse”
sndconfig: screen-oriented interface to make install sound card.

NT boot, NT’s loader installs to the master boot record(MBR) and relies on three major files: ntdetect.com, ntldr, boot.ini.

Once you have a working LILO boot disk, you can simply copy the boot sector from the disk instead of the harddriver,eg:
# dd if=/dev/fd0 of=/bootsect1n1 bs=512 count=1
I think the first 512 byte in /dev/fd0 may record the boot information.

RAID: Only three are implemented in Linux, linear,0,1,5
You can assign additional disks from failover, called spare disks within the RAID set, when one disk fails it is marked as bad and the data is reconstructed on the first space disk, which is used as replacement, resulting in litter or no downtime. When using fdisk to format RAID component disks, the Partition ID must be set as “FD”.
# mk2fs -b 4096 -R stride=8 /dev/md0

To check what interrupts you are using:
# cat /proc/interrrupts
i386 PC have up to 15 usable interrupts out of 16: 0-15

To get a list of IO address and DMA channels used:
# cat /proc/ioports

To check DMA resources:
# cat /proc/dma

To load modules into kernel:
# modprobe sb irq=5 io=0x220 dma=0
comment, here “sb” means sound device.

Laptops have a special peripheral interface bus called PCMCIA, that requires a special set of drivers and service to handle it. Whenever a card is loaded, you can check the “/var/run/stab”. To see waht setting your card is set to, you can issue the “cardctl” command.

Advanced Power Management(APM)
When the BIOS tells the daemon about a pending suspend or a standbycall, it immediately calls sync(and writes all cached file system information to disk immediatelly). It will then sleep for two seconds and tell BIOS to continute.

# runlevel
5 3
means, you were in level 5 last and are now in level 3.

LCD: Liquid Crystal Display

To have the kernel dynamically load and unload modules as needed, a special kernel thread, “kmod” is called upon to control the loading and unloading of modules. Refer to “/etc/modules.conf”.

To load modules on command line:
# depmod -a
# modproble eth0
Place modules in “modules.conf” to have them automatic loaded.

Two limits manage disk consumption:
1. Limit the number fo inodes a user may have;
2. Limit the number of disk blocks a user’s file may consume

Quota are enabled on a file system basis only, they CAN NOT be set on directories.

分类: 科技 标签:

NetVault

2006年11月7日 没有评论

NetVault is used to backup data. The SNAZ system has been updated from NetVault 7.4 to latest NetVault 7.4.3. thus supports backup and restore ACL and Extended Attributes.I am verifing this new function these days.

First, in SNAZ operating system, start up backup service. Create a large volume as virtual harddisk for backup and restore. and then create other shares and files with assigning ACL and EAs. Second step, install NetVault GUI management software in Windows platform(or Linux), configure the SNAZ as NetVault server: Addministrator-Domain, select SNAZ; Device-Management-Server-Selection, select SNAZ, Add-Add Standalone Driver, and create virtual disk(right click) on precious large volume(Driver location-/exports/large_volume). Now, could run Backup and Restore.

Extended file attributes:
Permission, records of creation and modification times, author of a document, character encoding of a plain-text document, or a checksum. There are four name spaces: user,trusted,security and system.

Attr:(Add, remove and print)
set or add extended attribute to file/folder:
# attr -s attrname -V attr_value pathname(file/folder name)
print/show extended attribute of file/folder:
# attr -g attrname pathname(file/folder name)
remove identified attribute:
# attr -r attrname pathname(file/folder name)

getfattr -d: print file/folder’s EA entries.

According to NetVault supporting max 64KB EAs, how to create a pure 64K test file?
#!/bin/bash
# create 64KB EA file
for ((i=0;i<=524288;i++)) do printf "i"; done This script will create a 64KB test file, with 524288 "i" characters. But when I tried to used this output file in the following commands: # attr -s Club -V `cat 64KB_file_name` /exports/barcelona There will be an error messages: argument list too long. I had to assign EA one by one: # !/bin/bash # assign EA one by one for ((i=0;i<=524388;i++)) do attr -s Team_$i -V i /exports/barcelona done It would be added successful, but issue "getfattr -d /export/barcelona" still meet "Argument list too long" errors. I'll fixed this issue tomorrow.

分类: 科技 标签:

Preparing for RHCE

2006年11月6日 没有评论

Keep on reading Study Guide.

分类: 科技 标签:

Summary (Three months in Plasmon)

2006年10月31日 没有评论

I have been working in Plasmon for three months. During these days, I tried to know the SNAZ system and the architecture of Plasmon.com. The important jobs are building LAT, install Iplanet, install OpenLDAP+SSL and did some performance testing on these platforms. Though sometimes it was hardly time, keep on researching and looking up in Internet, query, or join email group. Everything would be resolved.

I feel I’ve learned much in this new team. The next target, for me, is RHCE. I plan to accomplish this certificated test in about January or Febrary,2007.

分类: 科技 标签: