Linux GRUB Recovery


If you find GRUB screen when startup your machine like this,
Here the ways to solve that :
1. First step
GNU GRUB version 0.95 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]

grub>find /boot/grub/stage1
(hd0,1)

it means linux at hda1, it probably give different result on your machine.
if it didn’t show any result, go forward to step 2.

grub>root (hd0,1)

grub>setup (hd0)

grub>quit

Then reboot your machine …
if you still find GRUB screen, go to step 2.

2. Second step
GNU GRUB version 0.95 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]

grub> root (hd0,1)
grub> kernel /vmlinuz-2.x.xx-xx.EL ro root=/dev/hda1

if you don’t remember what your kernel version, better go to step 3.

grub> boot

If it still give fine result, try step 3.

3. Third step
boot Linux Live CD and open the terminal.
example : linux at /dev/hda1

$ mount /dev/hda1 /mnt
$ chroot /mnt
# grub-install /dev/hda
# exit
$ reboot

Leave a Comment

LED status on HP Machine


sometimes we found our LED HP server states green, blinking yellow or red.
Just visit official site.

Leave a Comment

Virtual host on proftpd


If you want to create virtual host for your FTP, just edit your proftpd.conf
# vi proftpd.conf


Note that ip_address_1 dan ip_address_2 owned by this server.
We also can configure another port that will be use for specific virtual host.

Leave a Comment

logadm on Solaris


If we want to administering log files on solaris, we can use logadm. Another option we also can use logrotate.
For example :
we have log files at /var/log/tinyproxy.log
1. we want to rotate log after reach 1MB.
# logadm -w /var/log/tinyproxy.log -s 1m

2. we want to rotate log every day.
# logadm -w /var/log/tinyproxy.log -p 1d

3. we want to keep until previous 10 day only.
# logadm -w /var/log/tinyproxy.log -C10

etc…

for more details, you should see logadm manual.
File configuration of logadm at /etc/logadm.conf

For default logadm run every morning 3:10 AM by crontab process.
You can see crontab list with this :
# crontab -e

If you just see number after running command above,
# crontab -e
713

you should define your editor profile.
# export EDITOR=vi
# crontab -e

Leave a Comment

Persistence Profile on BIG-IP


BIG-IP has feature persistence profile, it uses for keep existing session on a member.
For example :
Pool have 2 members (A and B), for example request will redirect to A, but sometimes it can redirected to B for a while, it cause client losing connection to A.

How to create persistence profile based on source address.
- Go to Local Traffic -> Virtual Servers -> Profiles -> Persistence
- Click create to make a new persistence profile
- Change Persistence Type to “Source Address Affinity”
- Make sure that Parent Profile “source_addr”
- Don’t forget to give a name to your new profile

Assigning Persistence Profile to Virtual Servers.
- Go to one of your virtual servers, and then go to tab “Resources”
- Assign Default Persistence Profile with your new persistence profile.

Leave a Comment

User jail on Proftpd


If you want to jail user when logging in to FTP server only to their home directory,
you should edit line below :

# more /usr/local/etc/proftpd.conf
—————-
DefaultRoot ~
—————-

But if you want user can change directory to all directory, you just uncomment that line.

Leave a Comment

General Solaris Command


Shows the ethernet address arp table
# arp -a

Delete a stale ethernet entry for host xhost
# arp -d xhost

Reports disk space used in Kilobytes
# du -k

Reports only total disk space used in Kilobytes
# du -sk

Tells you how big the / files are in reverse order
# du -ad / | sort -nr

Mount an ISO 8660 CDROM
# /bin/mount -F hsfs -o ro /dev/sr0 /cdrom

Disk geometry and partitioning info
# prtvtoc /dev/rdsk/c0t0d0s2

Zero’s out the file without breaking pipe
# cat /dev/null > filename

Make a mirror image of your boot disk
# dd if=/dev/rdsk/… of=/dev/rdsk/… bs=4096

Check a UFS filesystem
# fsck -F ufs /dev/rdsk/cxtxdxsx

Check a UFS filesystem with auto-answer “yes”
# fsck -F ufs -y /dev/rdsk/cxtxdxsx

Check using an alternate super block
# fsck -F ufs -o b=97472 /dev/rdsk/cxtxdxsx

Verify reconfigurable hardware resources
# cfgadm

Display kernel module information
# /usr/sbin/modinfo

Load a kernel module
# /usr/sbin/modload

Unload a kernel module
# /usr/sbin/modunload -i

Tuneable kernel parameters
# nm -x /dev/ksyms | grep OBJ | more

Show system kernal tunable details
# /usr/sbin/sysdef

Display Memory Size
# prtconf | grep “Memory size”

Displays number active established connections to localhost
# netstat -a | grep EST | wc -l

Network statistics for specific device
# netstat -k hme0

Show the TCP/IP network interfaces
# netstat -i

Displays routing information but bypasses hostname lookup
# netstat -rn

Show the state of all sockets
# netstat -a | more

Follow the route to the ipaddress
# traceroute

Show processes that are running from /var
# fuser -uc /var

Shows processes’ current open files
# pfiles

An alternative for top command
# prstat -a

Displays CPU % usage for each process in ascending order
# /usr/ucb/ps -aux | more

Show all processes running
# ps -ef | more

Print the parent/child process ‘tree’ of a process
# /usr/proc/bin/ptree

Print the working directory of a process
# /usr/proc/bin/pwdx

Returns the process utilizing the most cpu and quits
# top -b 1

Watch all network packets on device ce0
# snoop -d ce0

Saves packets from device ce0 and between host1 and host2 to a file
# snoop -o /tmp/mylog -d ce0 host1 host2

Makes a 10 Megabyte swapfile in /export/disk
# mkfile -v 10m /export/disk1/myswap

List the amount of swap space available
# swap -s

Add a swapfile
# swap -a /export/disk1/swapfile

Deletes a swap device
# swap -d /dev/dsk/c0t0d0s4

List the current swap devices
# swap -l

Changes eeprom autoboot? setting to auto boot
# /usr/sbin/eeprom auto-boot? true

Set the system to perform diagnostics on the next reboot
# /usr/sbin/eeprom diagswitch? true

Check /etc/group file syntax
# /usr/sbin/grpck

Check /etc/passwd file syntax
# /usr/sbin/pwck

Clear host specific network configuration information
# /usr/sbin/sys-unconfig

Show eeprom parameters
# /usr/sbin/eeprom

Show system configuration details
# /usr/sbin/prtconf -vp

Display number of processors
# psrinfo | wc -l

Provides cumulative system report
# sar -A

Report use of file access system routines
# sar -a

Report CPU Utilization
# sar -u

Displays system information
# uname -a

Leave a Comment

Show I/O error solaris


Show I/O error solaris
# iostat -eE
—- errors —

sd0 0 0 0 0
ssd0 0 0 0 0
ssd1 0 0 0 0
nfs2 0 0 0 0
sd0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: TOSHIBA Product: ODD-DVD SD-C2732 Revision: 1051 Serial No:
Size: 0.00GB
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
ssd0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: MAT3073F SUN72G Revision: 0602 Serial No: 0527B08LLN
Size: 73.40GB
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
ssd1 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: MAT3073F SUN72G Revision: 0602 Serial No: 0526B08BHH
Size: 73.40GB
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

Leave a Comment

Setting File Descriptor kernel parameter solaris


For file descriptor, add this lines to /etc/system
# vi /etc/system
—————-
set rlim_fd_max=8192
#(def: 1024, Process open file descriptors limit; should account for the expected load, for the associated sockets, files, pipes if any)
set rlim_fd_cur=8192
#(def: 256, Process open file descriptors limit; should account for the expected load, for the associated sockets, files, pipes if any)
set sq_max_size=0
#(Controls streams driver queue size; setting to 0 makes it infinity so the performance runs wont be hit by lack of buffer space)
set tcp:tcp_conn_hash_size=8192
#(The connection hash table keeps all the information for active TCP connections)
set autoup=60
set pcisch:pci_stream_buf_enable=0
—————–

You should reboot your server to make changes.

Leave a Comment

Setting TCP kernel parameter solaris


Setting TCP kernel parameter solaris

How to know your TCP current kernel parameter

# /usr/sbin/ndd -get /dev/tcp tcp_ip_abort_cinterval;
180000
# /usr/sbin/ndd -get /dev/tcp tcp_time_wait_interval;
60000
# /usr/sbin/ndd -get /dev/tcp tcp_conn_req_max_q;
128
# /usr/sbin/ndd -get /dev/tcp tcp_conn_req_max_q0;
1024
# /usr/sbin/ndd -get /dev/tcp tcp_ip_abort_interval;
480000
# /usr/sbin/ndd -get /dev/tcp tcp_keepalive_interval;
7200000
# /usr/sbin/ndd -get /dev/tcp tcp_rexmit_interval_initial;
3000
# /usr/sbin/ndd -get /dev/tcp tcp_rexmit_interval_max;
60000
# /usr/sbin/ndd -get /dev/tcp tcp_rexmit_interval_min;
400
# /usr/sbin/ndd -get /dev/tcp tcp_smallest_anon_port;
32768
# /usr/sbin/ndd -get /dev/tcp tcp_slow_start_initial;
4
# /usr/sbin/ndd -get /dev/tcp tcp_xmit_hiwat;
49152
# /usr/sbin/ndd -get /dev/tcp tcp_recv_hiwat;
49152
# /usr/sbin/ndd -get /dev/tcp tcp_fin_wait_2_flush_interval;
30000

Change your TCP kernel parameter as you want :p
/usr/sbin/ndd -set /dev/tcp tcp_ip_abort_cinterval 10000;
/usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 30000;
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q 1024;
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q0 4096;
/usr/sbin/ndd -set /dev/tcp tcp_ip_abort_interval 60000;
/usr/sbin/ndd -set /dev/tcp tcp_keepalive_interval 300000; -For high traffic web sites lower this value-
/usr/sbin/ndd -set /dev/tcp tcp_rexmit_interval_initial 3000; -If retransmission is greater than 30-40%, you should increase this value-
/usr/sbin/ndd -set /dev/tcp tcp_rexmit_interval_max 10000;
/usr/sbin/ndd -set /dev/tcp tcp_rexmit_interval_min 3000;
/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 1024;
/usr/sbin/ndd -set /dev/tcp tcp_slow_start_initial 2; -Slightly faster transmission of small amounts of data-
/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 32768; -To increase the transmit buffer-
/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 65536; -To increase the receive buffer-
/usr/sbin/ndd -set /dev/tcp tcp_fin_wait_2_flush_interval 1000; -if you want to release FIN-WAIT_2 connections faster-

or you can add all above “set” command at /etc/init.d/inetsvc or create new file on /etc/rc3.s/Sxx

Leave a Comment

Older Posts »
Follow

Get every new post delivered to your Inbox.