Category Archives: English

Extends Storage – Performing an online resize

RedhatThis is a dangerous & thrilling step because we do it on production server directly. I presumed you have read the following posts : LVM Subject  so we are focusing on How to Extends our Linux Storage – Performing an online resize (on the fly). It means without disturbing our traffic or other realtime activities.

STEP 1 : Check logical volume information after check filesystems disk space to ensure  which partition that we have to extends.
#####################################
root@svr-2:~# lvs
File descriptor 3 (pipe:[1244115786]) leaked on lvs invocation. Parent PID 16940: -bash
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
root ubuntu -wi-ao 398.75g
swap_1 ubuntu -wi-ao 1.00g

STEP 2 : Get the information about newly added hard drive using fdisk -l command
#####################################
Disk /dev/sdd: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders, total 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdd doesn’t contain a valid partition table

STEP 3 : Continue to create the partition on the newly added harddrive, type n , p (primary), 1 (partition number), t (filesystems type), 8e (for Linux LVM), w (write changes), then the partition table will be altered
#####################################
root@svr-2:/# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3d67c672.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

STEP 4 : identify the already mounted lvm filesystems type (ext4 will be global filesystems we used)
#####################################
root@svr-2:/# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/ubuntu-root ext4 412097132 316081888 75145552 81% /
udev devtmpfs 8208612 4 8208608 1% /dev
tmpfs tmpfs 1643540 300 1643240 1% /run
none tmpfs 5120 0 5120 0% /run/lock
none tmpfs 8217700 0 8217700 0% /run/shm
/dev/sda1 ext2 233191 27519 193231 13% /boot

Continue reading

Advertisements

Network File System (NFS)

This is my first look with NFS,

although i’ve tried NFS about 2 years ago, but i never write about that.
These are my requirement for test: 3 VM with connectable network. Such a 1 nfs server (192.168.56.2)  and 2 nfs client (192.168.56.3-4 CentOS 6.2 minimal server), package nfs, rpcbind (portmap service alternative, since kernel version was growth. Two nfs client should be run this service), iptables, telnet (optional package).

Server Configuration
We already set /data1 and /data2 as two partition will be share.
Edit /etc/exports file
nfs2Configure allow and deny hosts
nfs4Configure /etc/sysconfig/nfs for rpcbind, mountd, nfsd, etc static port
nfs5Configure iptables
nfs3

Client Side
Just use these params to mount them
~# mount -o rw <ip_nfs_server>:/<path_folder> /<path_destination>
Then your file/ folder will be set as user and group nfsnobody by nfs server.

Result
nfs1
Then if you want to execute the service or mounting activity automatically, set them with this params:
~# chkconfig <service_name> on
~# vi /etc/fstab // edit fstab foreach client

 <ip_nfs_server>:/<path>   /<destination_path>  nfs  ro  0  0
 <ip_nfs_server>:/<path>   /<destination_path>  nfs  rw  0  0

 

References
[1] Aji. Kresno, “Sharing File di Jaringan dengan NFS” . 2003 (Mei): 1-2. Retrieved 16 january 2015.
[2] http://eduardo-lago.blogspot.com/2012/02/installing-nfs-on-centos-62.html

Linux Terminal Server Project (LTSP)

First, i will you show how could this ‘Thin Client’ method work. Although it can’t be more powerfull than Cloud or Virtual Machine (i have described it in this sites). The LTSP server only completely handled the disk space and allocate them into the client (then you have to manage quota for them).  It was not memory, processor, etc, only Harddisk Drives. It can be an alternative for they aren’t have much cost or requirement to initiate Cloud Computing (https://tifosilinux.wordpress.com/2015/01/08/vcenter-server-appliance-testing/ and https://tifosilinux.wordpress.com/2015/01/03/cloud-computing-dengan-vmware/).

Here we are,
In this test can be very text book since i’ve got it from infoLINUX magazines (03/2013) but with little adjustment, you have installed Ubuntu 12.04.2 desktop precise with memory 1GiB and 16GiB HDD for LTSP server. Then you have to preparing the network configuration and the dependency of packages by using apt-get .
// i presumed that we are using two devices, which one devices function as a connection to internet (eth0) and the other one for local/ internal network (eth1)
~# vim /etc/network/interfaces
netLTSP
~# apt-get update
~# apt-get install ltsp-server-standalone openssh-server ltsp-server ltsp-client
dhcpLTSP
~# sed -i ‘s/INTERFACES=””/INTERFACES=”eth1″/’ /etc/default/isc-dhcp-server
Continue reading

vCenter Server Appliance – Testing

Alhamdulillah,

Once more, here with my little paper for you, for me, ..for us

Cheers

Chat in The Terminal with ‘Write’

Anything that you can do with UNIX/Linux are chatting with secure connection by write. Besides talk, ytalk, or wall which is broadcasting your message to all of user logged in, it should be not comfortable enough.

Here is an example, first you have grep tty as active user logged in with these params:
~# last -n10 | grep dhinesh | grep ‘still logged in’ | awk ‘{print $2}’ | head -1

[root@Jojoku-Chat ~]# write dhinesh pts/1
hello dhinesh

anything all right with ulimit ?
seems you are  still login in this server

^CYou have new mail in /var/spool/mail/root
[root@Jojoku-Chat ~]#

Cheers

IPTABLES (picture worth a thousand words .. again)

Hoaaammm.. almost get bored with another task after this one

First
PREROUTING_lokal

Second
PREROUTING_redirect# Generated by iptables-save v1.4.7 on Fri May 15 15:52:27 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1839883:265041417]
-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 443 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 17135 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT

Noted : How to delete specific rules on iptables
~# iptables D INPUT s 127.0.0.1 p tcp dport 111 j ACCEPT
or you can delete by line numbers

~# iptables -L –line-numbers
~# iptables -D INPUT <line_numbers>

Third
…. try to Imagine 😀

Control Available Resources with ulimit

Besides you can check by using sysctl -p for kernel share maximum memory etc.
Use these params to setup your max open files, max locked memory, max user process etc. For an example :
~# ulimit -a
~# ulimit -n 1048576
~# ulimit -l unlimited
~# ulimit -u unlimited

Or defining them into /etc/security/limits.conf like these:
*               soft    memlock         unlimited
*               hard    memlock         unlimited
*               soft    nofile          1048576
*               hard    nofile          1048576
*               soft    nproc           unlimited
*               hard    nproc           unlimited

But you are required pam_limit.so on your /etc/pam.d/su
session         required        pam_limits.so
or /etc/pam.d/common-session (debian only):
session         required        pam_limits.so
or /etc/pam.d/su
session         required        pam_limits.so         readenv=1

NOTED :

<item>
core
limits the core file size (KB)
data
maximum data size (KB)
Continue reading